From e3d3043c10f4cad08d092289777c03c3286c577e Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Thu, 4 Dec 2025 11:07:45 -0800 Subject: [PATCH 1/2] CI: Don't upload wheels to anaconda.org/multibuild-wheels-staging --- .github/workflows/wheels.yml | 3 --- ci/upload_wheels.sh | 8 +------ doc/source/development/maintaining.rst | 8 ------- scripts/download_wheels.sh | 30 -------------------------- 4 files changed, 1 insertion(+), 48 deletions(-) delete mode 100755 scripts/download_wheels.sh diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 429ad0c5c825a..39c5a9e1a992d 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -207,13 +207,10 @@ jobs: if: ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }} shell: bash -el {0} env: - PANDAS_STAGING_UPLOAD_TOKEN: ${{ secrets.PANDAS_STAGING_UPLOAD_TOKEN }} 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). - # Tags will upload to - # https://anaconda.org/multibuild-wheels-staging/pandas # The tokens were originally generated at anaconda.org run: | source ci/upload_wheels.sh diff --git a/ci/upload_wheels.sh b/ci/upload_wheels.sh index c7c7ca00ee466..92959e8716a80 100644 --- a/ci/upload_wheels.sh +++ b/ci/upload_wheels.sh @@ -2,14 +2,8 @@ # Modified from numpy's https://github.com/numpy/numpy/blob/main/tools/wheels/upload_wheels.sh set_upload_vars() { - echo "IS_PUSH is $IS_PUSH" echo "IS_SCHEDULE_DISPATCH is $IS_SCHEDULE_DISPATCH" - if [[ "$IS_PUSH" == "true" ]]; then - echo push and tag event - export ANACONDA_ORG="multibuild-wheels-staging" - export TOKEN="$PANDAS_STAGING_UPLOAD_TOKEN" - export ANACONDA_UPLOAD="true" - elif [[ "$IS_SCHEDULE_DISPATCH" == "true" ]]; then + if [[ "$IS_SCHEDULE_DISPATCH" == "true" ]]; then echo scheduled or dispatched event export ANACONDA_ORG="scientific-python-nightly-wheels" export TOKEN="$PANDAS_NIGHTLY_UPLOAD_TOKEN" diff --git a/doc/source/development/maintaining.rst b/doc/source/development/maintaining.rst index b9904e10800f0..890083e6bd4b2 100644 --- a/doc/source/development/maintaining.rst +++ b/doc/source/development/maintaining.rst @@ -433,14 +433,6 @@ which will be triggered when the tag is pushed. 3. Download the source distribution and wheels from the `wheel staging area `_. Be careful to make sure that no wheels are missing (e.g. due to failed builds). - Running scripts/download_wheels.sh with the version that you want to download wheels/the sdist for should do the trick. - This script will make a ``dist`` folder inside your clone of pandas and put the downloaded wheels and sdist there:: - - scripts/download_wheels.sh - - ATTENTION: this is currently not downloading *all* wheels, and you have to - manually download the remainings wheels and sdist! - 4. Create a `new GitHub release `_: - Tag: ```` diff --git a/scripts/download_wheels.sh b/scripts/download_wheels.sh deleted file mode 100755 index 3dcae0cadcdcf..0000000000000 --- a/scripts/download_wheels.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# -# Download all wheels for a pandas version. -# -# This script is mostly useful during the release process, when wheels -# generated by the MacPython repo need to be downloaded locally to then -# be uploaded to the PyPI. -# -# There is no API to access the wheel files, so the script downloads the -# website, extracts the file urls from the html, and then downloads it -# one by one to the dist/ directory where they would be generated. - -VERSION=$1 -BASE_DIR=$(dirname -- $0) -mkdir -p $BASE_DIR/../dist -DIST_DIR="$(realpath $BASE_DIR/../dist)" - -if [ -z "$VERSION" ]; then - printf "Usage:\n\t%s \n\nWhere is for example 1.5.3" "$0" - exit 1 -fi - -curl "https://anaconda.org/multibuild-wheels-staging/pandas/files?version=${VERSION}" | \ - grep "href=\"/multibuild-wheels-staging/pandas/${VERSION}" | \ - sed -r 's/.*.*/\1/g' | \ - awk '{print "https://anaconda.org" $0 }' | \ - xargs wget -P "$DIST_DIR" - -printf '\nWheels downloaded to %s\nYou can upload them to PyPI using:\n\n' "$DIST_DIR" -printf "\ttwine upload %s/pandas-%s*.{whl,tar.gz} --skip-existing" "$DIST_DIR" "$VERSION" From d7f3411c11683b8d5f251ed3e25b6088c3e02458 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Thu, 4 Dec 2025 13:08:33 -0800 Subject: [PATCH 2/2] CI: Use scientific-python/upload-nightly-action for nightly wheels --- .github/workflows/wheels.yml | 19 +++++-------------- ci/upload_wheels.sh | 36 ------------------------------------ 2 files changed, 5 insertions(+), 50 deletions(-) delete mode 100644 ci/upload_wheels.sh diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 39c5a9e1a992d..fca1a856ba35b 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -45,7 +45,6 @@ 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 }} @@ -118,7 +117,6 @@ 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 @@ -204,18 +202,11 @@ jobs: path: ./wheelhouse/*.whl - name: Upload wheels & sdist - 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 + if: ${{ success() && env.IS_SCHEDULE_DISPATCH == 'true' }} + uses: scientific-python/upload-nightly-action@0.6.2 + with: + artifacts_path: dist + anaconda_nightly_upload_token: ${{secrets.PANDAS_NIGHTLY_UPLOAD_TOKEN}} publish: if: > diff --git a/ci/upload_wheels.sh b/ci/upload_wheels.sh deleted file mode 100644 index 92959e8716a80..0000000000000 --- a/ci/upload_wheels.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/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 -}