diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 88715309e..7846441e7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -398,7 +398,8 @@ jobs: - name: Generate licenses.json shell: bash run: | - python generate_licenses.py > engine_manifest_assets/dependency_licenses.json + OUTPUT_LICENSE_JSON_PATH=engine_manifest_assets/dependency_licenses.json \ + bash build_util/create_venv_and_generate_licenses.bash # FIXME: VOICEVOX (editor) cannot build without licenses.json cp engine_manifest_assets/dependency_licenses.json licenses.json diff --git a/README.md b/README.md index 3e1f75643..85627425c 100644 --- a/README.md +++ b/README.md @@ -456,9 +456,10 @@ poetry update `パッケージ名` poetry update # 全部更新 # requirements.txtの更新 -poetry export --without-hashes -o requirements.txt # こちらを更新する場合は下2つも更新する必要があります。 +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 license -o requirements-license.txt ``` ### ライセンス diff --git a/build_util/codesign.bash b/build_util/codesign.bash index 72ea0f5b5..f8f79f99c 100644 --- a/build_util/codesign.bash +++ b/build_util/codesign.bash @@ -2,11 +2,11 @@ set -eu -if [ -v "${CERT_BASE64}" ]; then +if [ ! -v CERT_BASE64 ]; then echo "CERT_BASE64が未定義です" exit 1 fi -if [ -v "${CERT_PASSWORD}" ]; then +if [ ! -v CERT_PASSWORD ]; then echo "CERT_PASSWORDが未定義です" exit 1 fi diff --git a/build_util/create_venv_and_generate_licenses.bash b/build_util/create_venv_and_generate_licenses.bash new file mode 100644 index 000000000..e3293f078 --- /dev/null +++ b/build_util/create_venv_and_generate_licenses.bash @@ -0,0 +1,20 @@ +# 仮想環境を作ってrequirements.txtをインストールし、ライセンス一覧を生成する + +set -eux + +if [ ! -v OUTPUT_LICENSE_JSON_PATH ]; then + echo "OUTPUT_LICENSE_JSON_PATHが未定義です" + exit 1 +fi + +VENV_PATH="licenses_venv" + +python -m venv $VENV_PATH +source $VENV_PATH/bin/activate + +pip install -r requirements-license.txt +python generate_licenses.py >$OUTPUT_LICENSE_JSON_PATH + +deactivate + +rm -rf $VENV_PATH diff --git a/build_util/process_voicevox_resource.bash b/build_util/process_voicevox_resource.bash index 7f95e6fcc..dcf8b2303 100644 --- a/build_util/process_voicevox_resource.bash +++ b/build_util/process_voicevox_resource.bash @@ -1,6 +1,6 @@ set -eux -if [ -v "${DOWNLOAD_RESOURCE_PATH}" ]; then +if [ ! -v DOWNLOAD_RESOURCE_PATH ]; then echo "DOWNLOAD_RESOURCE_PATHが未定義です" exit 1 fi diff --git a/poetry.lock b/poetry.lock index 7a3fbda23..e1df2115e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2529,4 +2529,4 @@ testing = ["flake8 (<5)", "func-timeout", "jaraco.functools", "jaraco.itertools" [metadata] lock-version = "2.0" python-versions = "~3.8" -content-hash = "e365a537798b7d41f813c38a7398dd4cdac74c88461b00097efbe7e921caa85b" +content-hash = "e4a1cfc336b0406d1779f3027d65187e74982c9ac329c784410584da97e55227" diff --git a/pyproject.toml b/pyproject.toml index dc12ee79a..a3ea308a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,6 @@ pyopenjtalk = {git = "https://github.com/VOICEVOX/pyopenjtalk", rev = "f4ade29ef [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" @@ -67,6 +66,12 @@ pysen = {version = "~0", extras = ["lint"]} pytest = "^6.2.5" coveralls = "^3.2.0" +[tool.poetry.group.license] +optional = true + +[tool.poetry.group.license.dependencies] +pip-licenses = "^3.5.3" + [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" diff --git a/requirements-dev.txt b/requirements-dev.txt index eef7710c5..529e0235c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -42,7 +42,6 @@ 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" @@ -50,7 +49,6 @@ 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" diff --git a/requirements-license.txt b/requirements-license.txt new file mode 100644 index 000000000..cbf29e014 --- /dev/null +++ b/requirements-license.txt @@ -0,0 +1,34 @@ +aiofiles==0.7.0 ; 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" +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" +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" and platform_system == "Windows" +cython==0.29.24 ; python_version >= "3.8" and python_version < "3.9" +fastapi==0.70.0 ; python_version >= "3.8" and python_version < "3.9" +h11==0.14.0 ; 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" +markupsafe==2.1.1 ; python_version >= "3.8" and python_version < "3.9" +numpy==1.20.0 ; python_version >= "3.8" and python_version < "3.9" +pip-licenses==3.5.5 ; 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" +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" +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" +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" +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"