Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requirements を Poetry で管理する #535

Merged
merged 17 commits into from Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -103,7 +103,7 @@ Pipfile.lock
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
poetry.lock
# poetry.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
Expand Down
19 changes: 13 additions & 6 deletions README.md
Expand Up @@ -441,14 +441,21 @@ LIBCORE_PATH="/path/to/libcore" \

### 更新

pip-tools を用いて依存ライブラリのバージョンを固定しています。
`requirements*.in`ファイルを修正後、以下のコマンドで更新できます。
Poetry を用いて依存ライブラリのバージョンを固定しています。
以下のコマンドで操作できます:
sarisia marked this conversation as resolved.
Show resolved Hide resolved

```bash
# pip>=22 の場合 pip-tools がエラーになります
pip-compile requirements.in # こちらを更新する場合は下2つも更新する必要があります。
pip-compile requirements-dev.in
pip-compile requirements-test.in
pipx install poetry # Poetry のインストール

sarisia marked this conversation as resolved.
Show resolved Hide resolved
poetry add package-name # ランタイム依存の追加
poetry add --group dev package-name # 開発依存の追加
poetry add --group test package-name # テスト依存の追加

poetry upgrade # 依存をまとめてアップグレード

poetry export --without-hashes -o requirements.txt
poetry export --without-hashes --with dev -o requirements-dev.txt
poetry export --without-hashes --with test -o requirements-test.txt
sarisia marked this conversation as resolved.
Show resolved Hide resolved
```

### ライセンス
Expand Down
1,688 changes: 1,688 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions pyproject.toml
Expand Up @@ -30,3 +30,48 @@ known_third_party = ["numpy"]
line_length = 88
multi_line_output = 3
use_parentheses = true

[tool.poetry]
name = "voicevox_engine"
version = "0.0.0"
description = ""
authors = ["Hiroshiba <hihokaruta@gmail.com>"]

[tool.poetry.dependencies]
python = "~3.8"
numpy = "^1.20.0"
fastapi = "^0.70.0"
python-multipart = "^0.0.5"
uvicorn = "^0.15.0"
aiofiles = "^0.7.0"
soundfile = "^0.10.3.post1"
scipy = "^1.7.1"
pyyaml = "^6.0"
pyworld = "^0.3.0"
appdirs = "^1.4.4"
requests = "^2.28.1"
jinja2 = "^3.1.2"
pyopenjtalk = {git = "https://github.com/VOICEVOX/pyopenjtalk", rev = "f4ade29ef9a4f43d8605103cb5bacc29e0b2ccae"}

[tool.poetry.group.dev]
optional = true

[tool.poetry.group.dev.dependencies]
cython = "^0.29.24"
pyinstaller = "^5.3"
pip-licenses = "^3.5.3"
pre-commit = "^2.16.0"
atomicwrites = "^1.4.0"
colorama = "^0.4.4"

[tool.poetry.group.test]
optional = true

[tool.poetry.group.test.dependencies]
pysen = {version = "~0", extras = ["lint"]}
pytest = "^6.2.5"
coveralls = "^3.2.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
10 changes: 0 additions & 10 deletions requirements-dev.in

This file was deleted.

191 changes: 52 additions & 139 deletions requirements-dev.txt
@@ -1,139 +1,52 @@
#
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# pip-compile requirements-dev.in
#
aiofiles==0.7.0
# via -r requirements.in
altgraph==0.17.2
# via pyinstaller
anyio==3.3.4
# via starlette
appdirs==1.4.4
# via -r requirements.in
asgiref==3.4.1
# via uvicorn
atomicwrites==1.4.0
# via -r requirements-dev.in
backports.entry-points-selectable==1.1.1
# via virtualenv
certifi==2022.6.15
# via requests
cffi==1.15.0
# via soundfile
cfgv==3.3.1
# via pre-commit
charset-normalizer==2.1.0
# via requests
click==8.0.3
# via
# pip-tools
# uvicorn
colorama==0.4.4
# via
# -r requirements-dev.in
# click
# tqdm
cython==0.29.24
# via
# -r requirements-dev.in
# pyopenjtalk
# pyworld
distlib==0.3.3
# via virtualenv
fastapi==0.70.0
# via -r requirements.in
filelock==3.4.0
# via virtualenv
future==0.18.2
# via pefile
h11==0.12.0
# via uvicorn
identify==2.4.0
# via pre-commit
idna==3.3
# via
# anyio
# requests
jinja2==3.1.2
# via -r requirements.in
markupsafe==2.1.1
# via jinja2
nodeenv==1.6.0
# via pre-commit
numpy==1.20.0
# via
# -r requirements.in
# pyopenjtalk
# pyworld
# scipy
pefile==2022.5.30
# via pyinstaller
pep517==0.12.0
# via pip-tools
pip-licenses==3.5.3
# via -r requirements-dev.in
pip-tools==6.4.0
# via -r requirements-dev.in
platformdirs==2.4.0
# via virtualenv
pre-commit==2.16.0
# via -r requirements-dev.in
ptable==0.9.2
# via pip-licenses
pycparser==2.20
# via cffi
pydantic==1.8.2
# via fastapi
pyinstaller==5.3
# via -r requirements-dev.in
pyinstaller-hooks-contrib==2022.8
# via pyinstaller
pyopenjtalk @ git+https://github.com/VOICEVOX/pyopenjtalk@f4ade29ef9a4f43d8605103cb5bacc29e0b2ccae
# via -r requirements.in
python-multipart==0.0.5
# via -r requirements.in
pywin32-ctypes==0.2.0
# via pyinstaller
pyworld==0.3.0
# via -r requirements.in
pyyaml==6.0
# via
# -r requirements.in
# pre-commit
requests==2.28.1
# via -r requirements.in
scipy==1.7.1
# via -r requirements.in
six==1.16.0
# via
# pyopenjtalk
# python-multipart
# virtualenv
sniffio==1.2.0
# via anyio
soundfile==0.10.3.post1
# via -r requirements.in
starlette==0.16.0
# via fastapi
toml==0.10.2
# via pre-commit
tomli==1.2.2
# via pep517
tqdm==4.62.3
# via pyopenjtalk
typing-extensions==3.10.0.2
# via pydantic
urllib3==1.26.11
# via requests
uvicorn==0.15.0
# via -r requirements.in
virtualenv==20.10.0
# via pre-commit
wheel==0.37.0
# via pip-tools

# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools
aiofiles==0.7.0 ; python_version >= "3.8" and python_version < "3.9"
altgraph==0.17.3 ; python_version >= "3.8" and python_version < "3.9"
anyio==3.6.2 ; python_version >= "3.8" and python_version < "3.9"
appdirs==1.4.4 ; python_version >= "3.8" and python_version < "3.9"
asgiref==3.6.0 ; python_version >= "3.8" and python_version < "3.9"
atomicwrites==1.4.0 ; python_version >= "3.8" and python_version < "3.9"
certifi==2022.12.7 ; python_version >= "3.8" and python_version < "3.9"
cffi==1.15.1 ; python_version >= "3.8" and python_version < "3.9"
cfgv==3.3.1 ; python_version >= "3.8" and python_version < "3.9"
charset-normalizer==2.1.1 ; python_version >= "3.8" and python_version < "3.9"
click==8.0.4 ; python_version >= "3.8" and python_version < "3.9"
colorama==0.4.4 ; python_version >= "3.8" and python_version < "3.9"
cython==0.29.24 ; python_version >= "3.8" and python_version < "3.9"
distlib==0.3.6 ; python_version >= "3.8" and python_version < "3.9"
fastapi==0.70.0 ; python_version >= "3.8" and python_version < "3.9"
filelock==3.8.2 ; python_version >= "3.8" and python_version < "3.9"
future==0.18.2 ; python_version >= "3.8" and python_version < "3.9" and sys_platform == "win32"
h11==0.14.0 ; python_version >= "3.8" and python_version < "3.9"
identify==2.5.11 ; python_version >= "3.8" and python_version < "3.9"
idna==3.4 ; python_version >= "3.8" and python_version < "3.9"
jinja2==3.1.2 ; python_version >= "3.8" and python_version < "3.9"
macholib==1.16.2 ; python_version >= "3.8" and python_version < "3.9" and sys_platform == "darwin"
markupsafe==2.1.1 ; python_version >= "3.8" and python_version < "3.9"
nodeenv==1.7.0 ; python_version >= "3.8" and python_version < "3.9"
numpy==1.20.0 ; python_version >= "3.8" and python_version < "3.9"
pefile==2022.5.30 ; python_version >= "3.8" and python_version < "3.9" and sys_platform == "win32"
pip-licenses==3.5.3 ; python_version >= "3.8" and python_version < "3.9"
platformdirs==2.4.0 ; python_version >= "3.8" and python_version < "3.9"
pre-commit==2.16.0 ; python_version >= "3.8" and python_version < "3.9"
ptable==0.9.2 ; python_version >= "3.8" and python_version < "3.9"
pycparser==2.21 ; python_version >= "3.8" and python_version < "3.9"
pydantic==1.10.2 ; python_version >= "3.8" and python_version < "3.9"
pyinstaller-hooks-contrib==2022.14 ; python_version >= "3.8" and python_version < "3.9"
pyinstaller==5.3 ; python_version >= "3.8" and python_version < "3.9"
pyopenjtalk @ git+https://github.com/VOICEVOX/pyopenjtalk@f4ade29ef9a4f43d8605103cb5bacc29e0b2ccae ; python_version >= "3.8" and python_version < "3.9"
python-multipart==0.0.5 ; python_version >= "3.8" and python_version < "3.9"
pywin32-ctypes==0.2.0 ; python_version >= "3.8" and python_version < "3.9" and sys_platform == "win32"
pyworld==0.3.0 ; python_version >= "3.8" and python_version < "3.9"
pyyaml==6.0 ; python_version >= "3.8" and python_version < "3.9"
requests==2.28.1 ; python_version >= "3.8" and python_version < "3.9"
scipy==1.7.1 ; python_version >= "3.8" and python_version < "3.9"
setuptools==65.6.3 ; python_version >= "3.8" and python_version < "3.9"
six==1.16.0 ; python_version >= "3.8" and python_version < "3.9"
sniffio==1.3.0 ; python_version >= "3.8" and python_version < "3.9"
soundfile==0.10.3.post1 ; python_version >= "3.8" and python_version < "3.9"
starlette==0.16.0 ; python_version >= "3.8" and python_version < "3.9"
toml==0.10.2 ; python_version >= "3.8" and python_version < "3.9"
tqdm==4.64.1 ; python_version >= "3.8" and python_version < "3.9"
typing-extensions==4.4.0 ; python_version >= "3.8" and python_version < "3.9"
urllib3==1.26.13 ; python_version >= "3.8" and python_version < "3.9"
uvicorn==0.15.0 ; python_version >= "3.8" and python_version < "3.9"
virtualenv==20.17.1 ; python_version >= "3.8" and python_version < "3.9"
4 changes: 0 additions & 4 deletions requirements-test.in

This file was deleted.