1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2025-01-03 10:06:01 +01:00

Build and test new wheels (Python 3.10+ and manylinux tag 2.28 instead of 2.24) (#165)

* Upgrade manylinux wheels builder for new container envs

* [wheel build] test new Docker images and Py 3.10+ wheels on Test PyPI

* [wheel build] test new Docker images and Py 3.10+ wheels on Test PyPI

* [wheel build] Fix CI

* [wheel build] One more test
This commit is contained in:
Evgeny Posenitskiy 2024-08-17 18:22:43 +02:00 committed by GitHub
parent fa11989b86
commit c860e4fdfe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 33 additions and 45 deletions

View File

@ -29,7 +29,8 @@ jobs:
run: | run: |
set -xe set -xe
COMMIT_MSG=$(git log --no-merges -1 --oneline) COMMIT_MSG=$(git log --no-merges -1 --oneline)
echo "::set-output name=message::$COMMIT_MSG" echo "message=$COMMIT_MSG" >> $GITHUB_OUTPUT
echo github.ref ${{ github.ref }}
trexio_ubuntu: trexio_ubuntu:
name: x86 Ubuntu 20.04 name: x86 Ubuntu 20.04

View File

@ -4,7 +4,7 @@ on:
# Run this workflow after the TREXIO CI completed # Run this workflow after the TREXIO CI completed
workflow_run: workflow_run:
workflows: [ "TREXIO CI" ] workflows: [ "TREXIO CI" ]
branches: [ master ] branches: [ test-new-wheels ]
types: types:
- completed - completed
@ -16,12 +16,12 @@ jobs:
get_commit_message: get_commit_message:
if: ${{ github.event.workflow_run.conclusion == 'success' }} if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: Get commit message name: Get commit message
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
outputs: outputs:
message: ${{ steps.commit_message.outputs.message }} message: ${{ steps.commit_message.outputs.message }}
steps: steps:
- name: Checkout the repo - name: Checkout the repo
uses: actions/checkout@v3 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
# Gets the correct commit message for pull request # Gets the correct commit message for pull request
with: with:
ref: ${{ github.event.pull_request.head.sha }} ref: ${{ github.event.pull_request.head.sha }}
@ -30,8 +30,8 @@ jobs:
run: | run: |
set -xe set -xe
COMMIT_MSG=$(git log --no-merges -1 --oneline) COMMIT_MSG=$(git log --no-merges -1 --oneline)
echo "::set-output name=message::$COMMIT_MSG" echo "message=$COMMIT_MSG" >> $GITHUB_OUTPUT
echo github.ref ${{ github.ref }}
build_linux_wheels: build_linux_wheels:
name: Build Linux wheels for different versions of CPython on manylinux_x86_64 name: Build Linux wheels for different versions of CPython on manylinux_x86_64
@ -39,19 +39,19 @@ jobs:
if: >- if: >-
contains(needs.get_commit_message.outputs.message, '[wheel build]') || contains(needs.get_commit_message.outputs.message, '[wheel build]') ||
(github.repository == 'TREX-CoE/trexio' && startsWith(github.ref, 'refs/tags/v')) (github.repository == 'TREX-CoE/trexio' && startsWith(github.ref, 'refs/tags/v'))
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
strategy: strategy:
matrix: matrix:
manylinux_tag: [2014_x86_64, 2_24_x86_64] manylinux_tag: [2014_x86_64, 2_28_x86_64]
steps: steps:
- name: Checkout the branch - name: Checkout the branch
uses: actions/checkout@v3 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v4 uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f
with: with:
python-version: '3.9' python-version: '3.10'
- name: Install build dependencies - name: Install build dependencies
run: python -m pip install -U setuptools run: python -m pip install -U setuptools
@ -65,7 +65,7 @@ jobs:
# Conventional download-artifact action does not work for artifact produced in a different workflow, # Conventional download-artifact action does not work for artifact produced in a different workflow,
# which is the case here (TREXIO CI produced the Python API distribution tarball) # which is the case here (TREXIO CI produced the Python API distribution tarball)
- name: Download the Python API distribution tarball - name: Download the Python API distribution tarball
uses: dawidd6/action-download-artifact@v2 uses: dawidd6/action-download-artifact@v3
with: with:
# Specify the name of the workflow file which uploaded the tarball # Specify the name of the workflow file which uploaded the tarball
workflow: actions.yml workflow: actions.yml
@ -89,7 +89,7 @@ jobs:
working-directory: python working-directory: python
- name: Upload produced wheels as artifacts - name: Upload produced wheels as artifacts
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a
with: with:
name: pytrexio-manylinux-${{ matrix.manylinux_tag }} name: pytrexio-manylinux-${{ matrix.manylinux_tag }}
path: ./python/wheelhouse/*.whl path: ./python/wheelhouse/*.whl
@ -98,27 +98,27 @@ jobs:
publish_wheels: publish_wheels:
name: Publish all wheels on PyPI name: Publish all wheels on PyPI
needs: [build_linux_wheels] needs: [build_linux_wheels]
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout the branch - name: Checkout the branch
uses: actions/checkout@v3 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v4 uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f
with: with:
python-version: '3.9' python-version: '3.10'
- name: Install build dependencies - name: Install build dependencies
run: python -m pip install -U setuptools twine run: python -m pip install -U setuptools twine
- name: Download the build artifacts (wheels) of this workflow - name: Download the build artifacts (wheels) of this workflow
uses: actions/download-artifact@v2 uses: actions/download-artifact@v4
with: with:
path: dist path: dist
- name: Download the Python API distribution tarball - name: Download the Python API distribution tarball
uses: dawidd6/action-download-artifact@v2 uses: dawidd6/action-download-artifact@v3
with: with:
workflow: actions.yml workflow: actions.yml
workflow_conclusion: success workflow_conclusion: success
@ -135,15 +135,15 @@ jobs:
ls -sh -w 1 ls -sh -w 1
working-directory: dist working-directory: dist
#- name: Publish distribution 📦 to Test PyPI - name: Publish distribution 📦 to Test PyPI
# uses: pypa/gh-action-pypi-publish@master
# with:
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository_url: https://test.pypi.org/legacy/
#verbose: true
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master uses: pypa/gh-action-pypi-publish@master
with: with:
password: ${{ secrets.PYPI_API_TOKEN }} password: ${{ secrets.TEST_PYPI_API_TOKEN }}
#if: startsWith(github.ref, 'refs/tags') repository_url: https://test.pypi.org/legacy/
#verbose: true
#- name: Publish distribution 📦 to PyPI
# uses: pypa/gh-action-pypi-publish@master
# with:
# password: ${{ secrets.PYPI_API_TOKEN }}
# #if: startsWith(github.ref, 'refs/tags')

View File

@ -46,22 +46,9 @@ function build_wheel_for_py()
PYVERSION=${1} PYVERSION=${1}
# derive manylinux glibc tag from the PLAT env variable provided to docker run # derive manylinux glibc tag from the PLAT env variable provided to docker run
# this is needed to avoid building wheel for 2010_x86_64 with CPython 3.10
# because NumPy does not have wheels for it
MANYLINUX_TAG=${PLAT:9:4} MANYLINUX_TAG=${PLAT:9:4}
if [[ ${PYVERSION} -eq 310 ]] && [[ ${MANYLINUX_TAG} -eq 2010 ]]; then
echo "Skip build of the wheel for CPython 3.10 on manylinux2010_x86_64"
return
fi
# python versions <= 3.7 required additional "m" in the platform tag, e.g. cp37-cp37m CPYTHON="cp${PYVERSION}-cp${PYVERSION}"
if [[ ${PYVERSION} -eq 36 ]] || [[ ${PYVERSION} -eq 37 ]]; then
PYM="m"
else
PYM=""
fi
CPYTHON="cp${PYVERSION}-cp${PYVERSION}${PYM}"
# create and activate a virtual environment based on CPython version ${PYVERSION} # create and activate a virtual environment based on CPython version ${PYVERSION}
/opt/python/${CPYTHON}/bin/python3 -m venv --clear trexio-manylinux-py${PYVERSION} /opt/python/${CPYTHON}/bin/python3 -m venv --clear trexio-manylinux-py${PYVERSION}
@ -103,7 +90,7 @@ function build_wheel_for_py()
# build wheels for all versions of CPython in this container # build wheels for all versions of CPython in this container
for CPYVERSION in 37 38 39 310 for CPYVERSION in 38 39 310 311 312 313
do do
build_wheel_for_py ${CPYVERSION} build_wheel_for_py ${CPYVERSION}
done done