From 1d00a00dad92bae0de7fb350168416ebedccb50f Mon Sep 17 00:00:00 2001 From: David Hotham Date: Sat, 7 Sep 2024 19:20:11 +0100 Subject: [PATCH] typechecking --- poetry.lock | 27 +++++++++++++++------------ src/poetry/installation/chef.py | 2 +- tests/conftest.py | 2 +- tests/utils/test_authenticator.py | 8 ++++---- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/poetry.lock b/poetry.lock index 91fc217135f..38cf588c08e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -17,13 +17,13 @@ testing = ["jaraco.test", "pytest (!=8.0.*)", "pytest (>=6,!=8.1.*)", "pytest-ch [[package]] name = "build" -version = "1.2.1" +version = "1.2.2" description = "A simple, correct Python build frontend" optional = false -python-versions = ">=3.8" +python-versions = ">= 3.8" files = [ - {file = "build-1.2.1-py3-none-any.whl", hash = "sha256:75e10f767a433d9a86e50d83f418e83efc18ede923ee5ff7df93b6cb0306c5d4"}, - {file = "build-1.2.1.tar.gz", hash = "sha256:526263f4870c26f26c433545579475377b2b7588b6f1eac76a001e873ae3e19d"}, + {file = "build-1.2.2-py3-none-any.whl", hash = "sha256:277ccc71619d98afdd841a0e96ac9fe1593b823af481d3b0cea748e8894e0613"}, + {file = "build-1.2.2.tar.gz", hash = "sha256:119b2fb462adef986483438377a13b2f42064a2a3a4161f24a0cca698a07ac8c"}, ] [package.dependencies] @@ -717,13 +717,13 @@ trio = ["async_generator", "trio"] [[package]] name = "keyring" -version = "25.3.0" +version = "25.4.1" description = "Store and access your passwords safely." optional = false python-versions = ">=3.8" files = [ - {file = "keyring-25.3.0-py3-none-any.whl", hash = "sha256:8d963da00ccdf06e356acd9bf3b743208878751032d8599c6cc89eb51310ffae"}, - {file = "keyring-25.3.0.tar.gz", hash = "sha256:8d85a1ea5d6db8515b59e1c5d1d1678b03cf7fc8b8dcfb1651e8c4a524eb42ef"}, + {file = "keyring-25.4.1-py3-none-any.whl", hash = "sha256:5426f817cf7f6f007ba5ec722b1bcad95a75b27d780343772ad76b17cb47b0bf"}, + {file = "keyring-25.4.1.tar.gz", hash = "sha256:b07ebc55f3e8ed86ac81dd31ef14e81ace9dd9c3d4b5d77a6e9a2016d0d71a1b"}, ] [package.dependencies] @@ -737,9 +737,13 @@ pywin32-ctypes = {version = ">=0.2.0", markers = "sys_platform == \"win32\""} SecretStorage = {version = ">=3.2", markers = "sys_platform == \"linux\""} [package.extras] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] completion = ["shtab (>=1.1.0)"] +cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -test = ["pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy", "pytest-ruff (>=0.2.1)"] +enabler = ["pytest-enabler (>=2.2)"] +test = ["pyfakefs", "pytest (>=6,!=8.1.*)"] +type = ["pygobject-stubs", "pytest-mypy", "shtab", "types-pywin32"] [[package]] name = "more-itertools" @@ -814,7 +818,6 @@ files = [ {file = "msgpack-1.0.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5fbb160554e319f7b22ecf530a80a3ff496d38e8e07ae763b9e82fadfe96f273"}, {file = "msgpack-1.0.8-cp39-cp39-win32.whl", hash = "sha256:f9af38a89b6a5c04b7d18c492c8ccf2aee7048aff1ce8437c4683bb5a1df893d"}, {file = "msgpack-1.0.8-cp39-cp39-win_amd64.whl", hash = "sha256:ed59dd52075f8fc91da6053b12e8c89e37aa043f8986efd89e61fae69dc1b011"}, - {file = "msgpack-1.0.8-py3-none-any.whl", hash = "sha256:24f727df1e20b9876fa6e95f840a2a2651e34c0ad147676356f4bf5fbb0206ca"}, {file = "msgpack-1.0.8.tar.gz", hash = "sha256:95c02b0e27e706e48d0e5426d1710ca78e0f0628d6e89d5b5a5b91a5f12274f3"}, ] @@ -881,7 +884,7 @@ name = "nodeenv" version = "1.9.1" description = "Node.js virtual environment builder" optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*" files = [ {file = "nodeenv-1.9.1-py2.py3-none-any.whl", hash = "sha256:ba11c9782d29c27c70ffbdda2d7415098754709be8a7056d79a737cd901155c9"}, {file = "nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f"}, @@ -991,7 +994,7 @@ 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" +python-versions = ">=3.8,<4.0" 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"}, @@ -1024,7 +1027,7 @@ name = "psutil" version = "6.0.0" description = "Cross-platform lib for process and system monitoring in Python." optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" files = [ {file = "psutil-6.0.0-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:a021da3e881cd935e64a3d0a20983bda0bb4cf80e4f74fa9bfcb1bc5785360c6"}, {file = "psutil-6.0.0-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:1287c2b95f1c0a364d23bc6f2ea2365a8d4d9b726a3be7294296ff7ba97c17f0"}, diff --git a/src/poetry/installation/chef.py b/src/poetry/installation/chef.py index 35586e42036..7341678a9df 100644 --- a/src/poetry/installation/chef.py +++ b/src/poetry/installation/chef.py @@ -50,7 +50,7 @@ def _prepare( ) -> Path: from subprocess import CalledProcessError - distribution: DistributionType = "editable" if editable else "wheel" # type: ignore[assignment] + distribution: DistributionType = "editable" if editable else "wheel" error: Exception | None = None try: diff --git a/tests/conftest.py b/tests/conftest.py index 53641dcb1d7..19f260e58b2 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -138,7 +138,7 @@ def get_credential( if password is None: return None - return SimpleCredential(username, password) # type: ignore[no-untyped-call] + return SimpleCredential(username, password) def delete_password(self, service: str, username: str) -> None: if service in self._passwords and username in self._passwords[service]: diff --git a/tests/utils/test_authenticator.py b/tests/utils/test_authenticator.py index 23df1f97922..441d5c95678 100644 --- a/tests/utils/test_authenticator.py +++ b/tests/utils/test_authenticator.py @@ -190,7 +190,7 @@ def test_authenticator_falls_back_to_keyring_url( dummy_keyring.set_default_service_credential( "https://foo.bar/simple/", - SimpleCredential("foo", "bar"), # type: ignore[no-untyped-call] + SimpleCredential("foo", "bar"), ) authenticator = Authenticator(config, NullIO()) @@ -217,7 +217,7 @@ def test_authenticator_falls_back_to_keyring_netloc( dummy_keyring.set_default_service_credential( "foo.bar", - SimpleCredential("foo", "bar"), # type: ignore[no-untyped-call] + SimpleCredential("foo", "bar"), ) authenticator = Authenticator(config, NullIO()) @@ -483,11 +483,11 @@ def test_authenticator_falls_back_to_keyring_url_matched_by_path( dummy_keyring.set_default_service_credential( "https://foo.bar/alpha/files/simple/", - SimpleCredential("foo", "bar"), # type: ignore[no-untyped-call] + SimpleCredential("foo", "bar"), ) dummy_keyring.set_default_service_credential( "https://foo.bar/beta/files/simple/", - SimpleCredential("foo", "baz"), # type: ignore[no-untyped-call] + SimpleCredential("foo", "baz"), ) authenticator = Authenticator(config, NullIO())