Skip to content
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
24 changes: 16 additions & 8 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0')))
runs-on: ubuntu-24.04
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' }}
outputs:
sdist_file: ${{ steps.save-path.outputs.sdist_name }}
Expand Down Expand Up @@ -117,6 +118,7 @@ jobs:
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' }}
steps:
- name: Checkout pandas
Expand Down Expand Up @@ -164,7 +166,6 @@ jobs:
uses: pypa/[email protected]
with:
package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
output-dir: ./dist
env:
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
CIBW_BUILD_FRONTEND: ${{ matrix.cibw_build_frontend || 'pip' }}
Expand Down Expand Up @@ -195,19 +196,26 @@ jobs:

- name: Validate wheel RECORD
shell: bash -el {0}
run: for whl in $(ls ./dist/*.whl); do wheel unpack $whl -d /tmp; done
run: for whl in $(ls wheelhouse); do wheel unpack wheelhouse/$whl -d /tmp; done

- uses: actions/upload-artifact@v6
with:
name: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
path: ./dist/*.whl
path: ./wheelhouse/*.whl

- name: Upload wheels & sdist
if: ${{ success() && env.IS_SCHEDULE_DISPATCH == 'true' }}
uses: scientific-python/[email protected]
with:
artifacts_path: ./dist
anaconda_nightly_upload_token: ${{secrets.PANDAS_NIGHTLY_UPLOAD_TOKEN}}
if: ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
shell: bash -el {0}
env:
PANDAS_NIGHTLY_UPLOAD_TOKEN: ${{ secrets.PANDAS_NIGHTLY_UPLOAD_TOKEN }}
# trigger an upload to
# https://anaconda.org/scientific-python-nightly-wheels/pandas
# for cron jobs or "Run workflow" (restricted to main branch).
# The tokens were originally generated at anaconda.org
run: |
source ci/upload_wheels.sh
set_upload_vars
upload_wheels

publish:
if: >
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ pandas/py.typed
.ropeproject
# wheel files
*.whl
**/wheelhouse/*
pip-wheel-metadata
# coverage
.coverage
Expand Down
36 changes: 36 additions & 0 deletions ci/upload_wheels.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
# Modified from numpy's https://github.com/numpy/numpy/blob/main/tools/wheels/upload_wheels.sh

set_upload_vars() {
echo "IS_SCHEDULE_DISPATCH is $IS_SCHEDULE_DISPATCH"
if [[ "$IS_SCHEDULE_DISPATCH" == "true" ]]; then
echo scheduled or dispatched event
export ANACONDA_ORG="scientific-python-nightly-wheels"
export TOKEN="$PANDAS_NIGHTLY_UPLOAD_TOKEN"
export ANACONDA_UPLOAD="true"
else
echo non-dispatch event
export ANACONDA_UPLOAD="false"
fi
}
upload_wheels() {
echo "${PWD}"
if [[ ${ANACONDA_UPLOAD} == true ]]; then
if [ -z "${TOKEN}" ]; then
echo no token set, not uploading
else
# sdists are located under dist folder when built through setup.py
if compgen -G "./dist/*.gz"; then
echo "Found sdist"
anaconda -q -t "${TOKEN}" upload --skip -u "${ANACONDA_ORG}" ./dist/*.gz
echo "Uploaded sdist"
fi
if compgen -G "./wheelhouse/*.whl"; then
echo "Found wheel"
anaconda -q -t "${TOKEN}" upload --skip -u "${ANACONDA_ORG}" ./wheelhouse/*.whl
echo "Uploaded wheel"
fi
echo "PyPI-style index: https://pypi.anaconda.org/$ANACONDA_ORG/simple"
fi
fi
}
Loading