Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Support Cython 3.x #1104

Merged
merged 2 commits into from
Oct 5, 2023
Merged

chore: Support Cython 3.x #1104

merged 2 commits into from
Oct 5, 2023

Conversation

jetuk
Copy link
Member

@jetuk jetuk commented Aug 22, 2023

Several updates required to handle building with Cython 3.x.

  • Include noexcept for GLPK callback functions.
  • Handle name mangling of attributes using __. Cython 3 aligns more closely with Python 3 in this respect.

There should be a review of the use of except given the new behaviour in Cython 3, but that is not done here.

@jetuk jetuk requested a review from Batch21 August 22, 2023 13:03
@jetuk
Copy link
Member Author

jetuk commented Aug 22, 2023

This fixes #1102

@jetuk
Copy link
Member Author

jetuk commented Aug 22, 2023

It might also be possible to remove the Numpy API warnings, but that could be a separate PR.

Several updates required to handle building with Cython 3.x.

- Include `noexcept` for GLPK callback functions.
- Handle name mangling of attributes using __. Cython 3 aligns
more closely with Python 3 in this respect.

There should be a review of the use of `except` given the new
behaviour in Cython 3, but that is not done here.
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4", "cython<3", "numpy"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Changes to attribute names mean that Pywr can't now be built with cython<3 so this should probably be updated to "cython>=3"

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@jetuk jetuk requested a review from Batch21 October 4, 2023 13:23
@jetuk jetuk merged commit 1981de1 into master Oct 5, 2023
12 checks passed
@jetuk jetuk deleted the cython3 branch October 5, 2023 14:26
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.

None yet

2 participants