From 0c47e167c987c5b78a3f0816e7db3548df8fbfcc Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 23 Sep 2024 08:43:18 +0200 Subject: [PATCH 01/24] Switch to PyO3/maturin-action --- .github/workflows/maturin_build_sdist.py | 16 -- .github/workflows/maturin_build_wheel.py | 63 ------ .github/workflows/tag.yml | 193 +++++++++--------- .github/workflows/twine_upload.py | 47 ----- .../workflows/upload_github_release_asset.py | 89 -------- 5 files changed, 96 insertions(+), 312 deletions(-) delete mode 100755 .github/workflows/maturin_build_sdist.py delete mode 100755 .github/workflows/maturin_build_wheel.py delete mode 100755 .github/workflows/twine_upload.py delete mode 100755 .github/workflows/upload_github_release_asset.py diff --git a/.github/workflows/maturin_build_sdist.py b/.github/workflows/maturin_build_sdist.py deleted file mode 100755 index 3f25d90..0000000 --- a/.github/workflows/maturin_build_sdist.py +++ /dev/null @@ -1,16 +0,0 @@ -#! /usr/bin/env python3 - -import os -from pathlib import Path -import subprocess - -ROOT = Path(__file__).parent.parent.parent - -subprocess.run(["maturin", "sdist"], check=True) - -sdists = [x for x in (ROOT / "target" / "wheels").iterdir()] -if len(sdists) != 1: - raise RuntimeError("expected one sdist, found " + repr(sdists)) - -with open(os.environ["GITHUB_OUTPUT"], "a") as output: - output.write(f"sdist_path={str(sdists[0])}\n") diff --git a/.github/workflows/maturin_build_wheel.py b/.github/workflows/maturin_build_wheel.py deleted file mode 100755 index ec47f42..0000000 --- a/.github/workflows/maturin_build_wheel.py +++ /dev/null @@ -1,63 +0,0 @@ -#! /usr/bin/env python3 - -import os -import platform -import sys -from pathlib import Path -import subprocess - -ROOT = Path(__file__).parent.parent.parent - -# For macOS and Windows, we run Maturin against the Python interpreter that's -# been installed and configured for this CI run, i.e. the one that's running -# this script. (There are generally several versions installed by default, but -# that's not guaranteed.) For Linux, in order to get "manylinux" compatibility -# right, we need to run Maturin in a special Docker container. We hardcode -# paths to specific interpreter versions, based on where things are installed -# in this container. Our GitHub config has no effect on the the container, so -# we could build all the wheels in one job, but we stick to one-wheel-per-job -# for consistency. -if platform.system() == "Linux": - version_path_components = { - (3, 7): "cp37-cp37m", - (3, 8): "cp38-cp38", - (3, 9): "cp39-cp39", - (3, 10): "cp310-cp310", - (3, 11): "cp311-cp311", - (3, 12): "cp312-cp312", - # This list needs to be kept in sync with: - # - push.yml (rust_impl and c_impl) - # - tag.yml - } - version_component = version_path_components[sys.version_info[:2]] - interpreter_path = "/opt/python/" + version_component + "/bin/python" - # See https://github.com/PyO3/maturin#manylinux-and-auditwheel - command = [ - "docker", - "run", - "--rm", - "--volume=" + os.getcwd() + ":/io", - "--env=BLAKE3_CI=1", # don't allow fallbacks for missing AVX-512 support - "ghcr.io/pyo3/maturin", - "build", - "--release", - "--interpreter", - interpreter_path, - ] - subprocess.run(command, check=True) -else: - command = [ - "maturin", - "build", - "--release", - "--interpreter", - sys.executable, - ] - subprocess.run(command, check=True) - -wheels = [x for x in (ROOT / "target" / "wheels").iterdir()] -if len(wheels) != 1: - raise RuntimeError("expected one wheel, found " + repr(wheels)) - -with open(os.environ["GITHUB_OUTPUT"], "a") as output: - output.write(f"wheel_path={str(wheels[0])}\n") diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 13f9cda..7650890 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -1,112 +1,111 @@ -name: packaging +name: dists on: + pull_request: push: - tags: - - "*" + branches: master + release: + types: [released, prereleased] + workflow_dispatch: # allows running workflow manually from the Actions tab jobs: wheel: - name: Python ${{ matrix.python-version }}, ${{ matrix.platform.name }} - runs-on: ${{ matrix.platform.os }} + name: ${{ matrix.os }}-${{ matrix.target }}-${{ matrix.interpreter }}-${{ matrix.manylinux }} strategy: + fail-fast: false matrix: - # This list needs to be kept in sync with: - # - push.yml (rust_impl and c_impl) - # - maturin_build_wheel.py - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - platform: [ - # This list should be kept in sync with push.yml. - { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu", name: "Linux x64" }, - { os: "macOS-13", python-architecture: "x64", rust-target: "x86_64-apple-darwin", name: "macOS x64" }, - { os: "macOS-11", python-architecture: "x64", rust-target: "aarch64-apple-darwin", name: "macOS ARM" }, - { os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc", name: "Windows x86" }, - { os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc", name: "Windows x64" }, - ] + os: [ubuntu-latest, macos-latest, windows-latest] + target: [x86_64, aarch64] + manylinux: [auto] + interpreter: [all] + include: + - os: ubuntu-latest + target: i686 + - os: ubuntu-latest + target: aarch64 + - os: ubuntu-latest + target: armv7 + - os: ubuntu-latest + target: ppc64le + - os: ubuntu-latest + target: s390x + - os: ubuntu-latest + manylinux: musllinux_1_1 + target: x86_64 + - os: ubuntu-latest + manylinux: musllinux_1_1 + target: aarch64 exclude: - # aarch64 macOS has no support for Python version lower than 3.8 - - python-version: 3.7 - platform: - os: "macOS-11" - rust-target: "aarch64-apple-darwin" - fail-fast: false - env: - CARGO_BUILD_TARGET: ${{ matrix.platform.rust-target }} + # FIXME aarch64 builds broken, see https://github.com/PyO3/maturin/issues/2110 + - os: windows-latest + target: aarch64 + + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - architecture: ${{ matrix.platform.python-architecture }} - - name: Set up Rust - uses: dtolnay/rust-toolchain@stable - with: - target: ${{ matrix.platform.rust-target }} - - name: install maturin - # Keep the Maturin version in sync with pyproject.toml. - run: pip install "maturin>=0.14,<0.15" - # On Linux we'll run Maturin in a Docker container. - if: matrix.platform.os != 'ubuntu-latest' - - name: build wheel - id: build_wheel - run: python -u .github/workflows/maturin_build_wheel.py - - name: install PyGithub - run: pip install PyGithub - - name: upload release asset - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_TAG: ${{ github.ref }} - run: python -u .github/workflows/upload_github_release_asset.py ${{ steps.build_wheel.outputs.wheel_path }} - - # The sdist could be built automatically by each of the wheel jobs above (if - # we didn't set the --no-sdist flag), but we give it its own job here to - # avoid having different platforms race to upload it. The platform shouldn't - # matter for generating the sdist, but in case it ever does, it would be - # better to be consistent. + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: 3.x + + - name: build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.target }} + manylinux: ${{ matrix.manylinux }} + args: --release --out dist --interpreter ${{ matrix.interpreter == 'all' && '3.8 3.9 3.10 3.11 3.12 3.13' || matrix.interpreter }} + rust-toolchain: stable + docker-options: -e CI + + - run: ${{ (matrix.os == 'windows' && 'dir') || 'ls -lh' }} dist/ + + - run: pip install twine && twine check --strict dist/* + + - uses: actions/upload-artifact@v4 + with: + name: dist-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.interpreter }}-${{ matrix.manylinux }} + path: dist + sdist: - name: sdist + name: build sdist runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: 3.8 - architecture: x64 - - name: install maturin - run: pip install maturin - - name: build sdist - id: build_sdist - run: python -u .github/workflows/maturin_build_sdist.py - - name: install PyGithub - run: pip install PyGithub - - name: upload release asset - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_TAG: ${{ github.ref }} - run: python -u .github/workflows/upload_github_release_asset.py ${{ steps.build_sdist.outputs.sdist_path }} - - pypi: - name: pypi - needs: - - wheel - - sdist + - uses: actions/checkout@v4 + + - uses: PyO3/maturin-action@v1 + with: + command: sdist + args: --out dist + rust-toolchain: stable + + - uses: actions/upload-artifact@v4 + with: + name: dist-sdist + path: dist + + publish: + if: github.event_name == 'release' + needs: [wheel, sdist] runs-on: ubuntu-latest + + permissions: + contents: write # softprops/action-gh-release + id-token: write # pypa/gh-action-pypi-publish + steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: 3.8 - architecture: x64 - - name: install PyGithub - run: pip install PyGithub - - name: install twine - run: pip install twine - - name: twine upload - env: - GITHUB_TAG: ${{ github.ref }} - TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} - TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} - run: python -u .github/workflows/twine_upload.py + - uses: actions/download-artifact@v4 + with: + path: dist/ + pattern: dist-* + merge-multiple: true + + - run: ls -ltra dist/ + + - name: Upload release assets + uses: softprops/action-gh-release@v2.0.8 + with: + files: dist/* + + # trusted publisher in https://pypi.org/manage/project/blake3/settings/publishing/ + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@v1.10.2 diff --git a/.github/workflows/twine_upload.py b/.github/workflows/twine_upload.py deleted file mode 100755 index 4c43d66..0000000 --- a/.github/workflows/twine_upload.py +++ /dev/null @@ -1,47 +0,0 @@ -#! /usr/bin/env python3 - -import github -import os -import shutil -import subprocess -import tempfile -import urllib - -g = github.Github() # read-only, no token needed -tag_name = os.environ["GITHUB_TAG"] -tag_prefix = "refs/tags/" -if tag_name.startswith(tag_prefix): - tag_name = tag_name[len(tag_prefix) :] -rerelease_suffix = "_rerelease" -if tag_name.endswith(rerelease_suffix): - tag_name = tag_name[: len(tag_name) - len(rerelease_suffix)] - print("This is a rerelease of {}.".format(tag_name)) - -repo = g.get_repo("oconnor663/blake3-py") - -releases = list(repo.get_releases()) -for release in releases: - if release.tag_name == tag_name: - break -else: - raise RuntimeError("no release for tag " + repr(tag_name)) - -asset_names = [asset.name for asset in release.get_assets()] -asset_files = [] - -tempdir = tempfile.mkdtemp() -for asset_name in asset_names: - urlbase = "https://github.com/oconnor663/blake3-py/releases/download/{}/{}" - url = urlbase.format(tag_name, asset_name) - filepath = os.path.join(tempdir, asset_name) - asset_files.append(filepath) - with urllib.request.urlopen(url) as request, open(filepath, "wb") as f: - print("Downloading " + asset_name) - shutil.copyfileobj(request, f) - -print("Uploading to PyPI with twine...") -# Credentials are in the environment, TWINE_USERNAME and TWINE_PASSWORD. -twine_cmd = ["twine", "upload", "--skip-existing", "--non-interactive"] + asset_files -subprocess.run(twine_cmd, check=True) - -print("Success!") diff --git a/.github/workflows/upload_github_release_asset.py b/.github/workflows/upload_github_release_asset.py deleted file mode 100755 index 2db3315..0000000 --- a/.github/workflows/upload_github_release_asset.py +++ /dev/null @@ -1,89 +0,0 @@ -#! /usr/bin/env python3 - -import github -import os -import sys -import time - -RETRIES = 10 - -g = github.Github(os.environ["GITHUB_TOKEN"]) -tag_name = os.environ["GITHUB_TAG"] -tag_prefix = "refs/tags/" -if tag_name.startswith(tag_prefix): - tag_name = tag_name[len(tag_prefix) :] -rerelease_suffix = "_rerelease" -is_rerelease_tag = False -if tag_name.endswith(rerelease_suffix): - tag_name = tag_name[: len(tag_name) - len(rerelease_suffix)] - print("This is a rerelease of {}.".format(tag_name)) - is_rerelease_tag = True -assert len(sys.argv) == 2 -asset_path = sys.argv[1] -asset_name = os.path.basename(asset_path) - -repo = g.get_repo(os.environ["GITHUB_REPOSITORY"]) - -tags = list(repo.get_tags()) - -for tag in tags: - if tag.name == tag_name: - break -else: - raise RuntimeError("no tag named " + repr(tag_name)) - -try: - print("Creating GitHub release for tag " + repr(tag_name) + "...") - repo.create_git_release(tag_name, tag_name, tag.commit.commit.message) -except github.GithubException as github_error: - if github_error.data["errors"][0]["code"] == "already_exists": - print("Release for tag " + repr(tag_name) + " already exists.") - else: - raise - - -def get_release(): - for i in range(RETRIES): - releases = list(repo.get_releases()) - for release in releases: - if release.tag_name == tag_name: - return release - print(f"Release for tag {repr(tag_name)} not found. Retrying...") - time.sleep(1) - raise RuntimeError("no release for tag " + repr(tag_name)) - - -release = get_release() - - -asset_already_released = False -if is_rerelease_tag: - for asset in release.get_assets(): - if asset.name == asset_name: - print("Found uploaded asset during rerelease. Skipping upload.") - asset_already_released = True - break - -if not asset_already_released: - print("Uploading " + repr(asset_path) + "...") - for i in range(RETRIES): - try: - print("Upload attempt #{} of {}...".format(i + 1, RETRIES)) - release.upload_asset(asset_path) - break - except github.GithubException as github_error: - # Unfortunately the asset upload API is flaky. Even worse, it often - # partially succeeds, returning an error to the caller but leaving the - # release in a state where subsequent uploads of the same asset will - # fail with an "already_exists" error. (Though the asset is not visible - # on github.com, so we can't just declare victory and move on.) If we - # detect this case, explicitly delete the asset and continue retrying. - print(github_error) - for asset in release.get_assets(): - if asset.name == asset_name: - print("Found uploaded asset after failure. Deleting...") - asset.delete_asset() - else: - raise RuntimeError("All upload attempts failed.") - -print("Success!") From 315be68c5ae319a507455e385ce5a6f75daea0b2 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 23 Sep 2024 08:43:39 +0200 Subject: [PATCH 02/24] Rename tag.yml -> dists.yml --- .github/workflows/{tag.yml => dists.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{tag.yml => dists.yml} (100%) diff --git a/.github/workflows/tag.yml b/.github/workflows/dists.yml similarity index 100% rename from .github/workflows/tag.yml rename to .github/workflows/dists.yml From d6dc553dbe1a54dcb1d00a90e9507104c9b894bd Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 23 Sep 2024 08:45:04 +0200 Subject: [PATCH 03/24] Cancel previous runs --- .github/workflows/dists.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/dists.yml b/.github/workflows/dists.yml index 7650890..3b99a36 100644 --- a/.github/workflows/dists.yml +++ b/.github/workflows/dists.yml @@ -8,6 +8,10 @@ on: types: [released, prereleased] workflow_dispatch: # allows running workflow manually from the Actions tab +concurrency: # https://stackoverflow.com/questions/66335225#comment133398800_72408109 + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: wheel: name: ${{ matrix.os }}-${{ matrix.target }}-${{ matrix.interpreter }}-${{ matrix.manylinux }} From 7998f7dbc0af9412a719d421feee3430728519ee Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 23 Sep 2024 08:47:34 +0200 Subject: [PATCH 04/24] Rename push.yml -> tests.yml --- .github/workflows/{push.yml => tests.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{push.yml => tests.yml} (100%) diff --git a/.github/workflows/push.yml b/.github/workflows/tests.yml similarity index 100% rename from .github/workflows/push.yml rename to .github/workflows/tests.yml From b9ede0483a57684e1b8bd0bc2e2e7af51ce7c95d Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 23 Sep 2024 09:00:46 +0200 Subject: [PATCH 05/24] Bring tests.yml up to date --- .github/workflows/tests.yml | 20 ++++++++------------ pyproject.toml | 3 +-- release.md | 5 ++--- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 409e3dd..2568e77 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,13 +13,11 @@ jobs: strategy: matrix: # This list needs to be kept in sync with: - # - tag.yml - # - maturin_build_wheel.py + # - dists.yml # - the c_impl tests below - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] rust-toolchain: [stable, beta, nightly] platform: [ - # This list should be kept in sync with tag.yml. { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu", name: "Linux x64" }, # macOS-latest is currently broken by https://github.com/actions/setup-python/issues/855 { os: "macOS-13", python-architecture: "x64", rust-target: "x86_64-apple-darwin", name: "macOS x64" }, @@ -64,12 +62,11 @@ jobs: strategy: matrix: # This list needs to be kept in sync with: - # - tag.yml - # - maturin_build_wheel.py + # - dists.yml # - the rust_impl tests above - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] platform: [ - # This list should be kept in sync with tag.yml. + # This list should be kept in sync with dists.yml. { os: "ubuntu-latest", python-architecture: "x64", name: "Linux x64" }, # macOS-latest is currently broken by https://github.com/actions/setup-python/issues/855 { os: "macOS-13", python-architecture: "x64", name: "macOS x64" }, @@ -113,11 +110,10 @@ jobs: name: "mypy" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.x" # We use numpy to test the error case of trying to hash a strided buffer. - name: Install pytest, numpy, and mypy run: pip install pytest numpy mypy diff --git a/pyproject.toml b/pyproject.toml index 85dc392..f6fe9ff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,3 @@ [build-system] -# Keep the Maturin version in sync with tag.yml. -requires = ["maturin>=0.14,<0.15"] +requires = ["maturin~=1.7"] build-backend = "maturin" diff --git a/release.md b/release.md index 22d90ad..bd68325 100644 --- a/release.md +++ b/release.md @@ -9,15 +9,14 @@ is pushed. To do a release: 3. Push `master` and make sure GitHub CI is green. 4. Tag the release commit and push the tag. -The rest is automatic. For more details, see `tag.yml` and the scripts that it -calls. +The rest is automatic. For more details, see `dists.yml`. ### When a new Python version comes out When a new Python version comes out, it needs to be added to our CI configs in several places. See commit [`e54c5a9`](https://github.com/oconnor663/blake3-py/commit/e54c5a94eecca6b9decf7c11588ab9971402276c) (which added support for Python 3.10) as an example. The comments in -`maturin_build_wheel.py`, `push.yml`, and `tag.yml` should all refer to each +`maturin_build_wheel.py`, `tests.yml`, and `dists.yml` should all refer to each other, to help us avoid forgetting a spot. To retroactively add new wheels to an existing release, tag the config change From f4302394e48fb303befe4b2ba3588863abbf19ec Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 23 Sep 2024 09:01:45 +0200 Subject: [PATCH 06/24] Cancel previous runs in tests.yml --- .github/workflows/tests.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2568e77..3f43d38 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,10 +2,13 @@ name: tests on: push: - branches: - - "*" + branches: master pull_request: +concurrency: # https://stackoverflow.com/questions/66335225#comment133398800_72408109 + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: rust_impl: name: "Rust impl: ${{ matrix.python-version }}, ${{ matrix.rust-toolchain }}, ${{ matrix.platform.name }}" From 0ea3d01a6f7f87b1d6dbfc507a7c79e44ad07604 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 23 Sep 2024 09:11:13 +0200 Subject: [PATCH 07/24] Remove Python 3.13 --- .github/workflows/dists.yml | 3 ++- .github/workflows/tests.yml | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dists.yml b/.github/workflows/dists.yml index 3b99a36..103bbd6 100644 --- a/.github/workflows/dists.yml +++ b/.github/workflows/dists.yml @@ -57,7 +57,8 @@ jobs: with: target: ${{ matrix.target }} manylinux: ${{ matrix.manylinux }} - args: --release --out dist --interpreter ${{ matrix.interpreter == 'all' && '3.8 3.9 3.10 3.11 3.12 3.13' || matrix.interpreter }} + # Keep in sync with tests.yml + args: --release --out dist --interpreter ${{ matrix.interpreter == 'all' && '3.8 3.9 3.10 3.11 3.12' || matrix.interpreter }} rust-toolchain: stable docker-options: -e CI diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3f43d38..196c8ef 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,10 +15,10 @@ jobs: runs-on: ${{ matrix.platform.os }} strategy: matrix: - # This list needs to be kept in sync with: + # Keep in sync with: # - dists.yml # - the c_impl tests below - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] rust-toolchain: [stable, beta, nightly] platform: [ { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu", name: "Linux x64" }, @@ -64,10 +64,10 @@ jobs: runs-on: ${{ matrix.platform.os }} strategy: matrix: - # This list needs to be kept in sync with: + # Keep in sync with: # - dists.yml # - the rust_impl tests above - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] platform: [ # This list should be kept in sync with dists.yml. { os: "ubuntu-latest", python-architecture: "x64", name: "Linux x64" }, From b7bdde86e88f99966c60cae5a7b03f04b5806513 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 23 Sep 2024 09:14:56 +0200 Subject: [PATCH 08/24] Fix matrix --- .github/workflows/dists.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dists.yml b/.github/workflows/dists.yml index 103bbd6..e16bb76 100644 --- a/.github/workflows/dists.yml +++ b/.github/workflows/dists.yml @@ -25,20 +25,32 @@ jobs: include: - os: ubuntu-latest target: i686 + manylinux: auto + interpreter: all - os: ubuntu-latest target: aarch64 + manylinux: auto + interpreter: all - os: ubuntu-latest target: armv7 + manylinux: auto + interpreter: all - os: ubuntu-latest target: ppc64le + manylinux: auto + interpreter: all - os: ubuntu-latest target: s390x + manylinux: auto + interpreter: all - os: ubuntu-latest - manylinux: musllinux_1_1 target: x86_64 - - os: ubuntu-latest manylinux: musllinux_1_1 + interpreter: all + - os: ubuntu-latest target: aarch64 + manylinux: musllinux_1_1 + interpreter: all exclude: # FIXME aarch64 builds broken, see https://github.com/PyO3/maturin/issues/2110 - os: windows-latest From 2f58647eb6df2617cfc3f33ae510c11e2cc49807 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 23 Sep 2024 10:42:20 +0300 Subject: [PATCH 09/24] Fix typo --- .github/workflows/dists.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dists.yml b/.github/workflows/dists.yml index e16bb76..f7ca94e 100644 --- a/.github/workflows/dists.yml +++ b/.github/workflows/dists.yml @@ -74,7 +74,7 @@ jobs: rust-toolchain: stable docker-options: -e CI - - run: ${{ (matrix.os == 'windows' && 'dir') || 'ls -lh' }} dist/ + - run: ${{ (matrix.os == 'windows-latest' && 'dir') || 'ls -ltra' }} dist/ - run: pip install twine && twine check --strict dist/* From ed6eb5b55e3ef6e6dcc9e813503bba52d7d9b10c Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 23 Sep 2024 09:51:49 +0200 Subject: [PATCH 10/24] Add win32 wheels --- .github/workflows/dists.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dists.yml b/.github/workflows/dists.yml index f7ca94e..6c8d765 100644 --- a/.github/workflows/dists.yml +++ b/.github/workflows/dists.yml @@ -14,7 +14,7 @@ concurrency: # https://stackoverflow.com/questions/66335225#comment133398800_72 jobs: wheel: - name: ${{ matrix.os }}-${{ matrix.target }}-${{ matrix.interpreter }}-${{ matrix.manylinux }} + name: ${{ matrix.os }}-${{ matrix.target }}-${{ matrix.interpreter }}-${{ matrix.manylinux }}-${{ matrix.python-architecture }} strategy: fail-fast: false matrix: @@ -22,35 +22,48 @@ jobs: target: [x86_64, aarch64] manylinux: [auto] interpreter: [all] + python-architecture: [x64] include: + - os: windows + target: i686 + manylinux: auto + interpreter: all + python-architecture: x86 - os: ubuntu-latest target: i686 manylinux: auto interpreter: all + python-architecture: x64 - os: ubuntu-latest target: aarch64 manylinux: auto interpreter: all + python-architecture: x64 - os: ubuntu-latest target: armv7 manylinux: auto interpreter: all + python-architecture: x64 - os: ubuntu-latest target: ppc64le manylinux: auto interpreter: all + python-architecture: x64 - os: ubuntu-latest target: s390x manylinux: auto interpreter: all + python-architecture: x64 - os: ubuntu-latest target: x86_64 manylinux: musllinux_1_1 interpreter: all + python-architecture: x64 - os: ubuntu-latest target: aarch64 manylinux: musllinux_1_1 interpreter: all + python-architecture: x64 exclude: # FIXME aarch64 builds broken, see https://github.com/PyO3/maturin/issues/2110 - os: windows-latest @@ -80,7 +93,7 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: dist-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.interpreter }}-${{ matrix.manylinux }} + name: dist-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.interpreter }}-${{ matrix.manylinux }}-${{ matrix.python-architecture }} path: dist sdist: From a94f3e4c39694e80b340b1d8b9676a8a961f2115 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 23 Sep 2024 09:54:53 +0200 Subject: [PATCH 11/24] Fix typo --- .github/workflows/dists.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dists.yml b/.github/workflows/dists.yml index 6c8d765..8de5ff8 100644 --- a/.github/workflows/dists.yml +++ b/.github/workflows/dists.yml @@ -24,7 +24,7 @@ jobs: interpreter: [all] python-architecture: [x64] include: - - os: windows + - os: windows-latest target: i686 manylinux: auto interpreter: all From 3774c6dd409e3c58cfa7777c3edae7590aed657b Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 23 Sep 2024 09:59:58 +0200 Subject: [PATCH 12/24] Enable windows-aarch64 --- .github/workflows/dists.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/dists.yml b/.github/workflows/dists.yml index 8de5ff8..d9c4278 100644 --- a/.github/workflows/dists.yml +++ b/.github/workflows/dists.yml @@ -64,10 +64,6 @@ jobs: manylinux: musllinux_1_1 interpreter: all python-architecture: x64 - exclude: - # FIXME aarch64 builds broken, see https://github.com/PyO3/maturin/issues/2110 - - os: windows-latest - target: aarch64 runs-on: ${{ matrix.os }} steps: From 354c0a88ead06ac6dd2489d2d12c9368f3ca9a96 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 23 Sep 2024 10:04:29 +0200 Subject: [PATCH 13/24] Revert "Enable windows-aarch64" This reverts commit 3774c6dd409e3c58cfa7777c3edae7590aed657b. --- .github/workflows/dists.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/dists.yml b/.github/workflows/dists.yml index d9c4278..8de5ff8 100644 --- a/.github/workflows/dists.yml +++ b/.github/workflows/dists.yml @@ -64,6 +64,10 @@ jobs: manylinux: musllinux_1_1 interpreter: all python-architecture: x64 + exclude: + # FIXME aarch64 builds broken, see https://github.com/PyO3/maturin/issues/2110 + - os: windows-latest + target: aarch64 runs-on: ${{ matrix.os }} steps: From d54680ae2611ea6caed8669a2879d94d5f566426 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 23 Sep 2024 10:45:59 +0200 Subject: [PATCH 14/24] Clean up tests.yml --- .github/workflows/tests.yml | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 196c8ef..e812a50 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,7 +11,7 @@ concurrency: # https://stackoverflow.com/questions/66335225#comment133398800_72 jobs: rust_impl: - name: "Rust impl: ${{ matrix.python-version }}, ${{ matrix.rust-toolchain }}, ${{ matrix.platform.name }}" + name: rust-impl-${{ matrix.python-version }}-${{ matrix.rust-toolchain }}-${{ matrix.platform.name }} runs-on: ${{ matrix.platform.os }} strategy: matrix: @@ -21,19 +21,12 @@ jobs: python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] rust-toolchain: [stable, beta, nightly] platform: [ - { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu", name: "Linux x64" }, - # macOS-latest is currently broken by https://github.com/actions/setup-python/issues/855 - { os: "macOS-13", python-architecture: "x64", rust-target: "x86_64-apple-darwin", name: "macOS x64" }, - { os: "macOS-11", python-architecture: "x64", rust-target: "aarch64-apple-darwin", name: "macOS ARM" }, - { os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc", name: "Windows x86" }, - { os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc", name: "Windows x64" }, + { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu", name: "ubuntu-x64" }, + { os: "macos-13", python-architecture: "x64", rust-target: "x86_64-apple-darwin", name: "macos-x64" }, + { os: "macos-14", python-architecture: "x64", rust-target: "aarch64-apple-darwin", name: "macos-arm64" }, + { os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc", name: "windows-x86" }, + { os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc", name: "windows-x64" }, ] - exclude: - # aarch64 macOS has no support for Python version lower than 3.8 - - python-version: 3.7 - platform: - os: "macOS-11" - rust-target: "aarch64-apple-darwin" fail-fast: false env: CARGO_BUILD_TARGET: ${{ matrix.platform.rust-target }} @@ -60,7 +53,7 @@ jobs: run: python -u -m pytest --verbose c_impl: - name: "C impl: ${{ matrix.python-version }}, ${{ matrix.platform.name }}" + name: c-impl-${{ matrix.python-version }}-${{ matrix.platform.name }} runs-on: ${{ matrix.platform.os }} strategy: matrix: @@ -70,15 +63,13 @@ jobs: python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] platform: [ # This list should be kept in sync with dists.yml. - { os: "ubuntu-latest", python-architecture: "x64", name: "Linux x64" }, - # macOS-latest is currently broken by https://github.com/actions/setup-python/issues/855 - { os: "macOS-13", python-architecture: "x64", name: "macOS x64" }, - { os: "windows-latest", python-architecture: "x86", name: "Windows x86" }, - { os: "windows-latest", python-architecture: "x64", name: "Windows x64" }, + { os: "ubuntu-latest", python-architecture: "x64", name: "ubuntu-x64" }, + { os: "macos-13", python-architecture: "x64", name: "macos-x64" }, + { os: "macos-14", python-architecture: "x64", name: "macos-arm64" }, + { os: "windows-latest", python-architecture: "x86", name: "windows-x86" }, + { os: "windows-latest", python-architecture: "x64", name: "windows-x64" }, ] fail-fast: false - env: - CARGO_BUILD_TARGET: ${{ matrix.platform.rust-target }} steps: - uses: actions/checkout@v4 - name: Set up Python From d0244165b451d2dcdf46710df0e1d1ff64b48ec6 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 23 Sep 2024 10:50:39 +0200 Subject: [PATCH 15/24] Exclude Python <3.11 on macos-arm64 --- .github/workflows/tests.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e812a50..d717423 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,6 +27,14 @@ jobs: { os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc", name: "windows-x86" }, { os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc", name: "windows-x64" }, ] + exclude: + # https://github.com/actions/setup-python/issues/855#issuecomment-2196137381 + - platform: { os: "macos-14", python-architecture: "x64", rust-target: "aarch64-apple-darwin", name: "macos-arm64" }, + python-version: "3.8" + - platform: { os: "macos-14", python-architecture: "x64", rust-target: "aarch64-apple-darwin", name: "macos-arm64" }, + python-version: "3.9" + - platform: { os: "macos-14", python-architecture: "x64", rust-target: "aarch64-apple-darwin", name: "macos-arm64" }, + python-version: "3.10" fail-fast: false env: CARGO_BUILD_TARGET: ${{ matrix.platform.rust-target }} From c0e9035cb4f411b0ca20588e54114de53205a675 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 23 Sep 2024 10:53:45 +0200 Subject: [PATCH 16/24] Disable macos-arm64 in tests.yml --- .github/workflows/tests.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d717423..6bbbf0e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,18 +23,11 @@ jobs: platform: [ { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu", name: "ubuntu-x64" }, { os: "macos-13", python-architecture: "x64", rust-target: "x86_64-apple-darwin", name: "macos-x64" }, - { os: "macos-14", python-architecture: "x64", rust-target: "aarch64-apple-darwin", name: "macos-arm64" }, + # disabled for now ref https://github.com/actions/setup-python/issues/855#issuecomment-2196137381 + # { os: "macos-14", python-architecture: "x64", rust-target: "aarch64-apple-darwin", name: "macos-arm64" }, { os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc", name: "windows-x86" }, { os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc", name: "windows-x64" }, ] - exclude: - # https://github.com/actions/setup-python/issues/855#issuecomment-2196137381 - - platform: { os: "macos-14", python-architecture: "x64", rust-target: "aarch64-apple-darwin", name: "macos-arm64" }, - python-version: "3.8" - - platform: { os: "macos-14", python-architecture: "x64", rust-target: "aarch64-apple-darwin", name: "macos-arm64" }, - python-version: "3.9" - - platform: { os: "macos-14", python-architecture: "x64", rust-target: "aarch64-apple-darwin", name: "macos-arm64" }, - python-version: "3.10" fail-fast: false env: CARGO_BUILD_TARGET: ${{ matrix.platform.rust-target }} From 47786b99b842695b4a264d593277f8a2ac836a20 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 23 Sep 2024 10:55:03 +0200 Subject: [PATCH 17/24] Disable macos-arm64 in tests.yml --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6bbbf0e..09e2004 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -66,7 +66,8 @@ jobs: # This list should be kept in sync with dists.yml. { os: "ubuntu-latest", python-architecture: "x64", name: "ubuntu-x64" }, { os: "macos-13", python-architecture: "x64", name: "macos-x64" }, - { os: "macos-14", python-architecture: "x64", name: "macos-arm64" }, + # disabled for now ref https://github.com/actions/setup-python/issues/855#issuecomment-2196137381 + # { os: "macos-14", python-architecture: "x64", name: "macos-arm64" }, { os: "windows-latest", python-architecture: "x86", name: "windows-x86" }, { os: "windows-latest", python-architecture: "x64", name: "windows-x64" }, ] From bef0c5d21852cb5d5ee644fc766cce09644824d6 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 23 Sep 2024 20:33:47 +0200 Subject: [PATCH 18/24] Simplify job matrix --- .github/workflows/dists.yml | 35 ++++------------------------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/.github/workflows/dists.yml b/.github/workflows/dists.yml index 8de5ff8..e7f2a38 100644 --- a/.github/workflows/dists.yml +++ b/.github/workflows/dists.yml @@ -14,56 +14,29 @@ concurrency: # https://stackoverflow.com/questions/66335225#comment133398800_72 jobs: wheel: - name: ${{ matrix.os }}-${{ matrix.target }}-${{ matrix.interpreter }}-${{ matrix.manylinux }}-${{ matrix.python-architecture }} + name: ${{ matrix.os }}-${{ matrix.target }}-${{ matrix.manylinux || 'auto' }} strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] target: [x86_64, aarch64] - manylinux: [auto] - interpreter: [all] - python-architecture: [x64] include: - os: windows-latest target: i686 - manylinux: auto - interpreter: all - python-architecture: x86 - os: ubuntu-latest target: i686 - manylinux: auto - interpreter: all - python-architecture: x64 - - os: ubuntu-latest - target: aarch64 - manylinux: auto - interpreter: all - python-architecture: x64 - os: ubuntu-latest target: armv7 - manylinux: auto - interpreter: all - python-architecture: x64 - os: ubuntu-latest target: ppc64le - manylinux: auto - interpreter: all - python-architecture: x64 - os: ubuntu-latest target: s390x - manylinux: auto - interpreter: all - python-architecture: x64 - os: ubuntu-latest target: x86_64 manylinux: musllinux_1_1 - interpreter: all - python-architecture: x64 - os: ubuntu-latest target: aarch64 manylinux: musllinux_1_1 - interpreter: all - python-architecture: x64 exclude: # FIXME aarch64 builds broken, see https://github.com/PyO3/maturin/issues/2110 - os: windows-latest @@ -81,9 +54,9 @@ jobs: uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} - manylinux: ${{ matrix.manylinux }} + manylinux: ${{ matrix.manylinux || 'auto' }} # Keep in sync with tests.yml - args: --release --out dist --interpreter ${{ matrix.interpreter == 'all' && '3.8 3.9 3.10 3.11 3.12' || matrix.interpreter }} + args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12' rust-toolchain: stable docker-options: -e CI @@ -93,7 +66,7 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: dist-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.interpreter }}-${{ matrix.manylinux }}-${{ matrix.python-architecture }} + name: dist-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.manylinux || 'auto' }} path: dist sdist: From 9674e1b3846a3523a6eefaebe06369b4fd5e9c45 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 23 Sep 2024 22:29:16 +0300 Subject: [PATCH 19/24] Allow a wider range of maturin versions in build-system --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f6fe9ff..7c569ab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["maturin~=1.7"] +requires = ["maturin~=1.0"] build-backend = "maturin" From 2d56b535f32ae61bffb80d974db8bb039bebf56e Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 23 Sep 2024 22:36:17 +0300 Subject: [PATCH 20/24] Fix maturin-action not recognising ~= --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7c569ab..11e8107 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["maturin~=1.0"] +requires = ["maturin>=1.0,<2"] build-backend = "maturin" From 35808ff74bedc81f326a1025c4dbf8230c8ad7d0 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 23 Sep 2024 22:48:40 +0300 Subject: [PATCH 21/24] Add skip-existing: true --- .github/workflows/dists.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dists.yml b/.github/workflows/dists.yml index e7f2a38..d440531 100644 --- a/.github/workflows/dists.yml +++ b/.github/workflows/dists.yml @@ -50,8 +50,7 @@ jobs: with: python-version: 3.x - - name: build wheels - uses: PyO3/maturin-action@v1 + - uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} manylinux: ${{ matrix.manylinux || 'auto' }} @@ -70,7 +69,7 @@ jobs: path: dist sdist: - name: build sdist + name: sdist runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -112,3 +111,5 @@ jobs: # trusted publisher in https://pypi.org/manage/project/blake3/settings/publishing/ - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@v1.10.2 + with: + skip-existing: true From 141c19e86b72189b3c98aa42ed6ec2652ab0412f Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 23 Sep 2024 22:54:03 +0300 Subject: [PATCH 22/24] Fix musllinux overwriting manylinux --- .github/workflows/dists.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dists.yml b/.github/workflows/dists.yml index d440531..a8ac71b 100644 --- a/.github/workflows/dists.yml +++ b/.github/workflows/dists.yml @@ -20,6 +20,7 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] target: [x86_64, aarch64] + manylinux: [auto] include: - os: windows-latest target: i686 From 1027a62305c948499fb845c209658cd7aec9ade7 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 23 Sep 2024 22:01:17 +0200 Subject: [PATCH 23/24] Simplify matrix --- .github/workflows/dists.yml | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/.github/workflows/dists.yml b/.github/workflows/dists.yml index a8ac71b..5cfad9b 100644 --- a/.github/workflows/dists.yml +++ b/.github/workflows/dists.yml @@ -18,30 +18,19 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - target: [x86_64, aarch64] - manylinux: [auto] include: - - os: windows-latest - target: i686 - - os: ubuntu-latest - target: i686 - - os: ubuntu-latest - target: armv7 - - os: ubuntu-latest - target: ppc64le - - os: ubuntu-latest - target: s390x - - os: ubuntu-latest - target: x86_64 - manylinux: musllinux_1_1 - - os: ubuntu-latest - target: aarch64 - manylinux: musllinux_1_1 - exclude: - # FIXME aarch64 builds broken, see https://github.com/PyO3/maturin/issues/2110 - - os: windows-latest - target: aarch64 + - { os: macos-latest, target: x86_64 } + - { os: macos-latest, target: aarch64 } + - { os: ubuntu-latest, target: x86_64 } + - { os: ubuntu-latest, target: aarch64 } + - { os: ubuntu-latest, target: i686 } + - { os: ubuntu-latest, target: armv7 } + - { os: ubuntu-latest, target: ppc64le } + - { os: ubuntu-latest, target: s390x } + - { os: ubuntu-latest, target: x86_64, manylinux: musllinux_1_1 } + - { os: ubuntu-latest, target: aarch64, manylinux: musllinux_1_1 } + - { os: windows-latest, target: x86_64 } + - { os: windows-latest, target: i686 } runs-on: ${{ matrix.os }} steps: From a89f85cd491d165330032788ab328768ad9d02d4 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Sun, 20 Oct 2024 18:28:15 +0300 Subject: [PATCH 24/24] Update release.md accordingly --- release.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/release.md b/release.md index bd68325..8b4b80b 100644 --- a/release.md +++ b/release.md @@ -7,7 +7,7 @@ is pushed. To do a release: 1. Bump the version number in `Cargo.toml`. 2. Make a release commit. 3. Push `master` and make sure GitHub CI is green. -4. Tag the release commit and push the tag. +4. Create a new GitHub Release pointing to `master`. The rest is automatic. For more details, see `dists.yml`. @@ -15,13 +15,11 @@ The rest is automatic. For more details, see `dists.yml`. When a new Python version comes out, it needs to be added to our CI configs in several places. See commit [`e54c5a9`](https://github.com/oconnor663/blake3-py/commit/e54c5a94eecca6b9decf7c11588ab9971402276c) -(which added support for Python 3.10) as an example. The comments in -`maturin_build_wheel.py`, `tests.yml`, and `dists.yml` should all refer to each +(which added support for Python 3.10) as an example. The comments in `tests.yml`, and `dists.yml` should all refer to each other, to help us avoid forgetting a spot. -To retroactively add new wheels to an existing release, tag the config change +To retroactively add new wheels to an existing release on PyPI, release the config change commit with the original release version plus the suffix `_rerelease`. For -example, to build new wheels for version 0.2.1, push a tag called +example, to build new wheels for version 0.2.1, create a GitHub release called `0.2.1_rerelease`. The upload step of the rerelease job will automatically skip -assets that already exist. For more details, search for `_rerelease` in -`upload_github_release_asset.py` and `twine_upload.py`. +assets that already exist (using `skip-existing: true` in `dists.yml`).