From d5b873a65294e81863a27cb4df13b11c1deeaae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Cumplido?= Date: Tue, 3 Sep 2024 00:37:03 +0200 Subject: [PATCH] GH-40216: [CI][Packaging][Python] Upload pyarrow nightly wheels to scientific python channel on Anaconda (#43862) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Rationale for this change As discussed on the main issue is interesting for discoverability to have the wheels uploaded to the nightly channel. ### What changes are included in this PR? Added macro to upload wheel to scientific python channel ### Are these changes tested? Via archery ### Are there any user-facing changes? No but nightly wheels will be available on scientific python channel * GitHub Issue: #40216 Authored-by: Raúl Cumplido Signed-off-by: Jacob Wujciak-Jens --- dev/tasks/macros.jinja | 12 ++++++++++++ dev/tasks/python-sdist/github.yml | 1 + dev/tasks/python-wheels/github.linux.yml | 1 + dev/tasks/python-wheels/github.osx.yml | 1 + dev/tasks/python-wheels/github.windows.yml | 1 + dev/tasks/tasks.yml | 1 + 6 files changed, 17 insertions(+) diff --git a/dev/tasks/macros.jinja b/dev/tasks/macros.jinja index df55f32222e91..63cb2fc6dd101 100644 --- a/dev/tasks/macros.jinja +++ b/dev/tasks/macros.jinja @@ -183,6 +183,18 @@ env: {% endif %} {% endmacro %} +{%- macro github_upload_wheel_scientific_python(pattern) -%} + {%- if arrow.is_default_branch() -%} + - name: Upload wheel to Anaconda scientific-python + shell: bash + run: | + python3 -m pip install git+https://github.com/Anaconda-Platform/anaconda-client.git@1.12.3 + anaconda -t ${CROSSBOW_SCIENTIFIC_PYTHON_UPLOAD_TOKEN} upload --force -u scientific-python-nightly-wheels --label dev {{ pattern }} + env: + CROSSBOW_SCIENTIFIC_PYTHON_UPLOAD_TOKEN: {{ '${{ secrets.CROSSBOW_SCIENTIFIC_PYTHON_UPLOAD_TOKEN }}' }} + {% endif %} +{% endmacro %} + {%- macro azure_checkout_arrow() -%} - script: | git clone --no-checkout --branch {{ arrow.branch }} {{ arrow.remote }} arrow diff --git a/dev/tasks/python-sdist/github.yml b/dev/tasks/python-sdist/github.yml index ef36e358aa926..ce41f437946a7 100644 --- a/dev/tasks/python-sdist/github.yml +++ b/dev/tasks/python-sdist/github.yml @@ -43,3 +43,4 @@ jobs: {{ macros.github_upload_releases("arrow/python/dist/*.tar.gz")|indent }} {{ macros.github_upload_gemfury("arrow/python/dist/*.tar.gz")|indent }} + {{ macros.github_upload_wheel_scientific_python("arrow/python/dist/*.tar.gz")|indent }} diff --git a/dev/tasks/python-wheels/github.linux.yml b/dev/tasks/python-wheels/github.linux.yml index 97746ba3f9b8b..f9df27ba3175b 100644 --- a/dev/tasks/python-wheels/github.linux.yml +++ b/dev/tasks/python-wheels/github.linux.yml @@ -110,6 +110,7 @@ jobs: {{ macros.github_upload_releases("arrow/python/repaired_wheels/*.whl")|indent }} {{ macros.github_upload_gemfury("arrow/python/repaired_wheels/*.whl")|indent }} + {{ macros.github_upload_wheel_scientific_python("arrow/python/repaired_wheels/*.whl")|indent }} {% if arrow.is_default_branch() %} - name: Push Docker Image diff --git a/dev/tasks/python-wheels/github.osx.yml b/dev/tasks/python-wheels/github.osx.yml index a65bf9b56addf..98e06a14ff222 100644 --- a/dev/tasks/python-wheels/github.osx.yml +++ b/dev/tasks/python-wheels/github.osx.yml @@ -140,3 +140,4 @@ jobs: {{ macros.github_upload_releases("arrow/python/repaired_wheels/*.whl")|indent }} {{ macros.github_upload_gemfury("arrow/python/repaired_wheels/*.whl")|indent }} + {{ macros.github_upload_wheel_scientific_python("arrow/python/repaired_wheels/*.whl")|indent }} diff --git a/dev/tasks/python-wheels/github.windows.yml b/dev/tasks/python-wheels/github.windows.yml index a40b9c0d65103..3a943b6ae515c 100644 --- a/dev/tasks/python-wheels/github.windows.yml +++ b/dev/tasks/python-wheels/github.windows.yml @@ -71,6 +71,7 @@ jobs: {{ macros.github_upload_releases("arrow/python/dist/*.whl")|indent }} {{ macros.github_upload_gemfury("arrow/python/dist/*.whl")|indent }} + {{ macros.github_upload_wheel_scientific_python("arrow/python/dist/*.whl")|indent }} {% if arrow.is_default_branch() %} - name: Push Docker Image diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml index c6d2f2175d44c..b7e0c1601e336 100644 --- a/dev/tasks/tasks.yml +++ b/dev/tasks/tasks.yml @@ -29,6 +29,7 @@ groups: wheel: - wheel-* + - python-sdist linux: - almalinux-*