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

Upload 3.13 & free-threaded nightly wheels #59136

Merged
merged 21 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4371054
Upload free-threaded nightly wheels on Linux and macOS
lysnikolaou Jun 28, 2024
2cb8bbc
Consolidate jobs into one
lysnikolaou Jul 2, 2024
5f54ed7
Install build dependencies in before-build and pass --no-build-isolation
lysnikolaou Jul 10, 2024
8bee350
Fix {project} placeholder in cibuildwheel config
lysnikolaou Jul 10, 2024
0a842b2
Correctly quote echo CIBW_BUILD_FRONTEND command
lysnikolaou Jul 10, 2024
c2bbdcb
Run echo -e
lysnikolaou Jul 10, 2024
7e87966
Add {package} to before-build
lysnikolaou Jul 10, 2024
c36d905
Include cibw script in sdist & add matrix value for build frontend
lysnikolaou Jul 11, 2024
f11120d
Change manifest and gitattributes
lysnikolaou Jul 11, 2024
0b70025
Change gitattributes
lysnikolaou Jul 11, 2024
812527e
Install verioneer in before-build
lysnikolaou Jul 11, 2024
e46055a
Add cibw_before_test to install nightly NumPy
lysnikolaou Jul 11, 2024
c487998
Expand before-test to musl
lysnikolaou Jul 11, 2024
2258d64
Better comments plus always run before-build/before-test on 3.13
lysnikolaou Jul 11, 2024
0c4753a
Add --no-build-isolation in 3.13 as well
lysnikolaou Jul 11, 2024
15d0c8d
Install nightly numpy before windows tests
lysnikolaou Jul 11, 2024
0cf5c89
Merge branch 'main' into free-threaded-wheels
lysnikolaou Jul 16, 2024
edcbf3c
Merge branch 'main' into free-threaded-wheels
lysnikolaou Jul 19, 2024
2397f4c
Address feedback; add todo for NumPy nightly and move default outside…
lysnikolaou Jul 19, 2024
06b6ca1
Merge branch 'main' into free-threaded-wheels
mroeschke Jul 22, 2024
778a60a
Set build_frontend to 'build' in pyodide build
lysnikolaou Jul 22, 2024
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
6 changes: 5 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,7 @@ 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
scripts/cibw_before_test.sh -export-ignore
28 changes: 21 additions & 7 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,25 @@ jobs:
- [macos-14, macosx_arm64]
- [windows-2022, win_amd64]
# TODO: support PyPy?
python: [["cp310", "3.10"], ["cp311", "3.11"], ["cp312", "3.12"]]

python: [["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
# and test deps in cibw_before_test.sh after pandas can be built with a released NumPy/Cython
- python: ["cp313", "3.13"]
cibw_build_frontend: 'pip; args: --no-build-isolation'
- python: ["cp313t", "3.13"]
cibw_build_frontend: 'pip; args: --no-build-isolation'
# Build Pyodide wheels and upload them to Anaconda.org
# NOTE: this job is similar to the one in unit-tests.yml except for the fact
# that it uses cibuildwheel instead of a standard Pyodide xbuildenv setup.
include:
- buildplat: [ubuntu-22.04, pyodide_wasm32]
python: ["cp312", "3.12"]
- buildplat: [ubuntu-22.04, pyodide_wasm32]
python: ["cp312", "3.12"]
cibw_build_frontend: 'build'
# 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 @@ -153,6 +164,7 @@ jobs:
env:
CIBW_PRERELEASE_PYTHONS: True
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
CIBW_BUILD_FRONTEND: ${{ matrix.cibw_build_frontend || 'pip' }}
Copy link
Member

Choose a reason for hiding this comment

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

Looks like the wasm build needs to specify cibw_build_frontendas something based on the failing build

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, according to the docs pyodide should ignore this setting, since only "build" is supported.

CIBW_PLATFORM: ${{ matrix.buildplat[1] == 'pyodide_wasm32' && 'pyodide' || 'auto' }}

- name: Set up Python
Expand All @@ -176,15 +188,17 @@ jobs:
- name: Test Windows Wheels
if: ${{ matrix.buildplat[1] == 'win_amd64' }}
shell: pwsh
# TODO: Remove NumPy nightly install when there's a 3.13 wheel on PyPI
run: |
$TST_CMD = @"
python -m pip install hypothesis>=6.84.0 pytest>=7.3.2 pytest-xdist>=3.4.0;
${{ matrix.python[1] == '3.13' && 'python -m pip install -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy;' }}
lysnikolaou marked this conversation as resolved.
Show resolved Hide resolved
python -m pip install `$(Get-Item pandas\wheelhouse\*.whl);
python -c `'import pandas as pd; pd.test(extra_args=[`\"--no-strict-data-files`\", `\"-m not clipboard and not single_cpu and not slow and not network and not db`\"])`';
"@
# add rc to the end of the image name if the Python version is unreleased
docker pull python:${{ matrix.python[1] == '3.12' && '3.12-rc' || format('{0}-windowsservercore', matrix.python[1]) }}
docker run --env PANDAS_CI='1' -v ${PWD}:C:\pandas python:${{ matrix.python[1] == '3.12' && '3.12-rc' || format('{0}-windowsservercore', matrix.python[1]) }} powershell -Command $TST_CMD
docker pull python:${{ matrix.python[1] == '3.13' && '3.13-rc' || format('{0}-windowsservercore', matrix.python[1]) }}
docker run --env PANDAS_CI='1' -v ${PWD}:C:\pandas python:${{ matrix.python[1] == '3.13' && '3.13-rc' || format('{0}-windowsservercore', matrix.python[1]) }} powershell -Command $TST_CMD

- uses: actions/upload-artifact@v4
with:
Expand Down
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,7 @@ 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
include scripts/cibw_before_test.sh
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,17 @@ 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"
before-test = "bash {package}/scripts/cibw_before_test.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]]
select = "*-musllinux*"
before-test = "apk update && apk add musl-locales"
before-test = "apk update && apk add musl-locales && bash {package}/scripts/cibw_before_test.sh"

[[tool.cibuildwheel.overrides]]
select = "*-win*"
Expand Down
9 changes: 9 additions & 0 deletions scripts/cibw_before_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# TODO: Delete when there's PyPI NumPy/Cython releases the support Python 3.13.
# If free-threading support is not included in those releases, this script will have
# to whether this runs for a free-threaded build instead.
PYTHON_VERSION="$(python -c "import sys; print(f'{sys.version_info.major}{sys.version_info.minor}')")"
if [[ $PYTHON_VERSION == "313" ]]; 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
8 changes: 8 additions & 0 deletions scripts/cibw_before_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# TODO: Delete when there's PyPI NumPy/Cython releases the support Python 3.13.
# If free-threading support is not included in those releases, this script will have
# to whether this runs for a free-threaded build instead.
PYTHON_VERSION="$(python -c "import sys; print(f'{sys.version_info.major}{sys.version_info.minor}')")"
if [[ $PYTHON_VERSION == "313" ]]; then
python -m pip install -U pip
python -m pip install -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
fi
Loading