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

GH-45237: [Python] Raise minimum supported cython to >=3 #45238

Merged
merged 9 commits into from
Jan 17, 2025

Conversation

raulcd
Copy link
Member

@raulcd raulcd commented Jan 13, 2025

Rationale for this change

We do not require to support Cython 2 anymore.

What changes are included in this PR?

Bump required version of Cython

Are these changes tested?

Via CI

Are there any user-facing changes?

Yes, pyarrow cannot be compiled with Cython2 anymore.

Copy link

⚠️ GitHub issue #45237 has been automatically assigned in GitHub to PR creator.

@raulcd
Copy link
Member Author

raulcd commented Jan 13, 2025

@github-actions crossbow submit -g python

Copy link

Revision: c6bf8d4

Submitted crossbow builds: ursacomputing/crossbow @ actions-07fd1dc2a0

Task Status
example-python-minimal-build-fedora-conda GitHub Actions
example-python-minimal-build-ubuntu-venv GitHub Actions
test-conda-python-3.10 GitHub Actions
test-conda-python-3.10-hdfs-2.9.2 GitHub Actions
test-conda-python-3.10-hdfs-3.2.1 GitHub Actions
test-conda-python-3.10-pandas-latest-numpy-latest GitHub Actions
test-conda-python-3.10-substrait GitHub Actions
test-conda-python-3.11 GitHub Actions
test-conda-python-3.11-dask-latest GitHub Actions
test-conda-python-3.11-dask-upstream_devel GitHub Actions
test-conda-python-3.11-hypothesis GitHub Actions
test-conda-python-3.11-pandas-latest-numpy-1.26 GitHub Actions
test-conda-python-3.11-pandas-latest-numpy-latest GitHub Actions
test-conda-python-3.11-pandas-nightly-numpy-nightly GitHub Actions
test-conda-python-3.11-pandas-upstream_devel-numpy-nightly GitHub Actions
test-conda-python-3.11-spark-master GitHub Actions
test-conda-python-3.12 GitHub Actions
test-conda-python-3.12-cpython-debug GitHub Actions
test-conda-python-3.13 GitHub Actions
test-conda-python-3.9 GitHub Actions
test-conda-python-3.9-pandas-1.1.3-numpy-1.19.5 GitHub Actions
test-conda-python-emscripten GitHub Actions
test-cuda-python-ubuntu-22.04-cuda-11.7.1 GitHub Actions
test-debian-12-python-3-amd64 GitHub Actions
test-debian-12-python-3-i386 GitHub Actions
test-fedora-39-python-3 GitHub Actions
test-ubuntu-22.04-python-3 GitHub Actions
test-ubuntu-22.04-python-313-freethreading GitHub Actions
test-ubuntu-24.04-python-3 GitHub Actions

…This pin should not be required anymore"

This reverts commit 0158ad5.
@raulcd
Copy link
Member Author

raulcd commented Jan 13, 2025

I tried to remove the pytest-cython pin for the docs builds but it fails. I've added an issue to follow that up as this is not related to this issue:

@raulcd raulcd marked this pull request as ready for review January 13, 2025 13:30
@raulcd
Copy link
Member Author

raulcd commented Jan 13, 2025

@github-actions crossbow submit test-conda-python-3.11-hypothesis

Copy link

Revision: 2889c63

Submitted crossbow builds: ursacomputing/crossbow @ actions-6811b48c94

Task Status
test-conda-python-3.11-hypothesis GitHub Actions

Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

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

LGTM, but I think we can also remove this line:

arrow/python/CMakeLists.txt

Lines 203 to 205 in 04249b9

# See https://github.com/cython/cython/issues/2731. Change introduced in
# Cython 0.29.1 causes "unsafe use of type 'bool' in operation"
string(APPEND CMAKE_CXX_FLAGS " /wd4804")

@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Jan 13, 2025

There are also some other snippets in the cython code that we keep around only for cython 2 compat, I think, but that probably can be removed later as well

(for example our custom declaration of optional in lib.pxd, the SharedPtrNoGIL has a comment indicating it was also meant to work with both cython 2 and 3, and there are a bunch of Required for cython < 3 comments)

@raulcd
Copy link
Member Author

raulcd commented Jan 14, 2025

@github-actions crossbow submit -g python

@raulcd
Copy link
Member Author

raulcd commented Jan 14, 2025

@jorisvandenbossche I've removed the unnecessary binding decorator but I've opened:

To tackle the std::optional and the SharedPtrNoGIL as this might take me longer and can be done afterwards.
Let me know if that's ok with you.

Copy link

Revision: 87bd74f

Submitted crossbow builds: ursacomputing/crossbow @ actions-20576e4f2d

Task Status
example-python-minimal-build-fedora-conda GitHub Actions
example-python-minimal-build-ubuntu-venv GitHub Actions
test-conda-python-3.10 GitHub Actions
test-conda-python-3.10-hdfs-2.9.2 GitHub Actions
test-conda-python-3.10-hdfs-3.2.1 GitHub Actions
test-conda-python-3.10-pandas-latest-numpy-latest GitHub Actions
test-conda-python-3.10-substrait GitHub Actions
test-conda-python-3.11 GitHub Actions
test-conda-python-3.11-dask-latest GitHub Actions
test-conda-python-3.11-dask-upstream_devel GitHub Actions
test-conda-python-3.11-hypothesis GitHub Actions
test-conda-python-3.11-pandas-latest-numpy-1.26 GitHub Actions
test-conda-python-3.11-pandas-latest-numpy-latest GitHub Actions
test-conda-python-3.11-pandas-nightly-numpy-nightly GitHub Actions
test-conda-python-3.11-pandas-upstream_devel-numpy-nightly GitHub Actions
test-conda-python-3.11-spark-master GitHub Actions
test-conda-python-3.12 GitHub Actions
test-conda-python-3.12-cpython-debug GitHub Actions
test-conda-python-3.13 GitHub Actions
test-conda-python-3.9 GitHub Actions
test-conda-python-3.9-pandas-1.1.3-numpy-1.19.5 GitHub Actions
test-conda-python-emscripten GitHub Actions
test-cuda-python-ubuntu-22.04-cuda-11.7.1 GitHub Actions
test-debian-12-python-3-amd64 GitHub Actions
test-debian-12-python-3-i386 GitHub Actions
test-fedora-39-python-3 GitHub Actions
test-ubuntu-22.04-python-3 GitHub Actions
test-ubuntu-22.04-python-313-freethreading GitHub Actions
test-ubuntu-24.04-python-3 GitHub Actions

@raulcd
Copy link
Member Author

raulcd commented Jan 14, 2025

@github-actions crossbow submit wheel-windows-cp310-cp310-amd64

Copy link

Revision: 87bd74f

Submitted crossbow builds: ursacomputing/crossbow @ actions-3c1d7348b5

Task Status
wheel-windows-cp310-cp310-amd64 GitHub Actions

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting committer review Awaiting committer review labels Jan 16, 2025
@raulcd raulcd merged commit 8d367d2 into apache:main Jan 17, 2025
37 checks passed
@raulcd raulcd removed the awaiting merge Awaiting merge label Jan 17, 2025
@raulcd raulcd deleted the GH-45237 branch January 17, 2025 11:10
Copy link

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 8d367d2.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 1 possible false positive for unstable benchmarks that are known to sometimes produce them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants