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-36744: [Python][Packaging] Add upper pin for cython<3 to pyarrow build dependencies #36743

Merged
merged 4 commits into from
Jul 18, 2023

Conversation

jorisvandenbossche
Copy link
Member

@jorisvandenbossche jorisvandenbossche commented Jul 18, 2023

Rationale for this change

Although we already fixed some cython 3 build issues (#34726), some new have been introduced, which we are seeing now cython 3 is released (#36730)

Adding an upper pin (<3) for the release, so we have more time (the full 14.0 release cycle) to iron out issues.

@jorisvandenbossche jorisvandenbossche changed the title [Python][Packaging] Add upper pin for cython<3 to pyarrow build dependencies GH-36744: [Python][Packaging] Add upper pin for cython<3 to pyarrow build dependencies Jul 18, 2023
@apache apache deleted a comment from github-actions bot Jul 18, 2023
@github-actions
Copy link

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

@apache apache deleted a comment from github-actions bot Jul 18, 2023
@jorisvandenbossche
Copy link
Member Author

@github-actions crossbow submit example-python-minimal-build-fedora-conda example-python-minimal-build-ubuntu-venv

@github-actions

This comment was marked as outdated.

@pitrou
Copy link
Member

pitrou commented Jul 18, 2023

@github-actions crossbow submit -g python

@github-actions

This comment was marked as outdated.

Copy link
Member

@raulcd raulcd left a comment

Choose a reason for hiding this comment

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

aren't the changes on setup.py required?

diff --git a/python/setup.py b/python/setup.py
index f06cb5a..dc52967 100755
--- a/python/setup.py
+++ b/python/setup.py
@@ -40,8 +40,9 @@ import Cython
 # Check if we're running 64-bit Python
 is_64_bit = sys.maxsize > 2**32
 
-if Cython.__version__ < '0.29.31':
-    raise Exception('Please upgrade to Cython 0.29.31 or newer')
+if Cython.__version__ < '0.29.31' or Cython.__version__ >= '3.0':
+    raise Exception(
+        'Please update your Cython version. Supported Cython >= 0.29.31, < 3.0')
 
 setup_dir = os.path.abspath(os.path.dirname(__file__))
 
@@ -491,7 +492,7 @@ setup(
                                  'pyarrow/_generated_version.py'),
         'version_scheme': guess_next_dev_version
     },
-    setup_requires=['setuptools_scm', 'cython >= 0.29.31'] + setup_requires,
+    setup_requires=['setuptools_scm', 'cython >= 0.29.31,<3'] + setup_requires,

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels Jul 18, 2023
@raulcd
Copy link
Member

raulcd commented Jul 18, 2023

@github-actions crossbow submit -g wheel

@github-actions
Copy link

Revision: ce27211

Submitted crossbow builds: ursacomputing/crossbow @ actions-09d93813a0

Task Status
wheel-clean Github Actions
wheel-macos-big-sur-cp310-arm64 Github Actions
wheel-macos-big-sur-cp311-arm64 Github Actions
wheel-macos-big-sur-cp38-arm64 Github Actions
wheel-macos-big-sur-cp39-arm64 Github Actions
wheel-macos-mojave-cp310-amd64 Github Actions
wheel-macos-mojave-cp311-amd64 Github Actions
wheel-macos-mojave-cp38-amd64 Github Actions
wheel-macos-mojave-cp39-amd64 Github Actions
wheel-manylinux-2-28-cp310-amd64 Github Actions
wheel-manylinux-2-28-cp310-arm64 Github Actions
wheel-manylinux-2-28-cp311-amd64 Github Actions
wheel-manylinux-2-28-cp311-arm64 Github Actions
wheel-manylinux-2-28-cp38-amd64 Github Actions
wheel-manylinux-2-28-cp38-arm64 Github Actions
wheel-manylinux-2-28-cp39-amd64 Github Actions
wheel-manylinux-2-28-cp39-arm64 Github Actions
wheel-manylinux-2014-cp310-amd64 Github Actions
wheel-manylinux-2014-cp310-arm64 Github Actions
wheel-manylinux-2014-cp311-amd64 Github Actions
wheel-manylinux-2014-cp311-arm64 Github Actions
wheel-manylinux-2014-cp38-amd64 Github Actions
wheel-manylinux-2014-cp38-arm64 Github Actions
wheel-manylinux-2014-cp39-amd64 Github Actions
wheel-manylinux-2014-cp39-arm64 Github Actions
wheel-windows-cp310-amd64 Github Actions
wheel-windows-cp311-amd64 Github Actions
wheel-windows-cp38-amd64 Github Actions
wheel-windows-cp39-amd64 Github Actions

@raulcd
Copy link
Member

raulcd commented Jul 18, 2023

The failure on example-python-minimal-build-fedora-conda seems related to:
https://github.com/apache/arrow/blob/main/ci/conda_env_python.txt#L21
We should pin Cython there too

@jorisvandenbossche
Copy link
Member Author

@github-actions crossbow submit example-python-minimal-build-fedora-conda example-python-minimal-build-ubuntu-venv

@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Jul 18, 2023
@github-actions
Copy link

Revision: c8860dd

Submitted crossbow builds: ursacomputing/crossbow @ actions-7fd78f41a9

Task Status
example-python-minimal-build-fedora-conda Github Actions
example-python-minimal-build-ubuntu-venv Github Actions

@jorisvandenbossche
Copy link
Member Author

aren't the changes on setup.py required?

No idea what this setup_requires is actually still doing (now there is pyproject.toml), we should probably check to remove that.

It's not really "required", but indeed nicer to update the error message (it would also have been clearer on the conda build). On the other hand, I am not sure it is necessary to fully disallow building with cython 3, for example for local development. But assuming we remove the pin soon again on the main branch, I added it for now.

[about conda env] We should pin Cython there too

We actually shouldn't, if we would update our install commands in CI to use pip instead of calling setup.py directly. But that's for another issue ;)

@raulcd
Copy link
Member

raulcd commented Jul 18, 2023

to fix the Source Release and Merge Script failures:

diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml
index 7c2437f..bfcefcb 100644
--- a/.github/workflows/dev.yml
+++ b/.github/workflows/dev.yml
@@ -103,7 +103,7 @@ jobs:
         shell: bash
         run: |
           gem install test-unit
-          pip install cython setuptools six pytest jira
+          pip install cython<3 setuptools six pytest jira
       - name: Run Release Test

@jorisvandenbossche
Copy link
Member Author

Thanks! Pushed (and that's another place where we should try to avoid installing cython manually, I think)

@pitrou
Copy link
Member

pitrou commented Jul 18, 2023

@github-actions crossbow submit -g python

@pitrou
Copy link
Member

pitrou commented Jul 18, 2023

@jorisvandenbossche @raulcd Can we merge this once CI passes?

@github-actions
Copy link

Revision: faa87fe

Submitted crossbow builds: ursacomputing/crossbow @ actions-89b7c43a1b

Task Status
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 Github Actions
test-conda-python-3.10-pandas-nightly Github Actions
test-conda-python-3.10-spark-master 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-upstream_devel Github Actions
test-conda-python-3.8 Github Actions
test-conda-python-3.8-pandas-1.0 Github Actions
test-conda-python-3.8-spark-v3.1.2 Github Actions
test-conda-python-3.9 Github Actions
test-conda-python-3.9-pandas-latest Github Actions
test-conda-python-3.9-spark-v3.2.0 Github Actions
test-cuda-python Github Actions
test-debian-11-python-3 Azure
test-fedora-35-python-3 Azure
test-ubuntu-20.04-python-3 Azure
test-ubuntu-22.04-python-3 Github Actions

Copy link
Member

@raulcd raulcd left a comment

Choose a reason for hiding this comment

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

I'll cherry pick for 13.0.0 once merged

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting change review Awaiting change review labels Jul 18, 2023
@pitrou pitrou merged commit de8df23 into apache:main Jul 18, 2023
@pitrou pitrou removed the awaiting merge Awaiting merge label Jul 18, 2023
raulcd pushed a commit that referenced this pull request Jul 18, 2023
…uild dependencies (#36743)

### Rationale for this change

Although we already fixed some cython 3 build issues (#34726), some new have been introduced, which we are seeing now cython 3 is released (#36730)

Adding an upper pin (<3) for the release, so we have more time (the full 14.0 release cycle) to iron out issues.
* Closes: #36744

Authored-by: Joris Van den Bossche <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
chelseajonesr pushed a commit to chelseajonesr/arrow that referenced this pull request Jul 20, 2023
…rrow build dependencies (apache#36743)

### Rationale for this change

Although we already fixed some cython 3 build issues (apache#34726), some new have been introduced, which we are seeing now cython 3 is released (apache#36730)

Adding an upper pin (<3) for the release, so we have more time (the full 14.0 release cycle) to iron out issues.
* Closes: apache#36744

Authored-by: Joris Van den Bossche <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
@conbench-apache-arrow
Copy link

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

There were 3 benchmark results indicating a performance regression:

The full Conbench report has more details.

@jorisvandenbossche jorisvandenbossche deleted the pin-cython-3 branch August 15, 2023 10:19
R-JunmingChen pushed a commit to R-JunmingChen/arrow that referenced this pull request Aug 20, 2023
…rrow build dependencies (apache#36743)

### Rationale for this change

Although we already fixed some cython 3 build issues (apache#34726), some new have been introduced, which we are seeing now cython 3 is released (apache#36730)

Adding an upper pin (<3) for the release, so we have more time (the full 14.0 release cycle) to iron out issues.
* Closes: apache#36744

Authored-by: Joris Van den Bossche <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
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.

[Python][Packaging] Add upper pin for cython<3 to pyarrow build dependencies
3 participants