diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 80a7f807c..72dc377e4 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -278,6 +278,11 @@ jobs: poetry config virtualenvs.create false (cd crates/voicevox_core_python_api && poetry install --with dev) function build() { + # shellcheck disable=SC2251 + ! grep -q dev-dependencies ./crates/voicevox_core_python_api/Cargo.toml + # 以下のようなことを防止するため、依存クレートはMaturinの外でビルドしておく + # https://github.com/VOICEVOX/voicevox_core/issues/653#issuecomment-1782108410 + cargo build -p voicevox_core_python_api --features ${{ matrix.features }}, --target ${{ matrix.target }} --release -vv maturin build --manifest-path ./crates/voicevox_core_python_api/Cargo.toml --features ${{ matrix.features }}, --target ${{ matrix.target }} --release } if ${{ !inputs.is_production }}; then diff --git a/.github/workflows/generate_document.yml b/.github/workflows/generate_document.yml index 9a2328cfc..02e138425 100644 --- a/.github/workflows/generate_document.yml +++ b/.github/workflows/generate_document.yml @@ -47,7 +47,9 @@ jobs: working-directory: "docs/apis/c_api/doxygen" - name: Build voicevox_core_python_api run: | - cargo build -p voicevox_core_c_api -vv + # 以下のようなことを防止するため、依存クレートはMaturinの外でビルドしておく + # https://github.com/VOICEVOX/voicevox_core/issues/653#issuecomment-1782108410 + cargo build -p voicevox_core_python_api -vv maturin develop --manifest-path ./crates/voicevox_core_python_api/Cargo.toml --locked - name: Generate Sphinx document run: sphinx-build docs/apis/python_api public/apis/python_api diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 75b2b859f..229d43790 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -275,6 +275,9 @@ jobs: pip install --upgrade poetry poetry install --with dev --with test - run: cargo build -p test_util -vv # build scriptにより/crates/test_util/data/の生成 + # 以下のようなことを防止するため、依存クレートはMaturinの外でビルドしておく + # https://github.com/VOICEVOX/voicevox_core/issues/653#issuecomment-1782108410 + - run: poetry run -- cargo build -p voicevox_core_python_api -vv - run: poetry run maturin build --locked - run: poetry run maturin develop --locked - name: 必要なDLLをコピーしてpytestを実行 diff --git a/crates/voicevox_core_python_api/Cargo.toml b/crates/voicevox_core_python_api/Cargo.toml index 89cd229d5..15547629e 100644 --- a/crates/voicevox_core_python_api/Cargo.toml +++ b/crates/voicevox_core_python_api/Cargo.toml @@ -4,10 +4,6 @@ version = "0.0.0" edition.workspace = true publish.workspace = true -[package.metadata.maturin] -name = "voicevox_core._rust" -python-source = "python" - [lib] crate-type = ["cdylib"] diff --git a/crates/voicevox_core_python_api/poetry.lock b/crates/voicevox_core_python_api/poetry.lock index 64d3c4561..df5f580ed 100644 --- a/crates/voicevox_core_python_api/poetry.lock +++ b/crates/voicevox_core_python_api/poetry.lock @@ -451,23 +451,24 @@ files = [ [[package]] name = "maturin" -version = "0.13.7" +version = "1.3.1" 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-0.13.7-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:bc58b0266a4c124f9afd69a987ac324ff35c0d963b41073ed64a32f94c226d5a"}, - {file = "maturin-0.13.7-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:424d53adc9684167cf89829275fe5072331a197de0ac08e7a893f9283c7df213"}, - {file = "maturin-0.13.7-py3-none-manylinux_2_12_i686.manylinux2010_i686.musllinux_1_1_i686.whl", hash = "sha256:3137876c338eb7e551ba44a609b5f02d02454d1b3a8677ad6bf2121c5a92b2b7"}, - {file = "maturin-0.13.7-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.musllinux_1_1_x86_64.whl", hash = "sha256:a96f1b3ede71c0f76b8c7cfac18a9eec90174bdf434fa9aeff491be9a7ca5179"}, - {file = "maturin-0.13.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:0b6ac1219a809155057fd1f358f7ece03c3abd2e2991832ce5146825a9fa4160"}, - {file = "maturin-0.13.7-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.musllinux_1_1_armv7l.whl", hash = "sha256:3c36f429adc3a8af8de9838399750742a86053f0031a953b48ee92932120dc0c"}, - {file = "maturin-0.13.7-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.musllinux_1_1_ppc64le.whl", hash = "sha256:bb3a2830d64ae6a324571f694475b91111e827bc0ccc60a0c47f4fb596a46bd8"}, - {file = "maturin-0.13.7-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:794f58d3103449f8cd8ab5f36fd05c31b8d8de3643cd0e3720fd5dc3c328dd5c"}, - {file = "maturin-0.13.7-py3-none-win32.whl", hash = "sha256:63586eb286866264ec62d29df6ab955360de6226128f67d14623ffe1a12d4963"}, - {file = "maturin-0.13.7-py3-none-win_amd64.whl", hash = "sha256:f50d62aca567fdbbb929771794f3c5c78048ef0efa4af7d83ed472a8b8d26454"}, - {file = "maturin-0.13.7-py3-none-win_arm64.whl", hash = "sha256:8c6225e7eba2885a0cd82a6cf898e74bb720796a5744e0450f3b1340d1ca97af"}, - {file = "maturin-0.13.7.tar.gz", hash = "sha256:c0a77aa0c57f945649ca711c806203a1b6888ad49c2b8b85196ffdcf0421db77"}, + {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"}, ] [package.dependencies] @@ -475,7 +476,7 @@ tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} [package.extras] patchelf = ["patchelf"] -zig = ["ziglang (>=0.9.0,<0.10.0)"] +zig = ["ziglang (>=0.10.0,<0.11.0)"] [[package]] name = "mypy-extensions" @@ -991,4 +992,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.8,<3.13" -content-hash = "1df8e3a1b5c0e3b221a0ffee223e32c042e79977d9e7210116555d084d948588" +content-hash = "775d436e43d6da637cdc673b8509d4acfb7673fbf5a87153c732d4cfbc0628c3" diff --git a/crates/voicevox_core_python_api/pyproject.toml b/crates/voicevox_core_python_api/pyproject.toml index e95777b72..3164bc528 100644 --- a/crates/voicevox_core_python_api/pyproject.toml +++ b/crates/voicevox_core_python_api/pyproject.toml @@ -16,15 +16,17 @@ classifiers = [ # readme = "README.md" [build-system] -requires = ["maturin>=0.13.2,<0.14"] +requires = ["maturin>=1.3.1,<2"] build-backend = "maturin" [tool.isort] profile = "black" [tool.maturin] +module-name = "voicevox_core._rust" bindings = "pyo3" skip-auditwheel = true # Linuxでlibonnxruntime.so.*の不在を許してもらう +python-source = "python" [tool.poetry] # Poetryはこれがないと動かない @@ -43,7 +45,7 @@ pydata-sphinx-theme = "0.14.1" sphinx-autoapi = "3.0.0" [tool.poetry.group.dev.dependencies] -maturin = "0.13.7" +maturin = "1.3.1" [tool.poetry.group.test.dependencies] pytest = "7.3.1"