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

Backport PR #59136 on branch 2.2.x (Upload 3.13 & free-threaded nightly wheels) #59835

Merged
merged 8 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
name: Build aarch64 wheels
no_output_timeout: 30m # Sometimes the tests won't generate any output, make sure the job doesn't get killed by that
command: |
pip3 install cibuildwheel==2.15.0
pip3 install cibuildwheel==2.20.0
cibuildwheel --prerelease-pythons --output-dir wheelhouse

environment:
Expand Down
5 changes: 4 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ ci export-ignore
doc export-ignore
gitpod export-ignore
MANIFEST.in export-ignore
scripts export-ignore
scripts/** export-ignore
typings export-ignore
web export-ignore
CITATION.cff export-ignore
Expand All @@ -82,3 +82,6 @@ setup.py export-ignore
# csv_dir_path fixture checks the existence of the directory
# exclude the whole directory to avoid running related tests in sdist
pandas/tests/io/parser/data export-ignore

# Include cibw script in sdist since it's needed for building wheels
scripts/cibw_before_build.sh -export-ignore
15 changes: 13 additions & 2 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,17 @@ jobs:
- [macos-14, macosx_arm64]
- [windows-2022, win_amd64]
# TODO: support PyPy?
python: [["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11"], ["cp312", "3.12"]]
python: [["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11"], ["cp312", "3.12"], ["cp313", "3.13"], ["cp313t", "3.13"]]
include:
# TODO: Remove this plus installing build deps in cibw_before_build.sh
# after pandas can be built with a released NumPy/Cython
- python: ["cp313t", "3.13"]
cibw_build_frontend: 'pip; args: --no-build-isolation'
# TODO: Build free-threaded wheels for Windows
exclude:
- buildplat: [windows-2022, win_amd64]
python: ["cp313t", "3.13"]

env:
IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
Expand Down Expand Up @@ -140,12 +150,13 @@ jobs:
run: echo "sdist_name=$(cd ./dist && ls -d */)" >> "$GITHUB_ENV"

- name: Build wheels
uses: pypa/cibuildwheel@v2.17.0
uses: pypa/cibuildwheel@v2.20.0
with:
package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
env:
CIBW_PRERELEASE_PYTHONS: True
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
CIBW_BUILD_FRONTEND: ${{ matrix.cibw_build_frontend || 'pip' }}

- name: Set up Python
uses: mamba-org/setup-micromamba@v1
Expand Down
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@ prune pandas/tests/io/parser/data
# Selectively re-add *.cxx files that were excluded above
graft pandas/_libs/src
graft pandas/_libs/include

# Include cibw script in sdist since it's needed for building wheels
include scripts/cibw_before_build.sh
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,11 @@ test-command = """
pd.test(extra_args=["-m not clipboard and not single_cpu and not slow and not network and not db", "-n 2", "--no-strict-data-files"]); \
pd.test(extra_args=["-m not clipboard and single_cpu and not slow and not network and not db", "--no-strict-data-files"]);' \
"""
free-threaded-support = true
before-build = "bash {package}/scripts/cibw_before_build.sh"

[tool.cibuildwheel.windows]
before-build = "pip install delvewheel"
before-build = "pip install delvewheel && bash {package}/scripts/cibw_before_build.sh"
repair-wheel-command = "delvewheel repair -w {dest_dir} {wheel}"

[[tool.cibuildwheel.overrides]]
Expand Down
7 changes: 7 additions & 0 deletions scripts/cibw_before_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# TODO: Delete when there's a PyPI Cython release that supports free-threaded Python 3.13.
FREE_THREADED_BUILD="$(python -c"import sysconfig; print(bool(sysconfig.get_config_var('Py_GIL_DISABLED')))")"
if [[ $FREE_THREADED_BUILD == "True" ]]; then
python -m pip install -U pip
python -m pip install -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy cython
python -m pip install ninja meson-python versioneer[toml]
fi
Loading