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 all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
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
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -441,14 +441,23 @@ LIBCORE_PATH="/path/to/libcore" \

### 更新

pip-tools を用いて依存ライブラリのバージョンを固定しています。
`requirements*.in`ファイルを修正後、以下のコマンドで更新できます。
[Poetry](https://python-poetry.org/) を用いて依存ライブラリのバージョンを固定しています。
以下のコマンドで操作できます:

```bash
# pip>=22 の場合 pip-tools がエラーになります
pip-compile requirements.in # こちらを更新する場合は下2つも更新する必要があります。
pip-compile requirements-dev.in
pip-compile requirements-test.in
# パッケージを追加する場合
poetry add `パッケージ名`
poetry add --group dev `パッケージ名` # 開発依存の追加
poetry add --group test `パッケージ名` # テスト依存の追加

# パッケージをアップデートする場合
poetry update `パッケージ名`
poetry update # 全部更新
sarisia marked this conversation as resolved.
Show resolved Hide resolved

# requirements.txtの更新
poetry export --without-hashes -o requirements.txt # こちらを更新する場合は下2つも更新する必要があります。
poetry export --without-hashes --with dev -o requirements-dev.txt
poetry export --without-hashes --with test -o requirements-test.txt
```

### ライセンス
Expand Down
20 changes: 20 additions & 0 deletions generate_licenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,26 @@ def generate_licenses() -> List[License]:
"https://bitbucket.org/pypa/distlib/raw/7d93712134b28401407da27382f2b6236c87623a/LICENSE.txt" # noqa: B950
) as res:
license.text = res.read().decode()
elif license.name.lower() == "jsonschema":
with urllib.request.urlopen(
"https://raw.githubusercontent.com/python-jsonschema/jsonschema/dbc398245a583cb2366795dc529ae042d10c1577/COPYING"
) as res:
license.text = res.read().decode()
elif license.name.lower() == "lockfile":
with urllib.request.urlopen(
"https://opendev.org/openstack/pylockfile/raw/tag/0.12.2/LICENSE"
) as res:
license.text = res.read().decode()
elif license.name.lower() == "platformdirs":
with urllib.request.urlopen(
"https://raw.githubusercontent.com/platformdirs/platformdirs/aa671aaa97913c7b948567f4d9c77d4f98bfa134/LICENSE"
) as res:
license.text = res.read().decode()
elif license.name.lower() == "webencodings":
with urllib.request.urlopen(
"https://raw.githubusercontent.com/gsnedders/python-webencodings/fa2cb5d75ab41e63ace691bc0825d3432ba7d694/LICENSE"
) as res:
license.text = res.read().decode()
else:
# ライセンスがpypiに無い
raise Exception(f"No License info provided for {license.name}")
Expand Down
2,532 changes: 2,532 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,43 @@ 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.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"
poetry = "^1.3.1"

[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.

226 changes: 87 additions & 139 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,139 +1,87 @@
#
# 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"
attrs==22.2.0 ; python_version >= "3.8" and python_version < "3.9"
cachecontrol[filecache]==0.12.11 ; 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"
cleo==2.0.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"
crashtest==0.4.1 ; python_version >= "3.8" and python_version < "3.9"
cryptography==39.0.0 ; python_version >= "3.8" and python_version < "3.9" and sys_platform == "linux"
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"
dulwich==0.20.50 ; 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"
html5lib==1.1 ; 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"
importlib-metadata==4.13.0 ; python_version >= "3.8" and python_version < "3.9"
importlib-resources==5.10.2 ; python_version >= "3.8" and python_version < "3.9"
jaraco-classes==3.2.3 ; python_version >= "3.8" and python_version < "3.9"
jeepney==0.8.0 ; python_version >= "3.8" and python_version < "3.9" and sys_platform == "linux"
jinja2==3.1.2 ; python_version >= "3.8" and python_version < "3.9"
jsonschema==4.17.3 ; python_version >= "3.8" and python_version < "3.9"
keyring==23.13.1 ; python_version >= "3.8" and python_version < "3.9"
lockfile==0.12.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"
more-itertools==9.0.0 ; python_version >= "3.8" and python_version < "3.9"
msgpack==1.0.4 ; 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"
packaging==22.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"
pexpect==4.8.0 ; python_version >= "3.8" and python_version < "3.9"
pip-licenses==3.5.5 ; python_version >= "3.8" and python_version < "3.9"
pkginfo==1.9.4 ; python_version >= "3.8" and python_version < "3.9"
pkgutil-resolve-name==1.3.10 ; python_version >= "3.8" and python_version < "3.9"
platformdirs==2.6.2 ; python_version >= "3.8" and python_version < "3.9"
poetry-core==1.4.0 ; python_version >= "3.8" and python_version < "3.9"
poetry-plugin-export==1.2.0 ; python_version >= "3.8" and python_version < "3.9"
poetry==1.3.1 ; 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"
ptyprocess==0.7.0 ; 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"
pyrsistent==0.19.3 ; 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"
rapidfuzz==2.13.7 ; python_version >= "3.8" and python_version < "3.9"
requests-toolbelt==0.10.1 ; 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"
secretstorage==3.3.3 ; python_version >= "3.8" and python_version < "3.9" and sys_platform == "linux"
setuptools==65.6.3 ; python_version >= "3.8" and python_version < "3.9"
shellingham==1.5.0.post1 ; 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"
tomli==2.0.1 ; python_version >= "3.8" and python_version < "3.9"
tomlkit==0.11.6 ; python_version >= "3.8" and python_version < "3.9"
tqdm==4.64.1 ; python_version >= "3.8" and python_version < "3.9"
trove-classifiers==2022.12.22 ; 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"
webencodings==0.5.1 ; python_version >= "3.8" and python_version < "3.9"
xattr==0.10.1 ; python_version >= "3.8" and python_version < "3.9" and sys_platform == "darwin"
zipp==3.11.0 ; python_version >= "3.8" and python_version < "3.9"
4 changes: 0 additions & 4 deletions requirements-test.in

This file was deleted.

Loading