From 6fd06d7205d1b65b3d541e4371036e68020b05fe Mon Sep 17 00:00:00 2001 From: Justin T Date: Wed, 19 Jul 2023 14:56:54 +0200 Subject: [PATCH 1/3] Correct command for listing installed plugins (#8200) --- docs/plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugins.md b/docs/plugins.md index da1bb5ad55e..54ee7abc968 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -214,7 +214,7 @@ poetry self remove poetry-plugin You can also list all currently installed plugins by running: ```shell -poetry self show +poetry self show plugins ``` ### With `pipx inject` From fd717ca1e19ec6e5e74f552290119854dbdee7d9 Mon Sep 17 00:00:00 2001 From: Bartosz Sokorski Date: Thu, 20 Jul 2023 00:03:18 +0200 Subject: [PATCH 2/3] Update locked PyYaml version to working one (#8210) --- poetry.lock | 82 ++++++++++++++++++++++++++--------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/poetry.lock b/poetry.lock index 4b778032f24..1d9584494d8 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1215,51 +1215,51 @@ files = [ [[package]] name = "pyyaml" -version = "6.0" +version = "6.0.1" description = "YAML parser and emitter for Python" optional = false python-versions = ">=3.6" files = [ - {file = "PyYAML-6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53"}, - {file = "PyYAML-6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c"}, - {file = "PyYAML-6.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:77f396e6ef4c73fdc33a9157446466f1cff553d979bd00ecb64385760c6babdc"}, - {file = "PyYAML-6.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a80a78046a72361de73f8f395f1f1e49f956c6be882eed58505a15f3e430962b"}, - {file = "PyYAML-6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5"}, - {file = "PyYAML-6.0-cp310-cp310-win32.whl", hash = "sha256:2cd5df3de48857ed0544b34e2d40e9fac445930039f3cfe4bcc592a1f836d513"}, - {file = "PyYAML-6.0-cp310-cp310-win_amd64.whl", hash = "sha256:daf496c58a8c52083df09b80c860005194014c3698698d1a57cbcfa182142a3a"}, - {file = "PyYAML-6.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d4b0ba9512519522b118090257be113b9468d804b19d63c71dbcf4a48fa32358"}, - {file = "PyYAML-6.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:81957921f441d50af23654aa6c5e5eaf9b06aba7f0a19c18a538dc7ef291c5a1"}, - {file = "PyYAML-6.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:afa17f5bc4d1b10afd4466fd3a44dc0e245382deca5b3c353d8b757f9e3ecb8d"}, - {file = "PyYAML-6.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dbad0e9d368bb989f4515da330b88a057617d16b6a8245084f1b05400f24609f"}, - {file = "PyYAML-6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:432557aa2c09802be39460360ddffd48156e30721f5e8d917f01d31694216782"}, - {file = "PyYAML-6.0-cp311-cp311-win32.whl", hash = "sha256:bfaef573a63ba8923503d27530362590ff4f576c626d86a9fed95822a8255fd7"}, - {file = "PyYAML-6.0-cp311-cp311-win_amd64.whl", hash = "sha256:01b45c0191e6d66c470b6cf1b9531a771a83c1c4208272ead47a3ae4f2f603bf"}, - {file = "PyYAML-6.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:897b80890765f037df3403d22bab41627ca8811ae55e9a722fd0392850ec4d86"}, - {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:50602afada6d6cbfad699b0c7bb50d5ccffa7e46a3d738092afddc1f9758427f"}, - {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:48c346915c114f5fdb3ead70312bd042a953a8ce5c7106d5bfb1a5254e47da92"}, - {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:98c4d36e99714e55cfbaaee6dd5badbc9a1ec339ebfc3b1f52e293aee6bb71a4"}, - {file = "PyYAML-6.0-cp36-cp36m-win32.whl", hash = "sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293"}, - {file = "PyYAML-6.0-cp36-cp36m-win_amd64.whl", hash = "sha256:07751360502caac1c067a8132d150cf3d61339af5691fe9e87803040dbc5db57"}, - {file = "PyYAML-6.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:819b3830a1543db06c4d4b865e70ded25be52a2e0631ccd2f6a47a2822f2fd7c"}, - {file = "PyYAML-6.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:473f9edb243cb1935ab5a084eb238d842fb8f404ed2193a915d1784b5a6b5fc0"}, - {file = "PyYAML-6.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0ce82d761c532fe4ec3f87fc45688bdd3a4c1dc5e0b4a19814b9009a29baefd4"}, - {file = "PyYAML-6.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:231710d57adfd809ef5d34183b8ed1eeae3f76459c18fb4a0b373ad56bedcdd9"}, - {file = "PyYAML-6.0-cp37-cp37m-win32.whl", hash = "sha256:c5687b8d43cf58545ade1fe3e055f70eac7a5a1a0bf42824308d868289a95737"}, - {file = "PyYAML-6.0-cp37-cp37m-win_amd64.whl", hash = "sha256:d15a181d1ecd0d4270dc32edb46f7cb7733c7c508857278d3d378d14d606db2d"}, - {file = "PyYAML-6.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0b4624f379dab24d3725ffde76559cff63d9ec94e1736b556dacdfebe5ab6d4b"}, - {file = "PyYAML-6.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:213c60cd50106436cc818accf5baa1aba61c0189ff610f64f4a3e8c6726218ba"}, - {file = "PyYAML-6.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9fa600030013c4de8165339db93d182b9431076eb98eb40ee068700c9c813e34"}, - {file = "PyYAML-6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:277a0ef2981ca40581a47093e9e2d13b3f1fbbeffae064c1d21bfceba2030287"}, - {file = "PyYAML-6.0-cp38-cp38-win32.whl", hash = "sha256:d4eccecf9adf6fbcc6861a38015c2a64f38b9d94838ac1810a9023a0609e1b78"}, - {file = "PyYAML-6.0-cp38-cp38-win_amd64.whl", hash = "sha256:1e4747bc279b4f613a09eb64bba2ba602d8a6664c6ce6396a4d0cd413a50ce07"}, - {file = "PyYAML-6.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:055d937d65826939cb044fc8c9b08889e8c743fdc6a32b33e2390f66013e449b"}, - {file = "PyYAML-6.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174"}, - {file = "PyYAML-6.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d67d839ede4ed1b28a4e8909735fc992a923cdb84e618544973d7dfc71540803"}, - {file = "PyYAML-6.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cba8c411ef271aa037d7357a2bc8f9ee8b58b9965831d9e51baf703280dc73d3"}, - {file = "PyYAML-6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:40527857252b61eacd1d9af500c3337ba8deb8fc298940291486c465c8b46ec0"}, - {file = "PyYAML-6.0-cp39-cp39-win32.whl", hash = "sha256:b5b9eccad747aabaaffbc6064800670f0c297e52c12754eb1d976c57e4f74dcb"}, - {file = "PyYAML-6.0-cp39-cp39-win_amd64.whl", hash = "sha256:b3d267842bf12586ba6c734f89d1f5b871df0273157918b0ccefa29deb05c21c"}, - {file = "PyYAML-6.0.tar.gz", hash = "sha256:68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2"}, + {file = "PyYAML-6.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a"}, + {file = "PyYAML-6.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515"}, + {file = "PyYAML-6.0.1-cp310-cp310-win32.whl", hash = "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924"}, + {file = "PyYAML-6.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d"}, + {file = "PyYAML-6.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007"}, + {file = "PyYAML-6.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673"}, + {file = "PyYAML-6.0.1-cp311-cp311-win32.whl", hash = "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741"}, + {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, + {file = "PyYAML-6.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:afd7e57eddb1a54f0f1a974bc4391af8bcce0b444685d936840f125cf046d5bd"}, + {file = "PyYAML-6.0.1-cp36-cp36m-win32.whl", hash = "sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585"}, + {file = "PyYAML-6.0.1-cp36-cp36m-win_amd64.whl", hash = "sha256:f22ac1c3cac4dbc50079e965eba2c1058622631e526bd9afd45fedd49ba781fa"}, + {file = "PyYAML-6.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b1275ad35a5d18c62a7220633c913e1b42d44b46ee12554e5fd39c70a243d6a3"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:18aeb1bf9a78867dc38b259769503436b7c72f7a1f1f4c93ff9a17de54319b27"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:596106435fa6ad000c2991a98fa58eeb8656ef2325d7e158344fb33864ed87e3"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:baa90d3f661d43131ca170712d903e6295d1f7a0f595074f151c0aed377c9b9c"}, + {file = "PyYAML-6.0.1-cp37-cp37m-win32.whl", hash = "sha256:9046c58c4395dff28dd494285c82ba00b546adfc7ef001486fbf0324bc174fba"}, + {file = "PyYAML-6.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:4fb147e7a67ef577a588a0e2c17b6db51dda102c71de36f8549b6816a96e1867"}, + {file = "PyYAML-6.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1d4c7e777c441b20e32f52bd377e0c409713e8bb1386e1099c2415f26e479595"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735"}, + {file = "PyYAML-6.0.1-cp38-cp38-win32.whl", hash = "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206"}, + {file = "PyYAML-6.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62"}, + {file = "PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8"}, + {file = "PyYAML-6.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c8098ddcc2a85b61647b2590f825f3db38891662cfc2fc776415143f599bb859"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c"}, + {file = "PyYAML-6.0.1-cp39-cp39-win32.whl", hash = "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c"}, + {file = "PyYAML-6.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486"}, + {file = "PyYAML-6.0.1.tar.gz", hash = "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"}, ] [[package]] From c71deb4b75b3672116b3199b2f9ab7e2bf520844 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 20 Jul 2023 00:23:22 +0200 Subject: [PATCH 3/3] [pre-commit.ci] pre-commit autoupdate (#8136) Co-authored-by: Bartek Sokorski --- .pre-commit-config.yaml | 6 +-- pyproject.toml | 3 ++ src/poetry/config/config.py | 3 +- src/poetry/config/source.py | 8 ++-- src/poetry/console/commands/add.py | 12 ++---- src/poetry/console/commands/check.py | 6 +-- src/poetry/console/commands/env/remove.py | 6 +-- src/poetry/console/commands/init.py | 18 +++------ src/poetry/console/commands/install.py | 38 +++++++------------ src/poetry/console/commands/lock.py | 8 ++-- src/poetry/console/commands/remove.py | 14 +++---- src/poetry/console/commands/self/update.py | 6 +-- src/poetry/console/commands/show.py | 6 +-- src/poetry/console/commands/source/add.py | 28 +++++--------- src/poetry/console/commands/update.py | 12 ++---- src/poetry/installation/chooser.py | 12 ++---- src/poetry/installation/executor.py | 10 ++--- src/poetry/locations.py | 10 ++--- src/poetry/mixology/failure.py | 14 +++---- .../python_requirement_solution_provider.py | 6 +-- src/poetry/packages/locker.py | 10 ++++- src/poetry/puzzle/provider.py | 3 +- .../repositories/installed_repository.py | 8 ++-- src/poetry/repositories/link_sources/base.py | 3 +- src/poetry/repositories/pypi_repository.py | 6 +-- src/poetry/repositories/repository_pool.py | 8 ++-- src/poetry/toml/file.py | 8 ++-- src/poetry/utils/env/env_manager.py | 12 ++---- src/poetry/utils/setup_reader.py | 5 ++- src/poetry/vcs/git/backend.py | 20 ++++------ tests/console/commands/test_init.py | 26 ++++++------- tests/console/test_application.py | 3 +- tests/plugins/test_plugin_manager.py | 4 +- 33 files changed, 136 insertions(+), 206 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 812efe2f970..dfc06e64968 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,7 +21,7 @@ repos: - id: check-docstring-first - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 23.7.0 hooks: - id: black @@ -30,7 +30,7 @@ repos: hooks: - id: validate_manifest - - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.0.272 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.0.278 hooks: - id: ruff diff --git a/pyproject.toml b/pyproject.toml index 50e7829aaed..4776b608705 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -135,6 +135,9 @@ known-first-party = ["poetry"] known-third-party = ["poetry.core"] required-imports = ["from __future__ import annotations"] +[tool.ruff.per-file-ignores] +"src/poetry/console/*" = ["RUF012"] # Can't annotate properly until new version of Cleo + [tool.black] target-version = ['py38'] preview = true diff --git a/src/poetry/config/config.py b/src/poetry/config/config.py index b19bb16afb9..6d7658645ae 100644 --- a/src/poetry/config/config.py +++ b/src/poetry/config/config.py @@ -9,6 +9,7 @@ from pathlib import Path from typing import TYPE_CHECKING from typing import Any +from typing import ClassVar from packaging.utils import canonicalize_name @@ -104,7 +105,7 @@ def validator(cls, policy: str) -> bool: class Config: - default_config: dict[str, Any] = { + default_config: ClassVar[dict[str, Any]] = { "cache-dir": str(DEFAULT_CACHE_DIR), "virtualenvs": { "create": True, diff --git a/src/poetry/config/source.py b/src/poetry/config/source.py index 7a4043b45b9..d3783bb5933 100644 --- a/src/poetry/config/source.py +++ b/src/poetry/config/source.py @@ -21,11 +21,9 @@ def __post_init__(self, default: bool, secondary: bool) -> None: self.priority = Priority[self.priority.upper()] if default or secondary: warnings.warn( - ( - "Parameters 'default' and 'secondary' to" - " 'Source' are deprecated. Please provide" - " 'priority' instead." - ), + "Parameters 'default' and 'secondary' to" + " 'Source' are deprecated. Please provide" + " 'priority' instead.", DeprecationWarning, stacklevel=2, ) diff --git a/src/poetry/console/commands/add.py b/src/poetry/console/commands/add.py index 2db11dfb0c1..37277c94514 100644 --- a/src/poetry/console/commands/add.py +++ b/src/poetry/console/commands/add.py @@ -30,10 +30,8 @@ class AddCommand(InstallerCommand, InitCommand): option( "dev", "D", - ( - "Add as a development dependency. (Deprecated) Use" - " --group=dev instead." - ), + "Add as a development dependency. (Deprecated) Use" + " --group=dev instead.", ), option("editable", "e", "Add vcs/path dependencies as editable."), option( @@ -66,10 +64,8 @@ class AddCommand(InstallerCommand, InitCommand): option( "dry-run", None, - ( - "Output the operations but do not execute anything (implicitly enables" - " --verbose)." - ), + "Output the operations but do not execute anything (implicitly enables" + " --verbose).", ), option("lock", None, "Do not perform operations (only update the lockfile)."), ] diff --git a/src/poetry/console/commands/check.py b/src/poetry/console/commands/check.py index 95bd9912195..570a7f4e768 100644 --- a/src/poetry/console/commands/check.py +++ b/src/poetry/console/commands/check.py @@ -22,10 +22,8 @@ class CheckCommand(Command): option( "lock", None, - ( - "Checks that poetry.lock exists for the current" - " version of pyproject.toml." - ), + "Checks that poetry.lock exists for the current" + " version of pyproject.toml.", ), ] diff --git a/src/poetry/console/commands/env/remove.py b/src/poetry/console/commands/env/remove.py index d7029b96ac3..d23fafe5526 100644 --- a/src/poetry/console/commands/env/remove.py +++ b/src/poetry/console/commands/env/remove.py @@ -13,10 +13,8 @@ class EnvRemoveCommand(Command): arguments = [ argument( "python", - ( - "The python executables associated with, or names of the virtual" - " environments which are to be removed." - ), + "The python executables associated with, or names of the virtual" + " environments which are to be removed.", optional=True, multiple=True, ) diff --git a/src/poetry/console/commands/init.py b/src/poetry/console/commands/init.py index 8424f90b60e..d7dc3bbeea3 100644 --- a/src/poetry/console/commands/init.py +++ b/src/poetry/console/commands/init.py @@ -40,20 +40,16 @@ class InitCommand(Command): option( "dependency", None, - ( - "Package to require, with an optional version constraint, " - "e.g. requests:^2.10.0 or requests=2.11.1." - ), + "Package to require, with an optional version constraint, " + "e.g. requests:^2.10.0 or requests=2.11.1.", flag=False, multiple=True, ), option( "dev-dependency", None, - ( - "Package to require for development, with an optional version" - " constraint, e.g. requests:^2.10.0 or requests=2.11.1." - ), + "Package to require for development, with an optional version" + " constraint, e.g. requests:^2.10.0 or requests=2.11.1.", flag=False, multiple=True, ), @@ -330,10 +326,8 @@ def _determine_requirements( choices.append("") package = self.choice( - ( - "\nEnter package # to add, or the complete package name if" - " it is not listed" - ), + "\nEnter package # to add, or the complete package name if" + " it is not listed", choices, attempts=3, default=len(choices) - 1, diff --git a/src/poetry/console/commands/install.py b/src/poetry/console/commands/install.py index 66c419f1035..cc6e22eb624 100644 --- a/src/poetry/console/commands/install.py +++ b/src/poetry/console/commands/install.py @@ -14,18 +14,14 @@ class InstallCommand(InstallerCommand): option( "no-dev", None, - ( - "Do not install the development dependencies." - " (Deprecated)" - ), + "Do not install the development dependencies." + " (Deprecated)", ), option( "sync", None, - ( - "Synchronize the environment with the locked packages and the specified" - " groups." - ), + "Synchronize the environment with the locked packages and the specified" + " groups.", ), option( "no-root", None, "Do not install the root package (the current project)." @@ -33,28 +29,22 @@ class InstallCommand(InstallerCommand): option( "no-directory", None, - ( - "Do not install any directory path dependencies; useful to install" - " dependencies without source code, e.g. for caching of Docker layers)" - ), + "Do not install any directory path dependencies; useful to install" + " dependencies without source code, e.g. for caching of Docker layers)", flag=True, multiple=False, ), option( "dry-run", None, - ( - "Output the operations but do not execute anything " - "(implicitly enables --verbose)." - ), + "Output the operations but do not execute anything " + "(implicitly enables --verbose).", ), option( "remove-untracked", None, - ( - "Removes packages not present in the lock file." - " (Deprecated)" - ), + "Removes packages not present in the lock file." + " (Deprecated)", ), option( "extras", @@ -68,11 +58,9 @@ class InstallCommand(InstallerCommand): option( "compile", None, - ( - "Compile Python source files to bytecode." - " (This option has no effect if modern-installation is disabled" - " because the old installer always compiles.)" - ), + "Compile Python source files to bytecode." + " (This option has no effect if modern-installation is disabled" + " because the old installer always compiles.)", ), ] diff --git a/src/poetry/console/commands/lock.py b/src/poetry/console/commands/lock.py index 87273a66776..b32c05dd4e4 100644 --- a/src/poetry/console/commands/lock.py +++ b/src/poetry/console/commands/lock.py @@ -16,11 +16,9 @@ class LockCommand(InstallerCommand): option( "check", None, - ( - "Check that the poetry.lock file corresponds to the current" - " version of pyproject.toml. (Deprecated) Use" - " poetry check --lock instead." - ), + "Check that the poetry.lock file corresponds to the current" + " version of pyproject.toml. (Deprecated) Use" + " poetry check --lock instead.", ), ] diff --git a/src/poetry/console/commands/remove.py b/src/poetry/console/commands/remove.py index 10b605b4d9f..d4315e80bf8 100644 --- a/src/poetry/console/commands/remove.py +++ b/src/poetry/console/commands/remove.py @@ -21,19 +21,15 @@ class RemoveCommand(InstallerCommand): option( "dev", "D", - ( - "Remove a package from the development dependencies." - " (Deprecated)" - " Use --group=dev instead." - ), + "Remove a package from the development dependencies." + " (Deprecated)" + " Use --group=dev instead.", ), option( "dry-run", None, - ( - "Output the operations but do not execute anything " - "(implicitly enables --verbose)." - ), + "Output the operations but do not execute anything " + "(implicitly enables --verbose).", ), option("lock", None, "Do not perform operations (only update the lockfile)."), ] diff --git a/src/poetry/console/commands/self/update.py b/src/poetry/console/commands/self/update.py index 6cd94d71402..f42a3d477d8 100644 --- a/src/poetry/console/commands/self/update.py +++ b/src/poetry/console/commands/self/update.py @@ -23,10 +23,8 @@ class SelfUpdateCommand(SelfCommand): option( "dry-run", None, - ( - "Output the operations but do not execute anything " - "(implicitly enables --verbose)." - ), + "Output the operations but do not execute anything " + "(implicitly enables --verbose).", ), ] help = """\ diff --git a/src/poetry/console/commands/show.py b/src/poetry/console/commands/show.py index 090e5ca17a7..58f12b26160 100644 --- a/src/poetry/console/commands/show.py +++ b/src/poetry/console/commands/show.py @@ -48,10 +48,8 @@ class ShowCommand(GroupCommand, EnvCommand): option( "why", None, - ( - "When showing the full list, or a --tree for a single" - " package, also display why it's included." - ), + "When showing the full list, or a --tree for a single" + " package, also display why it's included.", ), option("latest", "l", "Show the latest version."), option( diff --git a/src/poetry/console/commands/source/add.py b/src/poetry/console/commands/source/add.py index 1997deb5328..5e1526f0f95 100644 --- a/src/poetry/console/commands/source/add.py +++ b/src/poetry/console/commands/source/add.py @@ -21,10 +21,8 @@ class SourceAddCommand(Command): ), argument( "url", - ( - "Source repository URL." - " Required, except for PyPI, for which it is not allowed." - ), + "Source repository URL." + " Required, except for PyPI, for which it is not allowed.", optional=True, ), ] @@ -33,28 +31,22 @@ class SourceAddCommand(Command): option( "default", "d", - ( - "Set this source as the default (disable PyPI). A " - "default source will also be the fallback source if " - "you add other sources. (Deprecated, use --priority)" - ), + "Set this source as the default (disable PyPI). A " + "default source will also be the fallback source if " + "you add other sources. (Deprecated, use --priority)", ), option( "secondary", "s", - ( - "Set this source as secondary. (Deprecated, use" - " --priority)" - ), + "Set this source as secondary. (Deprecated, use" + " --priority)", ), option( "priority", "p", - ( - "Set the priority of this source. One of:" - f" {', '.join(p.name.lower() for p in Priority)}. Defaults to" - f" {Priority.PRIMARY.name.lower()}." - ), + "Set the priority of this source. One of:" + f" {', '.join(p.name.lower() for p in Priority)}. Defaults to" + f" {Priority.PRIMARY.name.lower()}.", flag=False, ), ] diff --git a/src/poetry/console/commands/update.py b/src/poetry/console/commands/update.py index 4e97d84796b..57b173000a9 100644 --- a/src/poetry/console/commands/update.py +++ b/src/poetry/console/commands/update.py @@ -20,18 +20,14 @@ class UpdateCommand(InstallerCommand): option( "no-dev", None, - ( - "Do not update the development dependencies." - " (Deprecated)" - ), + "Do not update the development dependencies." + " (Deprecated)", ), option( "dry-run", None, - ( - "Output the operations but do not execute anything " - "(implicitly enables --verbose)." - ), + "Output the operations but do not execute anything " + "(implicitly enables --verbose).", ), option("lock", None, "Do not perform operations (only update the lockfile)."), ] diff --git a/src/poetry/installation/chooser.py b/src/poetry/installation/chooser.py index 4601189d16d..cb05dff1b6d 100644 --- a/src/poetry/installation/chooser.py +++ b/src/poetry/installation/chooser.py @@ -48,10 +48,8 @@ def choose_for(self, package: Package) -> Link: if link.is_wheel: if not self._no_binary_policy.allows(package.name): logger.debug( - ( - "Skipping wheel for %s as requested in no binary policy for" - " package (%s)" - ), + "Skipping wheel for %s as requested in no binary policy for" + " package (%s)", link.filename, package.name, ) @@ -59,10 +57,8 @@ def choose_for(self, package: Package) -> Link: if not Wheel(link.filename).is_supported_by_environment(self._env): logger.debug( - ( - "Skipping wheel %s as this is not supported by the current" - " environment" - ), + "Skipping wheel %s as this is not supported by the current" + " environment", link.filename, ) continue diff --git a/src/poetry/installation/executor.py b/src/poetry/installation/executor.py index 72d08a19648..33bc924dfc0 100644 --- a/src/poetry/installation/executor.py +++ b/src/poetry/installation/executor.py @@ -370,12 +370,10 @@ def _do_execute_operation(self, operation: Operation) -> int: if self.supports_fancy_output(): self._write( operation, - ( - f" • {operation_message}: " - "Skipped " - "for the following reason: " - f"{operation.skip_reason}" - ), + f" • {operation_message}: " + "Skipped " + "for the following reason: " + f"{operation.skip_reason}", ) self._skipped[operation.job_type] += 1 diff --git a/src/poetry/locations.py b/src/poetry/locations.py index 2d3b25da722..0b8c0826d97 100644 --- a/src/poetry/locations.py +++ b/src/poetry/locations.py @@ -35,12 +35,10 @@ if any(file.exists() for file in (auth_toml, config_toml)): logger.warning( - ( - "Configuration file exists at %s, reusing this" - " directory.\n\nConsider moving TOML configuration files to %s, as" - " support for the legacy directory will be removed in an upcoming" - " release." - ), + "Configuration file exists at %s, reusing this" + " directory.\n\nConsider moving TOML configuration files to %s, as" + " support for the legacy directory will be removed in an upcoming" + " release.", _LEGACY_CONFIG_DIR, CONFIG_DIR, ) diff --git a/src/poetry/mixology/failure.py b/src/poetry/mixology/failure.py index 6d13ee2ca56..da14d15edd4 100644 --- a/src/poetry/mixology/failure.py +++ b/src/poetry/mixology/failure.py @@ -144,10 +144,8 @@ def _visit( self._visit(without_line) self._write( incompatibility, - ( - f"{conjunction} because {with_line!s} ({line})," - f" {incompatibility_string}." - ), + f"{conjunction} because {with_line!s} ({line})," + f" {incompatibility_string}.", numbered=numbered, ) else: @@ -172,11 +170,9 @@ def _visit( self._write( incompatibility, - ( - f"{conjunction} because {cause.conflict!s}" - f" ({self._line_numbers[cause.conflict]})," - f" {incompatibility_string}" - ), + f"{conjunction} because {cause.conflict!s}" + f" ({self._line_numbers[cause.conflict]})," + f" {incompatibility_string}", numbered=numbered, ) elif isinstance(cause.conflict.cause, ConflictCause) or isinstance( diff --git a/src/poetry/mixology/solutions/providers/python_requirement_solution_provider.py b/src/poetry/mixology/solutions/providers/python_requirement_solution_provider.py index ef278abb57b..b7d6e83bed2 100644 --- a/src/poetry/mixology/solutions/providers/python_requirement_solution_provider.py +++ b/src/poetry/mixology/solutions/providers/python_requirement_solution_provider.py @@ -19,10 +19,8 @@ def can_solve(self, exception: Exception) -> bool: return False m = re.match( - ( - "^The current project's Python requirement (.+) is not compatible " - "with some of the required packages Python requirement" - ), + "^The current project's Python requirement (.+) is not compatible " + "with some of the required packages Python requirement", str(exception), ) diff --git a/src/poetry/packages/locker.py b/src/poetry/packages/locker.py index a0cbfb24f51..69adb802ef6 100644 --- a/src/poetry/packages/locker.py +++ b/src/poetry/packages/locker.py @@ -9,6 +9,7 @@ from pathlib import Path from typing import TYPE_CHECKING from typing import Any +from typing import ClassVar from typing import cast from packaging.utils import canonicalize_name @@ -50,8 +51,13 @@ class Locker: _VERSION = "2.0" _READ_VERSION_RANGE = ">=1,<3" - _legacy_keys = ["dependencies", "source", "extras", "dev-dependencies"] - _relevant_keys = [*_legacy_keys, "group"] + _legacy_keys: ClassVar[list[str]] = [ + "dependencies", + "source", + "extras", + "dev-dependencies", + ] + _relevant_keys: ClassVar[list[str]] = [*_legacy_keys, "group"] def __init__(self, lock: Path, local_config: dict[str, Any]) -> None: self._lock = lock diff --git a/src/poetry/puzzle/provider.py b/src/poetry/puzzle/provider.py index ea1eb8d9559..e8204fffcf3 100644 --- a/src/poetry/puzzle/provider.py +++ b/src/poetry/puzzle/provider.py @@ -7,6 +7,7 @@ from collections import defaultdict from contextlib import contextmanager from typing import TYPE_CHECKING +from typing import ClassVar from typing import cast from cleo.ui.progress_indicator import ProgressIndicator @@ -93,7 +94,7 @@ def _formatter_elapsed(self) -> str: class Provider: - UNSAFE_PACKAGES: set[str] = set() + UNSAFE_PACKAGES: ClassVar[set[str]] = set() def __init__( self, diff --git a/src/poetry/repositories/installed_repository.py b/src/poetry/repositories/installed_repository.py index 4256c509beb..1eb6b1d9742 100644 --- a/src/poetry/repositories/installed_repository.py +++ b/src/poetry/repositories/installed_repository.py @@ -258,11 +258,9 @@ def load(cls, env: Env, with_dependencies: bool = False) -> InstalledRepository: name = distribution.metadata.get("name") # type: ignore[attr-defined] if name is None: logger.warning( - ( - "Project environment contains an invalid distribution" - " (%s). Consider removing it manually or recreate" - " the environment." - ), + "Project environment contains an invalid distribution" + " (%s). Consider removing it manually or recreate" + " the environment.", path, ) skipped.add(path) diff --git a/src/poetry/repositories/link_sources/base.py b/src/poetry/repositories/link_sources/base.py index b2bd455d42a..9948ec8cd35 100644 --- a/src/poetry/repositories/link_sources/base.py +++ b/src/poetry/repositories/link_sources/base.py @@ -5,6 +5,7 @@ from functools import cached_property from typing import TYPE_CHECKING +from typing import ClassVar from typing import DefaultDict from typing import List @@ -31,7 +32,7 @@ class LinkSource: VERSION_REGEX = re.compile(r"(?i)([a-z0-9_\-.]+?)-(?=\d)([a-z0-9_.!+-]+)") CLEAN_REGEX = re.compile(r"[^a-z0-9$&+,/:;=?@.#%_\\|-]", re.I) - SUPPORTED_FORMATS = [ + SUPPORTED_FORMATS: ClassVar[list[str]] = [ ".tar.gz", ".whl", ".zip", diff --git a/src/poetry/repositories/pypi_repository.py b/src/poetry/repositories/pypi_repository.py index d91cfafe0d8..73e8e3eb6b1 100644 --- a/src/poetry/repositories/pypi_repository.py +++ b/src/poetry/repositories/pypi_repository.py @@ -62,10 +62,8 @@ def search(self, query: str) -> list[Package]: results.append(package) except InvalidVersion: self._log( - ( - f'Unable to parse version "{result.version}" for the' - f" {result.name} package, skipping" - ), + f'Unable to parse version "{result.version}" for the' + f" {result.name} package, skipping", level="debug", ) diff --git a/src/poetry/repositories/repository_pool.py b/src/poetry/repositories/repository_pool.py index cd839521a35..0d8a861951a 100644 --- a/src/poetry/repositories/repository_pool.py +++ b/src/poetry/repositories/repository_pool.py @@ -135,11 +135,9 @@ def add_repository( if default or secondary: warnings.warn( - ( - "Parameters 'default' and 'secondary' to" - " 'RepositoryPool.add_repository' are deprecated. Please provide" - " the keyword-argument 'priority' instead." - ), + "Parameters 'default' and 'secondary' to" + " 'RepositoryPool.add_repository' are deprecated. Please provide" + " the keyword-argument 'priority' instead.", DeprecationWarning, stacklevel=2, ) diff --git a/src/poetry/toml/file.py b/src/poetry/toml/file.py index 8c5bf729276..6733de7f037 100644 --- a/src/poetry/toml/file.py +++ b/src/poetry/toml/file.py @@ -38,11 +38,9 @@ def read(self) -> TOMLDocument: def __getattr__(self, item: str) -> Any: warnings.warn( - ( - "`__getattr__` will be removed from the `TOMLFile` in a future release." - "\n\nInstead of accessing properties of the underlying `Path` as " - "`tomlfile.whatever`, prefer `tomlfile.path.whatever`." - ), + "`__getattr__` will be removed from the `TOMLFile` in a future release." + "\n\nInstead of accessing properties of the underlying `Path` as " + "`tomlfile.whatever`, prefer `tomlfile.path.whatever`.", DeprecationWarning, stacklevel=2, ) diff --git a/src/poetry/utils/env/env_manager.py b/src/poetry/utils/env/env_manager.py index 438dc7455f5..1fa70afad1f 100644 --- a/src/poetry/utils/env/env_manager.py +++ b/src/poetry/utils/env/env_manager.py @@ -78,10 +78,8 @@ def _full_python_path(python: str) -> Path | None: def _detect_active_python(io: None | IO = None) -> Path | None: io = io or NullIO() io.write_error_line( - ( - "Trying to detect current active python executable as specified in" - " the config." - ), + "Trying to detect current active python executable as specified in" + " the config.", verbosity=Verbosity.VERBOSE, ) @@ -91,10 +89,8 @@ def _detect_active_python(io: None | IO = None) -> Path | None: io.write_error_line(f"Found: {executable}", verbosity=Verbosity.VERBOSE) else: io.write_error_line( - ( - "Unable to detect the current active python executable. Falling" - " back to default." - ), + "Unable to detect the current active python executable. Falling" + " back to default.", verbosity=Verbosity.VERBOSE, ) diff --git a/src/poetry/utils/setup_reader.py b/src/poetry/utils/setup_reader.py index f9cecc4335a..53cd5e9e68e 100644 --- a/src/poetry/utils/setup_reader.py +++ b/src/poetry/utils/setup_reader.py @@ -5,6 +5,7 @@ from configparser import ConfigParser from typing import TYPE_CHECKING from typing import Any +from typing import ClassVar from poetry.core.constraints.version import Version @@ -18,7 +19,7 @@ class SetupReader: Class that reads a setup.py file without executing it. """ - DEFAULT: dict[str, Any] = { + DEFAULT: ClassVar[dict[str, Any]] = { "name": None, "version": None, "install_requires": [], @@ -26,7 +27,7 @@ class SetupReader: "python_requires": None, } - FILES = ["setup.py", "setup.cfg"] + FILES: ClassVar[list[str]] = ["setup.py", "setup.cfg"] @classmethod def read_from_directory(cls, directory: Path) -> dict[str, Any]: diff --git a/src/poetry/vcs/git/backend.py b/src/poetry/vcs/git/backend.py index 3d58850f468..fcafc430605 100644 --- a/src/poetry/vcs/git/backend.py +++ b/src/poetry/vcs/git/backend.py @@ -296,10 +296,8 @@ def _clone(cls, url: str, refspec: GitRefSpec, target: Path) -> Repo: if isinstance(e, KeyError): # the local copy is at a bad state, lets remove it logger.debug( - ( - "Removing local clone (%s) of repository as it is in a" - " broken state." - ), + "Removing local clone (%s) of repository as it is in a" + " broken state.", local.path, ) remove_directory(Path(local.path), force=True) @@ -308,11 +306,9 @@ def _clone(cls, url: str, refspec: GitRefSpec, target: Path) -> Repo: raise logger.debug( - ( - "\nRequested ref (%s) was not fetched to local copy and" - " cannot be used. The following error was" - " raised:\n\n\t%s" - ), + "\nRequested ref (%s) was not fetched to local copy and" + " cannot be used. The following error was" + " raised:\n\n\t%s", refspec.key, e, ) @@ -447,10 +443,8 @@ def clone( # without additional configuration or changes for existing projects that # use http basic auth credentials. logger.debug( - ( - "Unable to fetch from private repository '%s', falling back to" - " system git" - ), + "Unable to fetch from private repository '%s', falling back to" + " system git", url, ) diff --git a/tests/console/commands/test_init.py b/tests/console/commands/test_init.py index 9e963ef80f8..3352387246c 100644 --- a/tests/console/commands/test_init.py +++ b/tests/console/commands/test_init.py @@ -848,15 +848,13 @@ def test_predefined_all_options(tester: CommandTester, repo: TestRepository) -> ] tester.execute( - ( - "--name my-package " - "--description 'This is a description' " - "--author 'Foo Bar ' " - "--python '^3.8' " - "--license MIT " - "--dependency pendulum " - "--dev-dependency pytest" - ), + "--name my-package " + "--description 'This is a description' " + "--author 'Foo Bar ' " + "--python '^3.8' " + "--license MIT " + "--dependency pendulum " + "--dev-dependency pytest", inputs="\n".join(inputs), ) @@ -947,12 +945,10 @@ def test_init_non_interactive_existing_pyproject_add_dependency( repo.add_package(get_package("foo", "1.19.2")) tester.execute( - ( - "--author 'Your Name ' " - "--name 'my-package' " - "--python '^3.6' " - "--dependency foo" - ), + "--author 'Your Name ' " + "--name 'my-package' " + "--python '^3.6' " + "--dependency foo", interactive=False, ) diff --git a/tests/console/test_application.py b/tests/console/test_application.py index 21310a81478..931944e227f 100644 --- a/tests/console/test_application.py +++ b/tests/console/test_application.py @@ -3,6 +3,7 @@ import re from typing import TYPE_CHECKING +from typing import ClassVar import pytest @@ -32,7 +33,7 @@ def handle(self) -> int: class AddCommandPlugin(ApplicationPlugin): - commands = [FooCommand] + commands: ClassVar[list[type[Command]]] = [FooCommand] @pytest.fixture diff --git a/tests/plugins/test_plugin_manager.py b/tests/plugins/test_plugin_manager.py index 7ac296b8ef9..b6baa358ec7 100644 --- a/tests/plugins/test_plugin_manager.py +++ b/tests/plugins/test_plugin_manager.py @@ -2,6 +2,7 @@ from pathlib import Path from typing import TYPE_CHECKING +from typing import ClassVar from typing import Protocol import pytest @@ -22,6 +23,7 @@ from cleo.io.io import IO from pytest_mock import MockerFixture + from poetry.console.commands.command import Command from tests.conftest import Config from tests.types import FixtureDirGetter @@ -38,7 +40,7 @@ def activate(self, poetry: Poetry, io: IO) -> None: class MyCommandPlugin(ApplicationPlugin): - commands = [] + commands: ClassVar[list[type[Command]]] = [] class InvalidPlugin: