Skip to content

BUILD: Bump Cython to 3.1 #61519

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

Merged
merged 7 commits into from
Jun 4, 2025
Merged

Conversation

rhshadrach
Copy link
Member

ASVs: #60972 (comment)

@rhshadrach rhshadrach added Build Library building on various platforms Dependencies Required and optional dependencies labels May 30, 2025
@rhshadrach rhshadrach added this to the 2.3 milestone May 30, 2025
@@ -42,7 +42,7 @@
// followed by the pip installed packages).
"matrix": {
"pip+build": [],
"Cython": ["3.0"],
"Cython": [],
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure why this was ever specified; we'll use our envornment.yaml for ASVs.

Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

Could you also bump cython in the ci/deps files?

I suppose after this PR we'll need to bump Cython in the conda forge recipe too

@rhshadrach
Copy link
Member Author

Could you also bump cython in the ci/deps files?

Bumped. The pin there was cython>=0.29.33 (except freethreading which doesn't have any pin), but I do think having some upper bound is preferable.

From the 2 to 3 transition, I was cautious about accepting new versions and I think now overly so. What do you think about cython<4 instead?

@mroeschke
Copy link
Member

From the 2 to 3 transition, I was cautious about accepting new versions and I think now overly so. What do you think about cython<4 instead?

Yeah I would be OK with that (modulo pinning below alpha/rc release versions since Cython often to pre-releases before major version bumps)

@mroeschke mroeschke merged commit 5c286b7 into pandas-dev:main Jun 4, 2025
96 of 99 checks passed
Copy link

lumberbot-app bot commented Jun 4, 2025

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout 2.3.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 5c286b7ef9f63487169bed5a8fb5d31c00b9b1c3
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #61519: BUILD: Bump Cython to 3.1'
  1. Push to a named branch:
git push YOURFORK 2.3.x:auto-backport-of-pr-61519-on-2.3.x
  1. Create a PR against branch 2.3.x, I would have named this PR:

"Backport PR #61519 on branch 2.3.x (BUILD: Bump Cython to 3.1)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

@mroeschke
Copy link
Member

Thanks @rhshadrach

mroeschke pushed a commit to mroeschke/pandas that referenced this pull request Jun 4, 2025
mroeschke added a commit that referenced this pull request Jun 4, 2025
* Backport PR #61519: BUILD: Bump Cython to 3.1

* Remove files that don't exist on 2.3.x

---------

Co-authored-by: Richard Shadrach <45562402+rhshadrach@users.noreply.github.com>
@adamjstewart
Copy link
Contributor

Why was the lower bound removed? I just tried building with cython 0.29.36 and the build failed. What is the correct lower bound?

@rhshadrach
Copy link
Member Author

It seemed unnecessary, our CI will pull in 3.x regardless of the presence of a lower bound or not.

I would imagine you'll need at least 3.0. If you have a use case for pandas guaranteeing support for older versions of Cython, can you open an issue.

@adamjstewart
Copy link
Contributor

I definitely don't care about supporting older cython, I'm just worried that not specifying a lower bound will lead to issues. My specific issue occurred with the Spack package manager, not with pip. Not all package managers will always use a newer version if an old version is already installed. Conda may or may not have similar issues, I don't know enough about its internals.

@rhshadrach
Copy link
Member Author

Thanks; I can update this to include >= 3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Library building on various platforms Dependencies Required and optional dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ENH: Support for Python 3.13.2 free-threading version
3 participants