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

Cython 3.1+ fixes #1452

Merged
merged 3 commits into from
Oct 10, 2024
Merged

Cython 3.1+ fixes #1452

merged 3 commits into from
Oct 10, 2024

Conversation

greglucas
Copy link
Contributor

This fixes the errors that came up during Cython3.1a testing. I'm not a Cython expert by any means, so let me know if there is a better way to handle any of these. Do you want to add a test/workflow for upcoming Cython releases?

Test with this nightly wheel release install locally:

pip install --upgrade --pre --only-binary :all: -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple cython numpy
pip install .
python -m pytest

In the Geod init there is an unsafe usage of inline if/else to cast
the values. This is only used for the repr, so just live with the
extra ".0" in the display rather than casting integers.
…3.1+

- Avoid Unsafe C derivative of temporary Python reference
  These are in the Geod repr and c_authority casting to a temp variable
- Explicitly cstrencode when bytes are expected instead of strings
Copy link

codecov bot commented Oct 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.50%. Comparing base (efa3faa) to head (ad516d1).
Report is 55 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1452      +/-   ##
==========================================
+ Coverage   96.40%   96.50%   +0.09%     
==========================================
  Files          20       20              
  Lines        1810     1830      +20     
==========================================
+ Hits         1745     1766      +21     
+ Misses         65       64       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@snowman2 snowman2 added this to the 3.7.1 milestone Oct 9, 2024
@snowman2 snowman2 added the bug label Oct 9, 2024
@snowman2
Copy link
Member

snowman2 commented Oct 9, 2024

Do you want to add a test/workflow for upcoming Cython releases?

Yes, that change is welcome.

@greglucas
Copy link
Contributor Author

Do you want to add a test/workflow for upcoming Cython releases?

Yes, that change is welcome.

I added it to the PROJ_latest workflow to just install the latest Cython there as well. Let me know if you want it as an isolated workflow instead.

@snowman2
Copy link
Member

Thanks @greglucas 👍

@snowman2 snowman2 merged commit 39cf3c9 into pyproj4:main Oct 10, 2024
19 checks passed
@greglucas greglucas deleted the cython-3.1 branch October 10, 2024 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upcoming Cython 3.1 str <-> bytes errors
2 participants