Skip to content

CI Install pandas when testing the free threaded wheels #29572

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
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 .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ jobs:
CIBW_CONFIG_SETTINGS_WINDOWS: "setup-args=--vsenv"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: bash build_tools/github/repair_windows_wheels.sh {wheel} {dest_dir}
CIBW_BEFORE_TEST_WINDOWS: bash build_tools/github/build_minimal_windows_image.sh ${{ matrix.python }}
CIBW_TEST_REQUIRES: pytest
CIBW_BEFORE_TEST: bash {project}/build_tools/wheels/cibw_before_test.sh
CIBW_TEST_REQUIRES: pytest pandas
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure why we need this, since the dev version of pandas is already installed in cibw_before_test.sh.

I checked the logs and this do not cause pip to override the dev wheel with the stable release wheel:

...
      + pip install pytest pandas
  Collecting pytest
    Downloading pytest-8.3.2-py3-none-any.whl.metadata (7.5 kB)
  Requirement already satisfied: pandas in /tmp/tmp.ZWPQ7oIjQL/venv/lib/python3.13/site-packages (3.0.0.dev0+1252.gd6c9941b73)
...

Copy link
Member Author

@lesteve lesteve Jul 29, 2024

Choose a reason for hiding this comment

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

CIBW_TEST_REQUIRES is used by all the other builds though (i.e. not free-threaded ones). In other words build_tools/wheels/cibw_before_test.sh only does something (install dev pandas) for the free-threaded build for the non free-threaded builds this is a noop.

I guess doing it this way makes it easier to update when eventually when numpy, scipy and pandas have a release with a free-threaded wheel: remove CIBW_BEFORE_TEST and build_tools/wheels/cibw_before_test.sh.

CIBW_TEST_COMMAND: bash {project}/build_tools/wheels/test_wheels.sh
CIBW_TEST_COMMAND_WINDOWS: bash {project}/build_tools/github/test_windows_wheels.sh ${{ matrix.python }}
CIBW_BUILD_VERBOSITY: 1
Expand Down
9 changes: 2 additions & 7 deletions build_tools/wheels/cibw_before_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ set -x

FREE_THREADED_BUILD="$(python -c"import sysconfig; print(bool(sysconfig.get_config_var('Py_GIL_DISABLED')))")"
if [[ $FREE_THREADED_BUILD == "True" ]]; then
# TODO: remove when numpy and scipy have releases with free-threaded wheels
python -m pip install --pre --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy scipy
else
# There is no pandas free-threaded wheel at the time of writing, so we only
# install pandas in other builds
# TODO: adapt when there is a pandas free-threaded wheel
python -m pip install pandas
# TODO: remove when numpy, scipy and pandas have releases with free-threaded wheels
python -m pip install --pre --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy scipy pandas
fi