Skip to content

Commit

Permalink
apacheGH-45076: [CI][Packaging][Python] Simplify dev/tasks/python-whe…
Browse files Browse the repository at this point in the history
…els/github.linux.yml (apache#45077)

### Rationale for this change

We can use GitHub Actions' standard features not Jinja2 features to generate test image names.

### What changes are included in this PR?

Use `GITHUB_ENV` instead of Jinja2.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.

* GitHub Issue: apache#45076

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Raúl Cumplido <[email protected]>
  • Loading branch information
kou authored Dec 20, 2024
1 parent 7bec4fa commit 02a1659
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions dev/tasks/python-wheels/github.linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,6 @@

{{ macros.github_header() }}

# Testing free-threaded wheels uses a different Docker setup
{% set test_imports_image = (
'python-free-threaded-wheel-manylinux-test-imports' if python_abi_tag == 'cp313t'
else 'python-wheel-manylinux-test-imports')
%}
{% set test_unittests_image = (
'python-free-threaded-wheel-manylinux-test-unittests' if python_abi_tag == 'cp313t'
else 'python-wheel-manylinux-test-unittests')
%}

permissions:
packages: write

Expand Down Expand Up @@ -60,6 +50,15 @@ jobs:
{{ macros.github_install_archery()|indent }}
{{ macros.github_login_dockerhub()|indent }}

- name: Prepare
run: |
if [ "${PYTHON_ABI_TAG}" = "cp313t" ]; then
test_image_prefix=python-free-threaded
else
test_image_prefix=python
fi
echo "TEST_IMAGE_PREFIX=${test_image_prefix}" >> ${GITHUB_ENV}
- name: Build wheel
shell: bash
env:
Expand All @@ -85,8 +84,8 @@ jobs:
shell: bash
run: |
source arrow/ci/scripts/util_enable_core_dumps.sh
archery docker run {{ test_imports_image }}
archery docker run {{ test_unittests_image }}
archery docker run ${TEST_IMAGE_PREFIX}-wheel-manylinux-test-imports
archery docker run ${TEST_IMAGE_PREFIX}-wheel-manylinux-test-unittests
- name: Test wheel on AlmaLinux 8
shell: bash
Expand Down Expand Up @@ -158,5 +157,5 @@ jobs:
shell: bash
run: |
archery docker push python-wheel-manylinux-{{ manylinux_version }}
archery docker push {{ test_unittests_image }}
archery docker push ${TEST_IMAGE_PREFIX}-wheel-manylinux-test-unittests
{% endif %}

0 comments on commit 02a1659

Please sign in to comment.