Skip to content

Commit

Permalink
追加: ビルド特化 poetry group build を作成 (VOICEVOX#1292)
Browse files Browse the repository at this point in the history
* add: `requirements-dev.txt` を新設

* fix: エクスポートミスを修正

* fix: コンフリクト

---------

Co-authored-by: Hiroshiba <[email protected]>
  • Loading branch information
tarepan and Hiroshiba authored May 27, 2024
1 parent c4f10e3 commit b1172bd
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-engine-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ jobs:
cache: pip

- name: <Setup> Install Python dependencies
run: pip install -r requirements-dev.txt
run: pip install -r requirements-build.txt

- name: <Setup> Prepare custom PyInstaller
if: startsWith(matrix.os, 'windows-')
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: pip install -r requirements-test.txt

- name: <Test> Check Python dependency security
run: safety check -r requirements.txt -r requirements-dev.txt -r requirements-test.txt -r requirements-license.txt -o bare
run: safety check -r requirements.txt -r requirements-dev.txt -r requirements-test.txt -r requirements-build.txt -r requirements-license.txt -o bare

- name: <Deploy> Notify Discord of security testing result
uses: sarisia/actions-status-discord@v1
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ jobs:
poetry export --without-hashes -o requirements.txt.check
poetry export --without-hashes --with dev -o requirements-dev.txt.check
poetry export --without-hashes --with test -o requirements-test.txt.check
poetry export --without-hashes --with build -o requirements-build.txt.check
poetry export --without-hashes --with license -o requirements-license.txt.check
diff -q requirements.txt requirements.txt.check || \
diff -q requirements-dev.txt requirements-dev.txt.check || \
diff -q requirements-test.txt requirements-test.txt.check || \
diff -q requirements-build.txt requirements-build.txt.check || \
diff -q requirements-license.txt requirements-license.txt.check > /dev/null
if [ $? = 1 ]; then
echo "poetry export has some diff"
Expand Down
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ repos:
language: python
stages: [push]
pass_filenames: false
- id: poetry-export-build
name: poetry-export-build
entry: poetry export --without-hashes --with build -o requirements-build.txt
language: python
stages: [push]
pass_filenames: false
- id: poetry-export-license
name: poetry-export-license
entry: poetry export --without-hashes --with license -o requirements-license.txt
Expand Down
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ cd ./voicevox_engine
git switch -c "<your_branch_name>"

# 実行・開発・テスト環境のインストール
python -m pip install -r requirements.txt -r requirements-dev.txt -r requirements-test.txt
python -m pip install -r requirements.txt -r requirements-dev.txt -r requirements-test.txt -r requirements-build.txt
```

<!-- このプロジェクトでは
Expand Down Expand Up @@ -203,6 +203,7 @@ PYTHONPATH=. python build_util/make_docs.py
poetry add `パッケージ名`
poetry add --group dev `パッケージ名` # 開発依存の追加
poetry add --group test `パッケージ名` # テスト依存の追加
poetry add --group build `パッケージ名` # ビルド依存の追加
```

パッケージをアップデートする場合
Expand All @@ -218,6 +219,7 @@ requirements.txt の更新
poetry export --without-hashes -o requirements.txt # こちらを更新する場合は下3つも更新する必要があります。
poetry export --without-hashes --with dev -o requirements-dev.txt
poetry export --without-hashes --with test -o requirements-test.txt
poetry export --without-hashes --with build -o requirements-build.txt
poetry export --without-hashes --with license -o requirements-license.txt
```

Expand All @@ -235,7 +237,7 @@ poetry export --without-hashes --with license -o requirements-license.txt
以下のコマンドにより脆弱性を診断できます:

```bash
safety check -r requirements.txt -r requirements-dev.txt -r requirements-test.txt -r requirements-license.txt
safety check -r requirements.txt -r requirements-dev.txt -r requirements-test.txt -r requirements-build.txt -r requirements-license.txt
```

### API ドキュメントの確認
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,8 @@ Issue 側で取り組み始めたことを伝えるか、最初に Draft プル
# 実行環境のインストール
python -m pip install -r requirements.txt

# 開発環境・テスト環境のインストール
python -m pip install -r requirements-dev.txt -r requirements-test.txt
# 開発環境・テスト環境・ビルド環境のインストール
python -m pip install -r requirements-dev.txt -r requirements-test.txt -r requirements-build.txt
```
### 実行
Expand Down Expand Up @@ -569,7 +569,7 @@ DYLD_LIBRARY_PATH="/path/to/onnx" python run.py --voicelib_dir="/path/to/voicevo
また、GPU で利用するには cuDNN や CUDA、DirectML などのライブラリが追加で必要となります。

```bash
python -m pip install -r requirements-dev.txt
python -m pip install -r requirements-build.txt
OUTPUT_LICENSE_JSON_PATH=licenses.json \
bash build_util/create_venv_and_generate_licenses.bash
Expand Down Expand Up @@ -642,6 +642,7 @@ typos
poetry add `パッケージ名`
poetry add --group dev `パッケージ名` # 開発依存の追加
poetry add --group test `パッケージ名` # テスト依存の追加
poetry add --group build `パッケージ名` # ビルド依存の追加
# パッケージをアップデートする場合
poetry update `パッケージ名`
Expand All @@ -651,6 +652,7 @@ poetry update # 全部更新
poetry export --without-hashes -o requirements.txt # こちらを更新する場合は下3つも更新する必要があります。
poetry export --without-hashes --with dev -o requirements-dev.txt
poetry export --without-hashes --with test -o requirements-test.txt
poetry export --without-hashes --with build -o requirements-build.txt
poetry export --without-hashes --with license -o requirements-license.txt
```

Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

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

4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ pydantic = "^1.10.15"
starlette = "^0.37.0"

[tool.poetry.group.dev.dependencies]
pyinstaller = "^5.13"
pre-commit = "^2.16.0"
poetry = "1.8.2"
poetry-plugin-export = "^1.8.0"
Expand All @@ -78,6 +77,9 @@ syrupy = "^4.6.1"
types-pyyaml = "^6.0.12"
safety = "^3.1.0"

[tool.poetry.group.build.dependencies]
pyinstaller = "^5.13"

[tool.poetry.group.license.dependencies]
pip-licenses = "^4.4.0"

Expand Down
35 changes: 35 additions & 0 deletions requirements-build.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
altgraph==0.17.4 ; python_version >= "3.11" and python_version < "3.12"
anyio==4.3.0 ; python_version >= "3.11" and python_version < "3.12"
cffi==1.16.0 ; python_version >= "3.11" and python_version < "3.12"
click==8.1.7 ; python_version >= "3.11" and python_version < "3.12"
colorama==0.4.6 ; python_version >= "3.11" and python_version < "3.12" and platform_system == "Windows"
cython==3.0.10 ; python_version >= "3.11" and python_version < "3.12"
fastapi-slim==0.111.0 ; python_version >= "3.11" and python_version < "3.12"
h11==0.14.0 ; python_version >= "3.11" and python_version < "3.12"
idna==3.7 ; python_version >= "3.11" and python_version < "3.12"
jinja2==3.1.4 ; python_version >= "3.11" and python_version < "3.12"
macholib==1.16.3 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "darwin"
markupsafe==2.1.5 ; python_version >= "3.11" and python_version < "3.12"
numpy==1.26.4 ; python_version >= "3.11" and python_version < "3.12"
packaging==24.0 ; python_version >= "3.11" and python_version < "3.12"
pefile==2023.2.7 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "win32"
platformdirs==4.2.2 ; python_version >= "3.11" and python_version < "3.12"
pycparser==2.22 ; python_version >= "3.11" and python_version < "3.12"
pydantic==1.10.15 ; python_version >= "3.11" and python_version < "3.12"
pyinstaller-hooks-contrib==2024.6 ; python_version >= "3.11" and python_version < "3.12"
pyinstaller==5.13.2 ; python_version >= "3.11" and python_version < "3.12"
pyopenjtalk @ git+https://github.com/VOICEVOX/pyopenjtalk@b35fc89fe42948a28e33aed886ea145a51113f88 ; python_version >= "3.11" and python_version < "3.12"
python-multipart==0.0.9 ; python_version >= "3.11" and python_version < "3.12"
pywin32-ctypes==0.2.2 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "win32"
pyworld==0.3.4 ; python_version >= "3.11" and python_version < "3.12"
pyyaml==6.0.1 ; python_version >= "3.11" and python_version < "3.12"
semver==3.0.2 ; python_version >= "3.11" and python_version < "3.12"
setuptools==69.5.1 ; python_version >= "3.11" and python_version < "3.12"
six==1.16.0 ; python_version >= "3.11" and python_version < "3.12"
sniffio==1.3.1 ; python_version >= "3.11" and python_version < "3.12"
soundfile==0.12.1 ; python_version >= "3.11" and python_version < "3.12"
soxr==0.3.7 ; python_version >= "3.11" and python_version < "3.12"
starlette==0.37.2 ; python_version >= "3.11" and python_version < "3.12"
tqdm==4.66.4 ; python_version >= "3.11" and python_version < "3.12"
typing-extensions==4.11.0 ; python_version >= "3.11" and python_version < "3.12"
uvicorn==0.29.0 ; python_version >= "3.11" and python_version < "3.12"
5 changes: 0 additions & 5 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
altgraph==0.17.4 ; python_version >= "3.11" and python_version < "3.12"
anyio==4.3.0 ; python_version >= "3.11" and python_version < "3.12"
build==1.2.1 ; python_version >= "3.11" and python_version < "3.12"
cachecontrol[filecache]==0.14.0 ; python_version >= "3.11" and python_version < "3.12"
Expand Down Expand Up @@ -26,14 +25,12 @@ jaraco-classes==3.4.0 ; python_version >= "3.11" and python_version < "3.12"
jeepney==0.8.0 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "linux"
jinja2==3.1.4 ; python_version >= "3.11" and python_version < "3.12"
keyring==24.3.1 ; python_version >= "3.11" and python_version < "3.12"
macholib==1.16.3 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "darwin"
markupsafe==2.1.5 ; python_version >= "3.11" and python_version < "3.12"
more-itertools==10.2.0 ; python_version >= "3.11" and python_version < "3.12"
msgpack==1.0.8 ; python_version >= "3.11" and python_version < "3.12"
nodeenv==1.8.0 ; python_version >= "3.11" and python_version < "3.12"
numpy==1.26.4 ; python_version >= "3.11" and python_version < "3.12"
packaging==24.0 ; python_version >= "3.11" and python_version < "3.12"
pefile==2023.2.7 ; python_version >= "3.11" and python_version < "3.12" and sys_platform == "win32"
pexpect==4.9.0 ; python_version >= "3.11" and python_version < "3.12"
pkginfo==1.10.0 ; python_version >= "3.11" and python_version < "3.12"
platformdirs==4.2.2 ; python_version >= "3.11" and python_version < "3.12"
Expand All @@ -44,8 +41,6 @@ pre-commit==2.21.0 ; python_version >= "3.11" and python_version < "3.12"
ptyprocess==0.7.0 ; python_version >= "3.11" and python_version < "3.12"
pycparser==2.22 ; python_version >= "3.11" and python_version < "3.12"
pydantic==1.10.15 ; python_version >= "3.11" and python_version < "3.12"
pyinstaller-hooks-contrib==2024.6 ; python_version >= "3.11" and python_version < "3.12"
pyinstaller==5.13.2 ; python_version >= "3.11" and python_version < "3.12"
pyopenjtalk @ git+https://github.com/VOICEVOX/pyopenjtalk@b35fc89fe42948a28e33aed886ea145a51113f88 ; python_version >= "3.11" and python_version < "3.12"
pyproject-hooks==1.1.0 ; python_version >= "3.11" and python_version < "3.12"
python-multipart==0.0.9 ; python_version >= "3.11" and python_version < "3.12"
Expand Down

0 comments on commit b1172bd

Please sign in to comment.