From 5f40b7e6541d9bf615ccc62b6b3da4257bb83a25 Mon Sep 17 00:00:00 2001 From: Ryo Igarashi Date: Sat, 7 Mar 2026 13:26:47 +0900 Subject: [PATCH 1/2] chore: Bump pyo3 to 0.28.2 and regenerate maturin CI Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/ci_python.yaml | 2 +- .github/workflows/release_pyhon.yaml | 115 ------------------- .github/workflows/release_python.yaml | 155 ++++++++++++++++++++++++++ ainu-utils-python/Cargo.toml | 2 +- ainu-utils-python/pyproject.toml | 4 +- 5 files changed, 159 insertions(+), 119 deletions(-) delete mode 100644 .github/workflows/release_pyhon.yaml create mode 100644 .github/workflows/release_python.yaml diff --git a/.github/workflows/ci_python.yaml b/.github/workflows/ci_python.yaml index 242528b..a8c03dc 100644 --- a/.github/workflows/ci_python.yaml +++ b/.github/workflows/ci_python.yaml @@ -35,5 +35,5 @@ jobs: run: | set -e pip install ainu-utils --find-links dist --force-reinstall - pip install pytest + pip install ".[test,dev]" cd ./ainu-utils-python && pytest diff --git a/.github/workflows/release_pyhon.yaml b/.github/workflows/release_pyhon.yaml deleted file mode 100644 index 00409cf..0000000 --- a/.github/workflows/release_pyhon.yaml +++ /dev/null @@ -1,115 +0,0 @@ -# This file is autogenerated by maturin v1.5.0 -# To update, run -# -# maturin generate-ci github -m ./ainu-utils-python/Cargo.toml -o ./.github/workflows/release_python.yaml --platform linux macos windows -# -name: "Release: Python" - -on: - push: - tags: - - 'v*' - - 'python-v*' - workflow_dispatch: - -permissions: - contents: read - -jobs: - linux: - runs-on: ubuntu-latest - strategy: - matrix: - target: [x86_64, x86, aarch64, armv7, s390x, ppc64le] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - name: Build wheels - uses: PyO3/maturin-action@v1 - with: - target: ${{ matrix.target }} - args: --release --out dist --find-interpreter --manifest-path ./ainu-utils-python/Cargo.toml - sccache: 'true' - manylinux: auto - - name: Upload wheels - uses: actions/upload-artifact@v4 - with: - name: wheels-linux-${{ matrix.target }} - path: dist - - windows: - runs-on: windows-latest - strategy: - matrix: - target: [x64, x86] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.10' - architecture: ${{ matrix.target }} - - name: Build wheels - uses: PyO3/maturin-action@v1 - with: - target: ${{ matrix.target }} - args: --release --out dist --find-interpreter --manifest-path ./ainu-utils-python/Cargo.toml - sccache: 'true' - - name: Upload wheels - uses: actions/upload-artifact@v4 - with: - name: wheels-windows-${{ matrix.target }} - path: dist - - macos: - runs-on: macos-latest - strategy: - matrix: - target: [x86_64, aarch64] - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - name: Build wheels - uses: PyO3/maturin-action@v1 - with: - target: ${{ matrix.target }} - args: --release --out dist --find-interpreter --manifest-path ./ainu-utils-python/Cargo.toml - sccache: 'true' - - name: Upload wheels - uses: actions/upload-artifact@v4 - with: - name: wheels-macos-${{ matrix.target }} - path: dist - - sdist: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build sdist - uses: PyO3/maturin-action@v1 - with: - command: sdist - args: --out dist --manifest-path ./ainu-utils-python/Cargo.toml - - name: Upload sdist - uses: actions/upload-artifact@v4 - with: - name: wheels-sdist - path: dist - - release: - name: Release - runs-on: ubuntu-latest - if: ${{ !contains(github.ref, 'rc') }} - needs: [linux, windows, macos, sdist] - steps: - - uses: actions/download-artifact@v4 - - name: Publish to PyPI - uses: PyO3/maturin-action@v1 - env: - MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} - with: - command: upload - args: --non-interactive --skip-existing wheels-*/* diff --git a/.github/workflows/release_python.yaml b/.github/workflows/release_python.yaml new file mode 100644 index 0000000..176a73d --- /dev/null +++ b/.github/workflows/release_python.yaml @@ -0,0 +1,155 @@ +# This file is autogenerated by maturin v1.12.6 +# To update, run +# +# maturin generate-ci github -m ./ainu-utils-python/Cargo.toml -o ./.github/workflows/release_python.yaml --platform linux macos windows +# +name: "Release: Python" + +on: + push: + branches: + - main + - master + tags: + - '*' + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + linux: + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: ubuntu-22.04 + target: x86_64 + - runner: ubuntu-22.04 + target: x86 + - runner: ubuntu-22.04 + target: aarch64 + - runner: ubuntu-22.04 + target: armv7 + - runner: ubuntu-22.04 + target: s390x + - runner: ubuntu-22.04 + target: ppc64le + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 + with: + python-version: 3.x + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter --manifest-path ./ainu-utils-python/Cargo.toml + sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} + manylinux: auto + - name: Upload wheels + uses: actions/upload-artifact@v6 + with: + name: wheels-linux-${{ matrix.platform.target }} + path: dist + + windows: + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: windows-latest + target: x64 + python_arch: x64 + - runner: windows-latest + target: x86 + python_arch: x86 + - runner: windows-11-arm + target: aarch64 + python_arch: arm64 + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 + with: + python-version: 3.13 + architecture: ${{ matrix.platform.python_arch }} + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter --manifest-path ./ainu-utils-python/Cargo.toml + sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} + - name: Upload wheels + uses: actions/upload-artifact@v6 + with: + name: wheels-windows-${{ matrix.platform.target }} + path: dist + + macos: + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: macos-15-intel + target: x86_64 + - runner: macos-latest + target: aarch64 + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 + with: + python-version: 3.x + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter --manifest-path ./ainu-utils-python/Cargo.toml + sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} + - name: Upload wheels + uses: actions/upload-artifact@v6 + with: + name: wheels-macos-${{ matrix.platform.target }} + path: dist + + sdist: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Build sdist + uses: PyO3/maturin-action@v1 + with: + command: sdist + args: --out dist --manifest-path ./ainu-utils-python/Cargo.toml + - name: Upload sdist + uses: actions/upload-artifact@v6 + with: + name: wheels-sdist + path: dist + + release: + name: Release + runs-on: ubuntu-latest + if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }} + needs: [linux, windows, macos, sdist] + permissions: + # Use to sign the release artifacts + id-token: write + # Used to upload release artifacts + contents: write + # Used to generate artifact attestation + attestations: write + steps: + - uses: actions/download-artifact@v7 + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v3 + with: + subject-path: 'wheels-*/*' + - name: Install uv + if: ${{ startsWith(github.ref, 'refs/tags/') }} + uses: astral-sh/setup-uv@v7 + - name: Publish to PyPI + if: ${{ startsWith(github.ref, 'refs/tags/') }} + run: uv publish 'wheels-*/*' + env: + UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }} diff --git a/ainu-utils-python/Cargo.toml b/ainu-utils-python/Cargo.toml index c763a85..921f7ee 100644 --- a/ainu-utils-python/Cargo.toml +++ b/ainu-utils-python/Cargo.toml @@ -10,5 +10,5 @@ name = "ainu_utils" crate-type = ["cdylib"] [dependencies] -pyo3 = "0.24.1" +pyo3 = "0.28.2" ainu-utils = { path = "../ainu-utils" } diff --git a/ainu-utils-python/pyproject.toml b/ainu-utils-python/pyproject.toml index 821bfa6..036c2ba 100644 --- a/ainu-utils-python/pyproject.toml +++ b/ainu-utils-python/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["maturin>=1.4,<2.0"] +requires = ["maturin>=1.12,<2.0"] build-backend = "maturin" [tool.maturin] @@ -14,4 +14,4 @@ license = "MIT" [project.optional-dependencies] test = ["pytest==8.1.1"] -dev = ["ruff==0.3.3", "mypy==1.9.0"] +dev = ["ruff==0.3.3", "mypy==1.9.0", "maturin>=1.12,<2.0"] From 2e125a446b8aa182be5c7377d8e47153beb2dbd9 Mon Sep 17 00:00:00 2001 From: Ryo Igarashi Date: Sat, 7 Mar 2026 13:27:07 +0900 Subject: [PATCH 2/2] fix: Revert ci_python.yaml pytest install to pip install pytest Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/ci_python.yaml | 2 +- .github/workflows/release_python.yaml | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci_python.yaml b/.github/workflows/ci_python.yaml index a8c03dc..242528b 100644 --- a/.github/workflows/ci_python.yaml +++ b/.github/workflows/ci_python.yaml @@ -35,5 +35,5 @@ jobs: run: | set -e pip install ainu-utils --find-links dist --force-reinstall - pip install ".[test,dev]" + pip install pytest cd ./ainu-utils-python && pytest diff --git a/.github/workflows/release_python.yaml b/.github/workflows/release_python.yaml index 176a73d..9fbf866 100644 --- a/.github/workflows/release_python.yaml +++ b/.github/workflows/release_python.yaml @@ -7,12 +7,9 @@ name: "Release: Python" on: push: - branches: - - main - - master tags: - - '*' - pull_request: + - 'v*' + - 'python-v*' workflow_dispatch: permissions: