diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 93ff1d15..c96c964f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,15 +30,25 @@ repos: verbose: true - id: poetry-lock verbose: true + + - repo: local + hooks: - id: poetry-export - args: ["-f", "requirements.txt", "-o", "requirements.txt", "--without-hashes"] - verbose: true - files: ^pyproject\.toml$ - - id: poetry-export - args: ["--with", "dev", "-f", "requirements.txt", "-o", "requirements-dev.txt", - "--without-hashes"] - verbose: true - files: ^pyproject\.toml$ + name: Export requirements.txt + entry: poetry export -f requirements.txt -o requirements.txt --without-hashes + language: python + pass_filenames: false + additional_dependencies: + - "poetry" + - "poetry-plugin-export" + - id: poetry-export-dev + name: Export dev requirements.txt + entry: poetry export --with dev -f requirements.txt -o requirements-dev.txt --without-hashes + language: python + pass_filenames: false + additional_dependencies: + - "poetry" + - "poetry-plugin-export" # https://github.com/shellcheck-py/shellcheck-py?tab=readme-ov-file#usage - repo: https://github.com/shellcheck-py/shellcheck-py diff --git a/docs/en/development/programming/python/index.md b/docs/en/development/programming/python/index.md index b84aa441..ae4edfed 100644 --- a/docs/en/development/programming/python/index.md +++ b/docs/en/development/programming/python/index.md @@ -1,6 +1,6 @@ --- title: Python -tags: +tags: - Python description: --- diff --git a/docs/ja/development/programming/python/index.md b/docs/ja/development/programming/python/index.md index ef4a07bb..e506ce02 100644 --- a/docs/ja/development/programming/python/index.md +++ b/docs/ja/development/programming/python/index.md @@ -1,6 +1,6 @@ --- title: Python -tags: +tags: - Python description: --- diff --git a/poetry.lock b/poetry.lock index 9b0cbf16..c07be424 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1344,6 +1344,21 @@ files = [ {file = "poetry_core-2.0.0.tar.gz", hash = "sha256:3317a3cc3932011a61114236b2d49883f4fb1403d2f5e97771ac0d077cfa396f"}, ] +[[package]] +name = "poetry-plugin-export" +version = "1.8.0" +description = "Poetry plugin to export the dependencies to various formats" +optional = false +python-versions = "<4.0,>=3.8" +files = [ + {file = "poetry_plugin_export-1.8.0-py3-none-any.whl", hash = "sha256:adbe232cfa0cc04991ea3680c865cf748bff27593b9abcb1f35fb50ed7ba2c22"}, + {file = "poetry_plugin_export-1.8.0.tar.gz", hash = "sha256:1fa6168a85d59395d835ca564bc19862a7c76061e60c3e7dfaec70d50937fc61"}, +] + +[package.dependencies] +poetry = ">=1.8.0,<3.0.0" +poetry-core = ">=1.7.0,<3.0.0" + [[package]] name = "pre-commit" version = "4.0.1" @@ -2221,4 +2236,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "8e4bfccef025d7fd8fd74aa5afce46b37f0a5a8868a3749d7fdcebc4737a651d" +content-hash = "55e8a41786e86e68914d621bfd9c579156b985a5e69f3f0a439daffb991269fd" diff --git a/pyproject.toml b/pyproject.toml index f1dd93cc..9b0d47a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,6 +28,7 @@ mypy = "^1.3.0" ruamel-yaml = "^0.18.10" ruff = "^0.9.1" taskipy = "^1.11.0" +poetry-plugin-export = "^1.8.0" [tool.taskipy.tasks] black = "poetry run black ci scripts" diff --git a/requirements-dev.txt b/requirements-dev.txt index 2427be65..406dabc7 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -56,6 +56,7 @@ pkginfo==1.12.0 ; python_version >= "3.10" and python_version < "4.0" plantuml-markdown==3.10.4 ; python_version >= "3.10" and python_version < "4.0" platformdirs==4.3.6 ; python_version >= "3.10" and python_version < "4.0" poetry-core==2.0.0 ; python_version >= "3.10" and python_version < "4.0" +poetry-plugin-export==1.8.0 ; python_version >= "3.10" and python_version < "4.0" poetry==2.0.0 ; python_version >= "3.10" and python_version < "4.0" pre-commit==4.0.1 ; python_version >= "3.10" and python_version < "4.0" psutil==6.1.1 ; python_version >= "3.10" and python_version < "4.0"