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

Bump Cython Old #18

Merged
merged 8 commits into from
Aug 18, 2024
Merged

Bump Cython Old #18

merged 8 commits into from
Aug 18, 2024

Conversation

nauaneed
Copy link
Contributor

@nauaneed
Copy link
Contributor Author

This is not bad, either.
image
benchmark_20240814_093504

since support for usage of DEF/IF is expected to be removed,
IF are remove from code as well.
cyarray/msstdint.h was added in
24c49cc since stdint.h has not been there
pre MSVC2015. It should be fine to remove this now.
@nauaneed nauaneed force-pushed the bump-cython-old branch 2 times, most recently from d0c464b to c482445 Compare August 15, 2024 07:03
@nauaneed nauaneed marked this pull request as draft August 15, 2024 07:25
cython>3.0 disallows setting `ndarray.data=<char *>some_data`.
This commit introduces a dirty workaround for this.
- all nogil prefixed with noexcept
@nauaneed nauaneed marked this pull request as ready for review August 17, 2024 18:13
@nauaneed nauaneed force-pushed the bump-cython-old branch 6 times, most recently from ef6a1d3 to f157c4e Compare August 17, 2024 18:48
Copy link
Contributor

@prabhuramachandran prabhuramachandran left a comment

Choose a reason for hiding this comment

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

Looks good to me apart from the change to the pyproject.toml which I am not sure about.

@@ -2,7 +2,7 @@
requires = [
"wheel>=0.29.0",
"setuptools>=42.0.0",
"oldest-supported-numpy",
"Cython<3.0",
"numpy",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it recommended to use "numpy" instead of "oldest-supported-numpy" now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure if that is recommended, but the problem is this:

requirements.txt and setup.py have just "numpy". So, pip install -r requirements.txt installs the latest numpy.

Then with pip install -e . cyarray is compiled with oldest-supported-numpy as specified in pyproject.toml.

Eventually it ends up with,

ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

like here: https://github.com/pypr/cyarray/actions/runs/10434451995/job/28897324886

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, so what is the oldest-supported-numpy version here? Is it < 2.0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, its 1.23.2.

Copy link
Contributor

@prabhuramachandran prabhuramachandran left a comment

Choose a reason for hiding this comment

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

Just one minor nit, apart from that I am happy to merge this. Thanks!


cimport numpy as np
np.import_array();
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove the semicolon.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have amended this and force pushed now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks!

pyproject.toml specified oldest supported numpy. This is changed.
The .pyx file is also updated to avoid avoid errors.
@prabhuramachandran prabhuramachandran merged commit 448bd67 into pypr:master Aug 18, 2024
9 checks passed
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