Skip to content

Commit

Permalink
Maturinをv1.3.1に
Browse files Browse the repository at this point in the history
  • Loading branch information
qryxip committed Oct 27, 2023
1 parent d252b81 commit 61730d8
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 22 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/generate_document.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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を実行
Expand Down
4 changes: 0 additions & 4 deletions crates/voicevox_core_python_api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
31 changes: 16 additions & 15 deletions crates/voicevox_core_python_api/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions crates/voicevox_core_python_api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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はこれがないと動かない
Expand All @@ -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"
Expand Down

0 comments on commit 61730d8

Please sign in to comment.