From 5eae9c5c3838ea158eeb5c79f9a0c2383f893b14 Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Fri, 3 Jan 2025 18:05:23 +0900 Subject: [PATCH] =?UTF-8?q?remove!:=20`requires-python`=E3=82=92`>=3D3.10`?= =?UTF-8?q?=E3=81=AB=E5=BC=95=E3=81=8D=E4=B8=8A=E3=81=92=E3=82=8B=20(#915)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `requires-python`を`>=3.10`に引き上げた上、 #873 の解決を確認する。 Python 3.9, 3.10の機能を使うことは別PRで行う。 Resolves: #873 --- .github/workflows/build_and_deploy.yml | 4 +- .github/workflows/generate_document.yml | 2 +- .github/workflows/python_lint.yml | 2 +- .github/workflows/test.yml | 28 +++++-- crates/voicevox_core_python_api/README.md | 2 +- crates/voicevox_core_python_api/poetry.lock | 78 +------------------ .../voicevox_core_python_api/pyproject.toml | 4 +- example/python/README.md | 2 +- 8 files changed, 31 insertions(+), 91 deletions(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 2bb1f7e88..2efc314d6 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -182,11 +182,11 @@ jobs: git fetch private refs/tags/${{ env.PRODUCTION_REPOSITORY_TAG }} git -c user.name=dummy -c user.email=dummy@dummy.dummy merge FETCH_HEAD ) > /dev/null 2>&1 - - name: Set up Python 3.8 + - name: Set up Python 3.10 if: matrix.python_whl uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.10" architecture: ${{ contains(matrix.artifact_name,'x86') && 'x86' || 'x64' }} - name: set up ${{ matrix.target }} uses: ./.github/actions/rust-toolchain-from-file diff --git a/.github/workflows/generate_document.yml b/.github/workflows/generate_document.yml index 67561b392..c0d3e9d58 100644 --- a/.github/workflows/generate_document.yml +++ b/.github/workflows/generate_document.yml @@ -33,7 +33,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.10" - name: Setup Java uses: actions/setup-java@v4 with: diff --git a/.github/workflows/python_lint.yml b/.github/workflows/python_lint.yml index 486119e2c..13a60c655 100644 --- a/.github/workflows/python_lint.yml +++ b/.github/workflows/python_lint.yml @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.10" - name: Install Poetry run: | python -m pip install --upgrade poetry diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 96018a7ef..d1d141990 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,10 +39,10 @@ jobs: run: | sudo apt-get update sudo apt-get install -y shellcheck - - name: Set up Python 3.8 + - name: Set up Python 3.10 uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.10" - name: Install Pyflakes run: pip install 'pyflakes>3,<4' - name: actionlint @@ -67,10 +67,10 @@ jobs: uses: ./.github/actions/rust-toolchain-from-file with: components: clippy,rustfmt - - name: Set up Python 3.8 + - name: Set up Python 3.10 uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.10" - uses: Swatinem/rust-cache@v2 - run: cargo clippy -v --tests -- -D clippy::all -D warnings --no-deps - run: cargo clippy -v -- -D clippy::all -D warnings --no-deps @@ -125,10 +125,10 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - name: Set up Python 3.8 + - name: Set up Python 3.10 uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.10" - name: Set up Rust uses: ./.github/actions/rust-toolchain-from-file - uses: Swatinem/rust-cache@v2 @@ -272,10 +272,10 @@ jobs: working-directory: ./crates/voicevox_core_python_api steps: - uses: actions/checkout@v4 - - name: Set up Python 3.8 + - name: Set up Python 3.10 uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.10" - name: Set up Rust uses: ./.github/actions/rust-toolchain-from-file - run: | @@ -296,6 +296,18 @@ jobs: for file in ../../example/python/run{,-asyncio}.py; do poetry run python "$file" ../test_util/data/model/sample.vvm --dict-dir ../test_util/data/open_jtalk_dic_utf_8-1.11 done + # https://github.com/VOICEVOX/voicevox_core/issues/873 が再発しないかの確認。 + # + # Python 3.8においては、プロセスの終了までにFatal Python errorに至らなくても`StopIteration`までは達することが多い。 + # #873の要因は依然として不明であるが、`StopIteration`が出ないことの確認をもって#873の解決とすることにする。 + # + # TODO: 10回の実行におよそ60秒ほどかかるため、状況の経過を見てやめる。 + for _ in {1..10}; do + poetry run python ../../example/python/run-asyncio.py ../test_util/data/model/sample.vvm --dict-dir ../test_util/data/open_jtalk_dic_utf_8-1.11 \ + 2> >(tee ./stderr.txt >&2) + # shellcheck disable=SC2059 + ! grep -q StopIteration ./stderr.txt + done build-and-test-java-api: strategy: fail-fast: false diff --git a/crates/voicevox_core_python_api/README.md b/crates/voicevox_core_python_api/README.md index 11295410d..fe8745da8 100644 --- a/crates/voicevox_core_python_api/README.md +++ b/crates/voicevox_core_python_api/README.md @@ -7,7 +7,7 @@ VOICEVOX CORE の Python バインディングです。 以下の環境が必要です。 - Rustup -- Python ≧ 3.8 +- Python ≧ 3.10 - Poetry ≧ 1.6 ```console diff --git a/crates/voicevox_core_python_api/poetry.lock b/crates/voicevox_core_python_api/poetry.lock index f98bf859d..b70ce212c 100644 --- a/crates/voicevox_core_python_api/poetry.lock +++ b/crates/voicevox_core_python_api/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand. [[package]] name = "accessible-pygments" @@ -36,9 +36,6 @@ files = [ {file = "annotated_types-0.6.0.tar.gz", hash = "sha256:563339e807e53ffd9c267e99fc6d9ea23eb8443c08f112651963e24e22f84a5d"}, ] -[package.dependencies] -typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} - [[package]] name = "astroid" version = "3.0.1" @@ -64,9 +61,6 @@ files = [ {file = "Babel-2.13.0.tar.gz", hash = "sha256:04c3e2d28d2b7681644508f836be388ae49e0cfe91465095340395b60d00f210"}, ] -[package.dependencies] -pytz = {version = ">=2015.7", markers = "python_version < \"3.9\""} - [package.extras] dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] @@ -129,7 +123,6 @@ packaging = ">=22.0" pathspec = ">=0.9.0" platformdirs = ">=2" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""} [package.extras] colorama = ["colorama (>=0.4.3)"] @@ -319,25 +312,6 @@ files = [ {file = "imagesize-1.4.1.tar.gz", hash = "sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a"}, ] -[[package]] -name = "importlib-metadata" -version = "6.8.0" -description = "Read metadata from Python packages" -optional = false -python-versions = ">=3.8" -files = [ - {file = "importlib_metadata-6.8.0-py3-none-any.whl", hash = "sha256:3ebb78df84a805d7698245025b975d9d67053cd94c79245ba4b3eb694abe68bb"}, - {file = "importlib_metadata-6.8.0.tar.gz", hash = "sha256:dbace7892d8c0c4ac1ad096662232f831d4e64f4c4545bd53016a3e9d4654743"}, -] - -[package.dependencies] -zipp = ">=0.5" - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -perf = ["ipython"] -testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)", "pytest-ruff"] - [[package]] name = "iniconfig" version = "2.0.0" @@ -743,17 +717,6 @@ pytest = ">=7.0.0" docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"] testing = ["coverage (>=6.2)", "flaky (>=3.5.0)", "hypothesis (>=5.7.1)", "mypy (>=0.931)", "pytest-trio (>=0.7.0)"] -[[package]] -name = "pytz" -version = "2023.3.post1" -description = "World timezone definitions, modern and historical" -optional = false -python-versions = "*" -files = [ - {file = "pytz-2023.3.post1-py2.py3-none-any.whl", hash = "sha256:ce42d816b81b68506614c11e8937d3aa9e41007ceb50bfdcb0749b921bf646c7"}, - {file = "pytz-2023.3.post1.tar.gz", hash = "sha256:7b4fddbeb94a1eba4b557da24f19fdf9db575192544270a9101d8509f9f43d7b"}, -] - [[package]] name = "pyyaml" version = "6.0.1" @@ -874,7 +837,6 @@ babel = ">=2.9" colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} docutils = ">=0.18.1,<0.20" imagesize = ">=1.3" -importlib-metadata = {version = ">=4.8", markers = "python_version < \"3.10\""} Jinja2 = ">=3.0" packaging = ">=21.0" Pygments = ">=2.13" @@ -911,7 +873,6 @@ astroid = [ Jinja2 = "*" PyYAML = "*" sphinx = ">=6.1.0" -stdlib-list = {version = "*", markers = "python_version < \"3.10\""} [package.extras] docs = ["furo", "sphinx", "sphinx-design"] @@ -1005,24 +966,6 @@ files = [ lint = ["docutils-stubs", "flake8", "mypy"] test = ["pytest"] -[[package]] -name = "stdlib-list" -version = "0.10.0" -description = "A list of Python Standard Libraries (2.7 through 3.12)." -optional = false -python-versions = ">=3.7" -files = [ - {file = "stdlib_list-0.10.0-py3-none-any.whl", hash = "sha256:b3a911bc441d03e0332dd1a9e7d0870ba3bb0a542a74d7524f54fb431256e214"}, - {file = "stdlib_list-0.10.0.tar.gz", hash = "sha256:6519c50d645513ed287657bfe856d527f277331540691ddeaf77b25459964a14"}, -] - -[package.extras] -dev = ["build", "stdlib-list[doc,lint,test]"] -doc = ["furo", "sphinx"] -lint = ["black", "mypy", "ruff"] -support = ["sphobjinv"] -test = ["coverage[toml]", "pytest", "pytest-cov"] - [[package]] name = "tomli" version = "2.0.1" @@ -1062,22 +1005,7 @@ secure = ["certifi", "cryptography (>=1.9)", "idna (>=2.0.0)", "pyopenssl (>=17. socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] zstd = ["zstandard (>=0.18.0)"] -[[package]] -name = "zipp" -version = "3.17.0" -description = "Backport of pathlib-compatible object wrapper for zip files" -optional = false -python-versions = ">=3.8" -files = [ - {file = "zipp-3.17.0-py3-none-any.whl", hash = "sha256:0e923e726174922dce09c53c59ad483ff7bbb8e572e00c7f7c46b88556409f31"}, - {file = "zipp-3.17.0.tar.gz", hash = "sha256:84e64a1c28cf7e91ed2078bb8cc8c259cb19b76942096c8d7b84947690cabaf0"}, -] - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-lint"] -testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy (>=0.9.1)", "pytest-ruff"] - [metadata] lock-version = "2.0" -python-versions = ">=3.8,<3.13" -content-hash = "606f144007cf0821a15152a43f89d742691cf677deacb2497b2af87eee0d864d" +python-versions = ">=3.10,<3.13" +content-hash = "3bb5a64beb1655cb54541c558442469083ea287e6fe2b4915d9a339c3c83beea" diff --git a/crates/voicevox_core_python_api/pyproject.toml b/crates/voicevox_core_python_api/pyproject.toml index 042c91091..067e3f6d2 100644 --- a/crates/voicevox_core_python_api/pyproject.toml +++ b/crates/voicevox_core_python_api/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "voicevox_core" -requires-python = ">=3.8" +requires-python = ">=3.10" dependencies = ["pydantic>=2.5.2,<3"] description = "VOICEVOX CORE の Python バインディングです。" authors = [{ name = "Hiroshiba", email = "hihokaruta@gmail.com" }] @@ -38,7 +38,7 @@ description = "VOICEVOX CORE の Python バインディングです。" authors = [] [tool.poetry.dependencies] -python = ">=3.8,<3.13" +python = ">=3.10,<3.13" pydantic = ">=2.5.2,<3" [tool.poetry.group.docs.dependencies] diff --git a/example/python/README.md b/example/python/README.md index 48678edb2..f2f07445f 100644 --- a/example/python/README.md +++ b/example/python/README.md @@ -45,7 +45,7 @@ windows の場合 TODO: -- Python インタプリタ ≧3.8 + venv +- Python インタプリタ ≧3.10 + venv ## 実行