From b13750d819b0ffa646a20af9bea16d1c1b473165 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sun, 25 Feb 2024 23:47:04 +0300 Subject: [PATCH 01/10] CI(GHActions): Build and publish wheels on Linux/aarch64 --- .github/workflows/test-publish.yaml | 28 +++++++++++++++++++++++++++- docs/news.rst | 4 ++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-publish.yaml b/.github/workflows/test-publish.yaml index 25966af3..29210990 100644 --- a/.github/workflows/test-publish.yaml +++ b/.github/workflows/test-publish.yaml @@ -9,6 +9,7 @@ jobs: run-tests: env: not_in_conda: "[]" + not_in_aarch64: "['3.5', 'pypy3.7']" strategy: matrix: @@ -32,7 +33,6 @@ jobs: runs-on: ${{ matrix.os }} steps: - # Setup Python/pip - uses: actions/checkout@v4 - uses: s-weigand/setup-conda@v1 @@ -112,6 +112,32 @@ jobs: env: TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} + - name: Build and publish wheel on Linux/aarch64 + uses: uraimo/run-on-arch-action@v2 + with: + arch: aarch64 + distro: ubuntu22.04 + env: | + PY_VER: "${{ matrix.python-version }}" + RUNNER_OS: ${{ runner.os }} + install: | + set -ex + apt-get update -q -y + apt-get install -q -y curl gcc patchelf + run: | + set -ex + curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" + bash Miniforge3-$(uname)-$(uname -m).sh -b -u -p "$HOME"/miniforge3 + source "$HOME"/miniforge3/etc/profile.d/conda.sh + #conda update -n base -c conda-forge --yes conda + conda create -n $PY_VER --yes python=$PY_VER + conda activate $PY_VER + python --version + python -m pip || python -m ensurepip --default-pip --upgrade + python -m pip install --upgrade pip setuptools wheel + pip --version + exec devscripts/CI/ghactions-release + if: ${{ !contains(fromJSON(env.not_in_aarch64), matrix.python-version) && runner.os == 'Linux' && startsWith(github.ref, 'refs/tags/') }} - name: Publish wheel to Releases uses: ncipollo/release-action@v1 with: diff --git a/docs/news.rst b/docs/news.rst index 4f2d7d7c..86aed39c 100644 --- a/docs/news.rst +++ b/docs/news.rst @@ -4,6 +4,10 @@ News Development (master) -------------------- +CI: + + - GHActions: Build and publish wheels on Linux/aarch64. + 3.3.3 (2023-10-22) ------------------ From 027721d40a0e55c071d04867f0d618d90bf3070b Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 27 Feb 2024 19:36:16 +0300 Subject: [PATCH 02/10] Release 3.3.4a0 --- .github/workflows/test-publish.yaml | 2 +- ANNOUNCE.rst | 4 +++- LATEST-CHANGES.rst | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-publish.yaml b/.github/workflows/test-publish.yaml index 29210990..1b7ede2d 100644 --- a/.github/workflows/test-publish.yaml +++ b/.github/workflows/test-publish.yaml @@ -147,7 +147,7 @@ jobs: omitBodyDuringUpdate: true omitNameDuringUpdate: true omitPrereleaseDuringUpdate: true - prerelease: false + prerelease: true replacesArtifacts: false skipIfReleaseExists: false updateOnlyUnreleased: false diff --git a/ANNOUNCE.rst b/ANNOUNCE.rst index 8b14eaec..47aab061 100644 --- a/ANNOUNCE.rst +++ b/ANNOUNCE.rst @@ -7,7 +7,9 @@ of release 3.3.4 of branch 3.3 of CheetahTemplate3. What's new in CheetahTemplate3 ============================== -The contributors for this release are ... +CI: + + - GHActions: Build and publish wheels on Linux/aarch64. What is CheetahTemplate3 diff --git a/LATEST-CHANGES.rst b/LATEST-CHANGES.rst index e69de29b..9b5bcb5c 100644 --- a/LATEST-CHANGES.rst +++ b/LATEST-CHANGES.rst @@ -0,0 +1 @@ +CI(GHActions): Build and publish wheels on Linux/aarch64. From 716bbb7005d4a3b3c0049469e5d936da59b65fd2 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 27 Feb 2024 20:07:04 +0300 Subject: [PATCH 03/10] CI(GHActions): Install Python 3.7 along with 2.7 Python 3.7 is needed for ghactions-release script. --- .github/workflows/test-publish.yaml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-publish.yaml b/.github/workflows/test-publish.yaml index 1b7ede2d..fff9d741 100644 --- a/.github/workflows/test-publish.yaml +++ b/.github/workflows/test-publish.yaml @@ -43,10 +43,12 @@ jobs: # Python 3.7 is needed for ghactions-release script - name: Install additional Python 3.7 run: | - conda create -n py37 python=3.7 + conda create -n py37 --yes python=3.7 py37_prefix="`echo $CONDA_PREFIX | sed 's/__setup_conda/py37/'`" ln -s "$py37_prefix/bin/python" "$CONDA_PREFIX/bin/python3.7" ln -s "$py37_prefix/bin/pip" "$CONDA_PREFIX/bin/pip3.7" + python3.7 --version + pip3.7 --version shell: bash if: ${{ matrix.python-version == '2.7' && runner.os != 'Windows' && startsWith(github.ref, 'refs/tags/') }} - uses: actions/setup-python@v4 @@ -130,12 +132,20 @@ jobs: bash Miniforge3-$(uname)-$(uname -m).sh -b -u -p "$HOME"/miniforge3 source "$HOME"/miniforge3/etc/profile.d/conda.sh #conda update -n base -c conda-forge --yes conda - conda create -n $PY_VER --yes python=$PY_VER - conda activate $PY_VER + pyv="`echo $PY_VER | sed 's/\.//'`" + conda create -n py$pyv --yes python=$PY_VER + conda activate py$pyv python --version python -m pip || python -m ensurepip --default-pip --upgrade python -m pip install --upgrade pip setuptools wheel pip --version + if [ $PY_VER = 2.7 ]; then + conda create -n py37 --yes python=3.7 + ln -s "$HOME"/miniforge3/envs/py37/bin/python "$HOME"/miniforge3/envs/py27/bin/python3.7 + ln -s "$HOME"/miniforge3/envs/py37/bin/pip "$HOME"/miniforge3/envs/py27/bin/pip3.7 + python3.7 --version + pip3.7 --version + fi exec devscripts/CI/ghactions-release if: ${{ !contains(fromJSON(env.not_in_aarch64), matrix.python-version) && runner.os == 'Linux' && startsWith(github.ref, 'refs/tags/') }} - name: Publish wheel to Releases From d3d6195762acbeb8f4a15084802881088987ab8f Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 27 Feb 2024 20:36:01 +0300 Subject: [PATCH 04/10] CI(GHActions): Improve release script a bit Get rid of bashisms; use `/bin/sh` instead of `bash`. Remove `&&`, rely on `set -e`. --- devscripts/CI/ghactions-release | 48 +++++++++++++++++---------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/devscripts/CI/ghactions-release b/devscripts/CI/ghactions-release index 990f6772..ecb7373e 100755 --- a/devscripts/CI/ghactions-release +++ b/devscripts/CI/ghactions-release @@ -1,50 +1,52 @@ -#! /usr/bin/env bash +#! /bin/sh set -e -[[ "$TOXENV" == pypy* ]] && exit 0 +case "$TOXENV" in + pypy*) exit 0 ;; +esac -umask 022 && -chmod -R a+rX . && +umask 022 +chmod -R a+rX . py=$(python -c "import sys; print('.'.join(sys.version.split('.')[:2]))") -v=$(echo "$py" | sed 's/\.//') && +v=$(echo "$py" | sed 's/\.//') -pip install -U pip setuptools readme-renderer twine wheel && -python setup.py sdist && +pip install -U pip setuptools readme-renderer twine wheel +python setup.py sdist -if [ -d build ]; then find build -name '*.py[co]' -delete; fi && -python setup.py build_ext && -python setup.py build --executable '/usr/bin/env python' && -python -m compileall build && -python -O -m compileall build && -python setup.py bdist_wheel && +if [ -d build ]; then find build -name '*.py[co]' -delete; fi +python setup.py build_ext +python setup.py build --executable '/usr/bin/env python' +python -m compileall build +python -O -m compileall build +python setup.py bdist_wheel -if [ "$RUNNER_OS" == 'Linux' ]; then +if [ "$RUNNER_OS" = 'Linux' ]; then # auditwheel 5.2+ require patchelf 0.14+ - if [ "$py" == 2.7 ]; then + if [ "$py" = 2.7 ]; then pip3.7 install -U "auditwheel<5.2" - elif [ "$py" == 3.4 ]; then + elif [ "$py" = 3.4 ]; then pip install -U typing "auditwheel==2.1.1" else pip install -U "auditwheel<5.2" - fi && + fi - for f in dist/CT3-*-cp$v-*-linux*.whl; do - if [ "$py" == 2.7 ]; then + for f in dist/CT3-*-cp"$v"-*-linux*.whl; do + if [ "$py" = 2.7 ]; then python3.7 -m auditwheel repair -w dist/ "$f" else python -m auditwheel repair -w dist/ "$f" - fi && + fi rm -f "$f" done -elif [ "$RUNNER_OS" == 'macOS' ]; then +elif [ "$RUNNER_OS" = 'macOS' ]; then pip install -U delocate - for f in dist/CT3-*-cp$v-*-macosx*.whl; do + for f in dist/CT3-*-cp"$v"-*-macosx*.whl; do delocate-wheel -v "$f" done -fi && +fi # TWINE_USERNAME / TWINE_PASSWORD / TWINE_REPOSITORY_URL # must be set in Github Actions settings. From aa7929d0559faaa4368d12473d6ad40f5deafd17 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 27 Feb 2024 22:23:04 +0300 Subject: [PATCH 05/10] CI(GHActions): Skip release script for PyPy --- .github/workflows/test-publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-publish.yaml b/.github/workflows/test-publish.yaml index fff9d741..8fbc1f56 100644 --- a/.github/workflows/test-publish.yaml +++ b/.github/workflows/test-publish.yaml @@ -104,7 +104,7 @@ jobs: env: TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} - if: ${{ runner.os != 'Windows' && startsWith(github.ref, 'refs/tags/') }} + if: ${{ !startsWith(matrix.python-version, 'pypy') && runner.os != 'Windows' && startsWith(github.ref, 'refs/tags/') }} - name: Build and publish wheel on w32 run: | pip install -U pip setuptools twine wheel From c0b25b289c9a7f7304726f81fd740db8f6e9d307 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 27 Feb 2024 22:26:27 +0300 Subject: [PATCH 06/10] Release 3.3.4a1 --- ANNOUNCE.rst | 4 ++-- Cheetah/Version.py | 4 ++-- README.rst | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ANNOUNCE.rst b/ANNOUNCE.rst index 47aab061..c83b97c6 100644 --- a/ANNOUNCE.rst +++ b/ANNOUNCE.rst @@ -1,6 +1,6 @@ Hello! -I'm pleased to announce version 3.3.4a0, the first alpha release +I'm pleased to announce version 3.3.4a1, the second alpha release of release 3.3.4 of branch 3.3 of CheetahTemplate3. @@ -28,7 +28,7 @@ Site: https://cheetahtemplate.org/ Download: -https://pypi.org/project/CT3/3.3.4a0 +https://pypi.org/project/CT3/3.3.4a1 News and changes: https://cheetahtemplate.org/news.html diff --git a/Cheetah/Version.py b/Cheetah/Version.py index bd943e82..c2ed734b 100755 --- a/Cheetah/Version.py +++ b/Cheetah/Version.py @@ -1,7 +1,7 @@ #!/usr/bin/env python -Version = '3.3.4a0' -VersionTuple = (3, 3, 4, 'alpha', 0) +Version = '3.3.4a1' +VersionTuple = (3, 3, 4, 'alpha', 1) MinCompatibleVersion = '3.0.0a1' MinCompatibleVersionTuple = (3, 0, 0, 'alpha', 1) diff --git a/README.rst b/README.rst index f423d528..af979b2c 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,4 @@ -Cheetah Template 3.3.4a0 +Cheetah Template 3.3.4a1 ======================== Cheetah3 is a free and open source (MIT) Python template engine. From 00efeec80c46e589c1ab89cf1917253bd12a3041 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 27 Feb 2024 22:32:43 +0300 Subject: [PATCH 07/10] CI(GHActions): Skip publishing releases for PyPy --- .github/workflows/test-publish.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-publish.yaml b/.github/workflows/test-publish.yaml index 8fbc1f56..7e6aaf3b 100644 --- a/.github/workflows/test-publish.yaml +++ b/.github/workflows/test-publish.yaml @@ -110,7 +110,7 @@ jobs: pip install -U pip setuptools twine wheel python setup.py bdist_wheel twine upload --disable-progress-bar --skip-existing dist\* - if: ${{ runner.os == 'Windows' && startsWith(github.ref, 'refs/tags/') }} + if: ${{ !startsWith(matrix.python-version, 'pypy') && runner.os == 'Windows' && startsWith(github.ref, 'refs/tags/') }} env: TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} @@ -161,4 +161,4 @@ jobs: replacesArtifacts: false skipIfReleaseExists: false updateOnlyUnreleased: false - if: ${{ startsWith(github.ref, 'refs/tags/') }} + if: ${{ !startsWith(matrix.python-version, 'pypy') && startsWith(github.ref, 'refs/tags/') }} From daff1ab300a14d1f717a126114e32686789bae0c Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 27 Feb 2024 22:34:35 +0300 Subject: [PATCH 08/10] Release 3.3.4a2 --- ANNOUNCE.rst | 4 ++-- Cheetah/Version.py | 4 ++-- README.rst | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ANNOUNCE.rst b/ANNOUNCE.rst index c83b97c6..e9c51ad4 100644 --- a/ANNOUNCE.rst +++ b/ANNOUNCE.rst @@ -1,6 +1,6 @@ Hello! -I'm pleased to announce version 3.3.4a1, the second alpha release +I'm pleased to announce version 3.3.4a2, an alpha release of release 3.3.4 of branch 3.3 of CheetahTemplate3. @@ -28,7 +28,7 @@ Site: https://cheetahtemplate.org/ Download: -https://pypi.org/project/CT3/3.3.4a1 +https://pypi.org/project/CT3/3.3.4a2 News and changes: https://cheetahtemplate.org/news.html diff --git a/Cheetah/Version.py b/Cheetah/Version.py index c2ed734b..03bc34ef 100755 --- a/Cheetah/Version.py +++ b/Cheetah/Version.py @@ -1,7 +1,7 @@ #!/usr/bin/env python -Version = '3.3.4a1' -VersionTuple = (3, 3, 4, 'alpha', 1) +Version = '3.3.4a2' +VersionTuple = (3, 3, 4, 'alpha', 2) MinCompatibleVersion = '3.0.0a1' MinCompatibleVersionTuple = (3, 0, 0, 'alpha', 1) diff --git a/README.rst b/README.rst index af979b2c..b60258a5 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,4 @@ -Cheetah Template 3.3.4a1 +Cheetah Template 3.3.4a2 ======================== Cheetah3 is a free and open source (MIT) Python template engine. From f4de68f09864a3dce7429d52dd39d46af7ec269d Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Wed, 28 Feb 2024 13:33:25 +0300 Subject: [PATCH 09/10] CI(GHActions): Pass PyPI credentials to aarch64 container --- .github/workflows/test-publish.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-publish.yaml b/.github/workflows/test-publish.yaml index 7e6aaf3b..c30103b6 100644 --- a/.github/workflows/test-publish.yaml +++ b/.github/workflows/test-publish.yaml @@ -122,6 +122,8 @@ jobs: env: | PY_VER: "${{ matrix.python-version }}" RUNNER_OS: ${{ runner.os }} + TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} + TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} install: | set -ex apt-get update -q -y From 1ed9cc0e3f21c6a1cb5c41f09fcc12d2b7b8ef67 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Wed, 28 Feb 2024 13:36:32 +0300 Subject: [PATCH 10/10] Release 3.3.4a3 --- ANNOUNCE.rst | 4 ++-- Cheetah/Version.py | 4 ++-- README.rst | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ANNOUNCE.rst b/ANNOUNCE.rst index e9c51ad4..8f0bd7e0 100644 --- a/ANNOUNCE.rst +++ b/ANNOUNCE.rst @@ -1,6 +1,6 @@ Hello! -I'm pleased to announce version 3.3.4a2, an alpha release +I'm pleased to announce version 3.3.4a3, an alpha release of release 3.3.4 of branch 3.3 of CheetahTemplate3. @@ -28,7 +28,7 @@ Site: https://cheetahtemplate.org/ Download: -https://pypi.org/project/CT3/3.3.4a2 +https://pypi.org/project/CT3/3.3.4a3 News and changes: https://cheetahtemplate.org/news.html diff --git a/Cheetah/Version.py b/Cheetah/Version.py index 03bc34ef..d39e08fa 100755 --- a/Cheetah/Version.py +++ b/Cheetah/Version.py @@ -1,7 +1,7 @@ #!/usr/bin/env python -Version = '3.3.4a2' -VersionTuple = (3, 3, 4, 'alpha', 2) +Version = '3.3.4a3' +VersionTuple = (3, 3, 4, 'alpha', 3) MinCompatibleVersion = '3.0.0a1' MinCompatibleVersionTuple = (3, 0, 0, 'alpha', 1) diff --git a/README.rst b/README.rst index b60258a5..20efcc97 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,4 @@ -Cheetah Template 3.3.4a2 +Cheetah Template 3.3.4a3 ======================== Cheetah3 is a free and open source (MIT) Python template engine.