Skip to content

Conversation

@CnlPepper
Copy link
Member

This PR builds on the work of @munechika-koyo in #426.

Raysect is finally moving to Cython 3.1!

@CnlPepper CnlPepper self-assigned this Jul 19, 2025
@CnlPepper CnlPepper mentioned this pull request Jul 19, 2025
Copy link
Contributor

@munechika-koyo munechika-koyo Jul 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an out-of-scope suggestion for this PR, but what about using dynamic versioning tools like setuptools-scm or hatch-vsc?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use setuptools-scm at Luffy AI, it works well. I'll look into integrating it after this PR. Also planning to use cibuildwheel to build releases.

@CnlPepper CnlPepper changed the base branch from development to feature/meson-python July 20, 2025 19:38
@CnlPepper
Copy link
Member Author

I believe all the necessary changes (plus some API fixing) have been completed.

I've temporarily enabled the legacy noexcept behaviour for two reasons:

  1. we have 100s of methods needing noexcept adding. If it is proven to affect performance in cython 3 I'll add them later, however I want to do some testing first to see if the new default is acceptable.
  2. pycharm have not updated their syntax highlighter to handle cython 3. I've raise this issue with them again, fairly strongly (its been 2 years).

This does mean you will see a huge number of deprecation warnings which I can't seem to disable. Please ignore them for now.

@CnlPepper
Copy link
Member Author

Performed some quick testing. Running without noexcept does hit performance. So we'll run with legacy mode for now, until the toolchain issues are addressed.

@CnlPepper CnlPepper marked this pull request as ready for review July 21, 2025 10:00
This was referenced Jul 21, 2025
@CnlPepper
Copy link
Member Author

We have some positive progress on pycharm addressing their syntax highlighting:

https://youtrack.jetbrains.com/issue/PY-59249/Cython-3-except-noexcept-legal-syntax-red-lined

I'm tempted to move forward with the merge this evening and file an issue to rework the code to address the deprecation warning once the pycharm fix is in the wild.

@CnlPepper
Copy link
Member Author

Have decided to merge this and raised an issue to address the deprecation later.

@CnlPepper CnlPepper changed the base branch from feature/meson-python to development July 22, 2025 18:01
# Conflicts:
#	raysect/core/math/sampler/meson.build
#	raysect/optical/observer/imaging/meson.build
#	raysect/optical/observer/nonimaging/meson.build
@CnlPepper CnlPepper merged commit 5dcec9b into development Jul 22, 2025
10 checks passed
@CnlPepper CnlPepper deleted the feature/cython3 branch July 22, 2025 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants