Skip to content

Commit 695399b

Browse files
CI: temporarily revert using scientific-python/upload-nightly-action for uploading nightly wheels (#63432)
1 parent d049ddf commit 695399b

File tree

3 files changed

+53
-8
lines changed

3 files changed

+53
-8
lines changed

.github/workflows/wheels.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0')))
4646
runs-on: ubuntu-24.04
4747
env:
48+
IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
4849
IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
4950
outputs:
5051
sdist_file: ${{ steps.save-path.outputs.sdist_name }}
@@ -117,6 +118,7 @@ jobs:
117118
python: ["cp313t", "3.13"]
118119

119120
env:
121+
IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
120122
IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
121123
steps:
122124
- name: Checkout pandas
@@ -164,7 +166,6 @@ jobs:
164166
uses: pypa/[email protected]
165167
with:
166168
package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
167-
output-dir: ./dist
168169
env:
169170
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
170171
CIBW_BUILD_FRONTEND: ${{ matrix.cibw_build_frontend || 'pip' }}
@@ -195,19 +196,26 @@ jobs:
195196

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

200201
- uses: actions/upload-artifact@v6
201202
with:
202203
name: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
203-
path: ./dist/*.whl
204+
path: ./wheelhouse/*.whl
204205

205206
- name: Upload wheels & sdist
206-
if: ${{ success() && env.IS_SCHEDULE_DISPATCH == 'true' }}
207-
uses: scientific-python/[email protected]
208-
with:
209-
artifacts_path: ./dist
210-
anaconda_nightly_upload_token: ${{secrets.PANDAS_NIGHTLY_UPLOAD_TOKEN}}
207+
if: ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
208+
shell: bash -el {0}
209+
env:
210+
PANDAS_NIGHTLY_UPLOAD_TOKEN: ${{ secrets.PANDAS_NIGHTLY_UPLOAD_TOKEN }}
211+
# trigger an upload to
212+
# https://anaconda.org/scientific-python-nightly-wheels/pandas
213+
# for cron jobs or "Run workflow" (restricted to main branch).
214+
# The tokens were originally generated at anaconda.org
215+
run: |
216+
source ci/upload_wheels.sh
217+
set_upload_vars
218+
upload_wheels
211219
212220
publish:
213221
if: >

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ pandas/py.typed
6767
.ropeproject
6868
# wheel files
6969
*.whl
70+
**/wheelhouse/*
7071
pip-wheel-metadata
7172
# coverage
7273
.coverage

ci/upload_wheels.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
# Modified from numpy's https://github.com/numpy/numpy/blob/main/tools/wheels/upload_wheels.sh
3+
4+
set_upload_vars() {
5+
echo "IS_SCHEDULE_DISPATCH is $IS_SCHEDULE_DISPATCH"
6+
if [[ "$IS_SCHEDULE_DISPATCH" == "true" ]]; then
7+
echo scheduled or dispatched event
8+
export ANACONDA_ORG="scientific-python-nightly-wheels"
9+
export TOKEN="$PANDAS_NIGHTLY_UPLOAD_TOKEN"
10+
export ANACONDA_UPLOAD="true"
11+
else
12+
echo non-dispatch event
13+
export ANACONDA_UPLOAD="false"
14+
fi
15+
}
16+
upload_wheels() {
17+
echo "${PWD}"
18+
if [[ ${ANACONDA_UPLOAD} == true ]]; then
19+
if [ -z "${TOKEN}" ]; then
20+
echo no token set, not uploading
21+
else
22+
# sdists are located under dist folder when built through setup.py
23+
if compgen -G "./dist/*.gz"; then
24+
echo "Found sdist"
25+
anaconda -q -t "${TOKEN}" upload --skip -u "${ANACONDA_ORG}" ./dist/*.gz
26+
echo "Uploaded sdist"
27+
fi
28+
if compgen -G "./wheelhouse/*.whl"; then
29+
echo "Found wheel"
30+
anaconda -q -t "${TOKEN}" upload --skip -u "${ANACONDA_ORG}" ./wheelhouse/*.whl
31+
echo "Uploaded wheel"
32+
fi
33+
echo "PyPI-style index: https://pypi.anaconda.org/$ANACONDA_ORG/simple"
34+
fi
35+
fi
36+
}

0 commit comments

Comments
 (0)