diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 000000000..84e512d80 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,142 @@ +# This file is autogenerated by maturin v1.3.1 +# To update, run +# +# maturin generate-ci github +# +name: CI + +on: + workflow_dispatch: + inputs: + version: + description: "バージョン情報(A.BB.C / A.BB.C-preview.D)" + required: true + release: + types: + - published + +env: + VERSION: ${{ github.event.release.tag_name || inputs.version || '0.0.0' }} + +permissions: + contents: read + +jobs: + version: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install cargo-binstall + uses: taiki-e/install-action@cargo-binstall + - name: Install cargo-edit + run: cargo binstall cargo-edit@^0.11 --no-confirm --log-level debug + - name: set cargo version + run: | + cargo set-version "$VERSION" --exclude voicevox_core_python_api --exclude downloader --exclude xtask + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: projects + path: ./ + + linux: + runs-on: ubuntu-latest + needs: version + strategy: + matrix: + target: [x86_64, aarch64] + steps: + - uses: actions/download-artifact@v3 + with: + name: projects + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.target }} + args: --release --out dist --locked --manifest-path crates/voicevox_core_python_api/Cargo.toml --find-interpreter + sccache: 'true' + manylinux: auto + - name: Upload wheels + uses: actions/upload-artifact@v3 + with: + name: wheels + path: dist + + windows: + runs-on: windows-latest + needs: version + strategy: + matrix: + target: [x64, x86] + steps: + - uses: actions/download-artifact@v3 + with: + name: projects + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + architecture: ${{ matrix.target }} + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.target }} + args: --release --out dist --locked --manifest-path crates/voicevox_core_python_api/Cargo.toml --find-interpreter + sccache: 'true' + - name: Upload wheels + uses: actions/upload-artifact@v3 + with: + name: wheels + path: dist + + macos: + runs-on: macos-latest + needs: version + strategy: + matrix: + target: [x86_64] + steps: + - uses: actions/download-artifact@v3 + with: + name: projects + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + - uses: dtolnay/rust-toolchain@stable + - run: | + pip install --upgrade poetry + poetry config virtualenvs.create false + (cd crates/voicevox_core_python_api && poetry install --with dev) + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.target }} + args: --release --out dist --locked --manifest-path crates/voicevox_core_python_api/Cargo.toml --find-interpreter + sccache: 'true' + - name: Upload wheels + uses: actions/upload-artifact@v3 + with: + name: wheels + path: dist + + release: + name: Release + runs-on: ubuntu-latest + if: "startsWith(github.ref, 'refs/tags/')" + needs: [linux, windows, macos] + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v3 + with: + name: wheels + path: dist/ + - name: Publish to PyPI + uses: PyO3/maturin-action@v1 + with: + command: upload + args: --non-interactive --skip-existing dist/* + env: + MATURIN_REPOSITORY_URL: https://test.pypi.org/legacy/ diff --git a/crates/voicevox_core_python_api/Cargo.toml b/crates/voicevox_core_python_api/Cargo.toml index 5ccd1dc41..441625fb7 100644 --- a/crates/voicevox_core_python_api/Cargo.toml +++ b/crates/voicevox_core_python_api/Cargo.toml @@ -15,7 +15,7 @@ directml = ["voicevox_core/directml"] camino.workspace = true easy-ext.workspace = true log.workspace = true -pyo3 = { workspace = true, features = ["abi3-py38", "extension-module"] } +pyo3 = { workspace = true, features = ["extension-module"] } pyo3-asyncio = { workspace = true, features = ["tokio-runtime"] } pyo3-log.workspace = true serde = { workspace = true, features = ["derive"] } diff --git a/crates/voicevox_core_python_api/poetry.lock b/crates/voicevox_core_python_api/poetry.lock index 0decb2a6a..cbf69bec6 100644 --- a/crates/voicevox_core_python_api/poetry.lock +++ b/crates/voicevox_core_python_api/poetry.lock @@ -465,24 +465,24 @@ files = [ [[package]] name = "maturin" -version = "1.3.1" +version = "1.3.2" description = "Build and publish crates with pyo3, rust-cpython and cffi bindings as well as rust binaries as python packages" optional = false python-versions = ">=3.7" files = [ - {file = "maturin-1.3.1-py3-none-linux_armv6l.whl", hash = "sha256:925f8324d9bbe8fad90b73ebc6c7f6f594645e7f13af50bded72606b6c233208"}, - {file = "maturin-1.3.1-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:f3c2c694b76e63e78c353e4a2a74f8baff5ac6becf807f23435d28e47a567d63"}, - {file = "maturin-1.3.1-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:13188296f389d05043b8bd2265df66692490b61ba219ae7d5abc09e81e5659ce"}, - {file = "maturin-1.3.1-py3-none-manylinux_2_12_i686.manylinux2010_i686.musllinux_1_1_i686.whl", hash = "sha256:11bbf9978695ac066729af08bc24123317ca3fad51757b0fbdfe811212896714"}, - {file = "maturin-1.3.1-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.musllinux_1_1_x86_64.whl", hash = "sha256:d566d2f424fa3f5cd6bd3033fd300b80654884abd061bd53c68f4717753e7d58"}, - {file = "maturin-1.3.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:c0e2b8171f1a70270b86ed72397ba548e3bf4d914f24cd50a228ed85a9d5e914"}, - {file = "maturin-1.3.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_1_armv7l.whl", hash = "sha256:804c6706588a9ca78f18f1a10adf9d24099b9cd3c2917628063ba8d4418b8a50"}, - {file = "maturin-1.3.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.musllinux_1_1_ppc64le.whl", hash = "sha256:c533d02563bb185125488cdcf161cc6ba2cdd4812ebff1b6504d1b29880ba1f8"}, - {file = "maturin-1.3.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:066b0c515505d4a4c526a9afc26fad4f010972d60937530dc4949dda0f49aa61"}, - {file = "maturin-1.3.1-py3-none-win32.whl", hash = "sha256:4835c332e3b632547db12e6a70abc18cb90ba9df06200dd9a7cc73424919901d"}, - {file = "maturin-1.3.1-py3-none-win_amd64.whl", hash = "sha256:871268417d6b3e2b46018c54a0522efc018bc4918b885d005df90b338e0674c7"}, - {file = "maturin-1.3.1-py3-none-win_arm64.whl", hash = "sha256:659a601c27984a50350f792447ff65ec60309423747f5304c98cb7b7fbb63d39"}, - {file = "maturin-1.3.1.tar.gz", hash = "sha256:efa194e99ae5fff185263d8244acacb12ae256ea73aba62c9446f6075ffc7ac1"}, + {file = "maturin-1.3.2-py3-none-linux_armv6l.whl", hash = "sha256:34630f6a6223e36198b6039e40724fe27f6465ea892531ac82eeff604cfcbbb0"}, + {file = "maturin-1.3.2-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:61b9dc290663040df4c837aa9e1858d485aaf90a10ec31b822f1d92a85334e2c"}, + {file = "maturin-1.3.2-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:5a133d22fa1ad4b687f6a89801cd7a9247164270c2ae639d1b7f53f0701601ab"}, + {file = "maturin-1.3.2-py3-none-manylinux_2_12_i686.manylinux2010_i686.musllinux_1_1_i686.whl", hash = "sha256:1258d380498924626cd87820ff54eeb16b662799ddda10631f54fdfbab780d6a"}, + {file = "maturin-1.3.2-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.musllinux_1_1_x86_64.whl", hash = "sha256:8c90336c9bb0cb538bb035f9e5728ab59148c87bb8e76df26359560f8580fef4"}, + {file = "maturin-1.3.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:d4b66635e3933709a67760e886931b087089e484e441b1b6be358da474947cea"}, + {file = "maturin-1.3.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_1_armv7l.whl", hash = "sha256:4b9cc75d7912b1c0512d4ea9dd66b8b401cbc11c69e32a23215b10a9f2bccdf4"}, + {file = "maturin-1.3.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.musllinux_1_1_ppc64le.whl", hash = "sha256:b0b408fb55a7ce037562c44321ab40e2cee0f670b335de44b3b39c2334a0aea1"}, + {file = "maturin-1.3.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a469deffd61dc36ceafa0a74a437f39556c4f3c909d2eeb221b2ef2ca594469f"}, + {file = "maturin-1.3.2-py3-none-win32.whl", hash = "sha256:b67c51d5330d73da03726a4579c56404dc300603709e3f6e8945cc6e3550f885"}, + {file = "maturin-1.3.2-py3-none-win_amd64.whl", hash = "sha256:84d5587d2c0168d6cce0bcf720e62f2b7c87f2a9a9f749bcc7b86bc088a32c93"}, + {file = "maturin-1.3.2-py3-none-win_arm64.whl", hash = "sha256:ff0023a21df192a736726ad9fe55fb083f153d6287832d0add4861dfb35a8e83"}, + {file = "maturin-1.3.2.tar.gz", hash = "sha256:952d458b3dea01e9670582ac2dff3c522a34e491f08ed6376b270655a68c24af"}, ] [package.dependencies] @@ -514,6 +514,25 @@ files = [ {file = "packaging-23.2.tar.gz", hash = "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5"}, ] +[[package]] +name = "patchelf" +version = "0.17.2.1" +description = "A small utility to modify the dynamic linker and RPATH of ELF executables." +optional = false +python-versions = "*" +files = [ + {file = "patchelf-0.17.2.1-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:fc329da0e8f628bd836dfb8eaf523547e342351fa8f739bf2b3fe4a6db5a297c"}, + {file = "patchelf-0.17.2.1-py2.py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_1_armv7l.whl", hash = "sha256:ccb266a94edf016efe80151172c26cff8c2ec120a57a1665d257b0442784195d"}, + {file = "patchelf-0.17.2.1-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.musllinux_1_1_ppc64le.whl", hash = "sha256:f47b5bdd6885cfb20abdd14c707d26eb6f499a7f52e911865548d4aa43385502"}, + {file = "patchelf-0.17.2.1-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.musllinux_1_1_s390x.whl", hash = "sha256:a9e6ebb0874a11f7ed56d2380bfaa95f00612b23b15f896583da30c2059fcfa8"}, + {file = "patchelf-0.17.2.1-py2.py3-none-manylinux_2_5_i686.manylinux1_i686.musllinux_1_1_i686.whl", hash = "sha256:3c8d58f0e4c1929b1c7c45ba8da5a84a8f1aa6a82a46e1cfb2e44a4d40f350e5"}, + {file = "patchelf-0.17.2.1-py2.py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.musllinux_1_1_x86_64.whl", hash = "sha256:d1a9bc0d4fd80c038523ebdc451a1cce75237cfcc52dbd1aca224578001d5927"}, + {file = "patchelf-0.17.2.1.tar.gz", hash = "sha256:a6eb0dd452ce4127d0d5e1eb26515e39186fa609364274bc1b0b77539cfa7031"}, +] + +[package.extras] +test = ["importlib-metadata", "pytest"] + [[package]] name = "pathspec" version = "0.11.2" @@ -1091,4 +1110,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.8,<3.13" -content-hash = "42faee9d02ea5ad43eaef485f2127f0ffd77a5f8951ef71529eb1e85249e9c04" +content-hash = "39c905ee1d976c1ad0f898674b8212041bfbdf31e2d88a7f274e2c971f91d230" diff --git a/crates/voicevox_core_python_api/pyproject.toml b/crates/voicevox_core_python_api/pyproject.toml index 428e7695f..edbd472b2 100644 --- a/crates/voicevox_core_python_api/pyproject.toml +++ b/crates/voicevox_core_python_api/pyproject.toml @@ -1,5 +1,5 @@ [project] -name = "voicevox_core" +name = "voicevox" requires-python = ">=3.8" dependencies = ["pydantic>=2.5.2,<3"] description = "VOICEVOX CORE の Python バインディングです。" @@ -28,7 +28,7 @@ executionEnvironments = [{ root = "python/test" }, { root = "python" }] [tool.maturin] module-name = "voicevox_core._rust" bindings = "pyo3" -skip-auditwheel = true # Linuxでlibonnxruntime.so.*の不在を許してもらう +skip-auditwheel = false # Linuxでlibonnxruntime.so.*の不在を許してもらう python-source = "python" [tool.poetry] @@ -48,7 +48,8 @@ pydata-sphinx-theme = "0.14.1" sphinx-autoapi = "3.0.0" [tool.poetry.group.dev.dependencies] -maturin = "1.3.1" +maturin = "^1.3.2" +patchelf = {version = "^0.17.2.1", platform = "linux"} [tool.poetry.group.test.dependencies] pytest = "7.3.1"