From 9f9a1df85e705113fb00847c849eee8c27c344b5 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Tue, 7 Jan 2025 09:43:14 -0800 Subject: [PATCH] upgrade pylint (#10121) we need this for https://github.com/certbot/certbot/issues/10045 --- .../certbot_nginx/_internal/nginxparser.py | 3 +- .../certbot_nginx/_internal/parser_obj.py | 6 +- certbot/certbot/_internal/main.py | 3 +- certbot/certbot/util.py | 4 ++ tools/pinning/current/pyproject.toml | 2 +- tools/requirements.txt | 67 ++++++++++--------- 6 files changed, 45 insertions(+), 40 deletions(-) diff --git a/certbot-nginx/certbot_nginx/_internal/nginxparser.py b/certbot-nginx/certbot_nginx/_internal/nginxparser.py index 79bb5b8db..1df8a8817 100644 --- a/certbot-nginx/certbot_nginx/_internal/nginxparser.py +++ b/certbot-nginx/certbot_nginx/_internal/nginxparser.py @@ -102,8 +102,7 @@ class RawNginxDumper: if isinstance(item[0], list): # block yield "".join(item.pop(0)) + '{' for parameter in item.pop(0): - for line in self.__iter__([parameter]): # negate "for b0 in blocks" - yield line + yield from self.__iter__([parameter]) # negate "for b0 in blocks" yield '}' else: # not a block - list of strings semicolon = ";" diff --git a/certbot-nginx/certbot_nginx/_internal/parser_obj.py b/certbot-nginx/certbot_nginx/_internal/parser_obj.py index 7a0946500..2e9ceba14 100644 --- a/certbot-nginx/certbot_nginx/_internal/parser_obj.py +++ b/certbot-nginx/certbot_nginx/_internal/parser_obj.py @@ -185,8 +185,7 @@ class Statements(Parsable): match: Optional[Callable[["Parsable"], bool]] = None) -> Iterator[Any]: """ Combines each statement's iterator. """ for elem in self._data: - for sub_elem in elem.iterate(expanded, match): - yield sub_elem + yield from elem.iterate(expanded, match) # ======== End overridden functions @@ -310,8 +309,7 @@ class Block(Parsable): if match is None or match(self): yield self if expanded: - for elem in self.contents.iterate(expanded, match): - yield elem + yield from self.contents.iterate(expanded, match) def parse(self, raw_list: List[Any], add_spaces: bool = False) -> None: """ Parses a list that resembles a block. diff --git a/certbot/certbot/_internal/main.py b/certbot/certbot/_internal/main.py index 2fa80e364..883d3a63e 100644 --- a/certbot/certbot/_internal/main.py +++ b/certbot/certbot/_internal/main.py @@ -280,7 +280,8 @@ def _handle_identical_cert_request(config: configuration.NamespaceConfig, if config.verb == "run": keep_opt = "Attempt to reinstall this existing certificate" - elif config.verb == "certonly": + else: + assert config.verb == "certonly", "Unexpected Certbot subcommand" keep_opt = "Keep the existing certificate for now" choices = [keep_opt, "Renew & replace the certificate (may be subject to CA rate limits)"] diff --git a/certbot/certbot/util.py b/certbot/certbot/util.py index 8a2034786..82a8219fb 100644 --- a/certbot/certbot/util.py +++ b/certbot/certbot/util.py @@ -407,7 +407,11 @@ def get_os_info_ua() -> str: :returns: os_ua :rtype: `str` + """ + # distro.name returns an empty string if one cannot be determined. see + # https://github.com/python-distro/distro/blob/3bd19e61fcb7f8d2bf3d45d9e40d69c92e05d241/src/distro/distro.py#L883 + os_info = "" if _USE_DISTRO: os_info = distro.name(pretty=True) diff --git a/tools/pinning/current/pyproject.toml b/tools/pinning/current/pyproject.toml index 9443d5b44..a10c92d13 100644 --- a/tools/pinning/current/pyproject.toml +++ b/tools/pinning/current/pyproject.toml @@ -60,7 +60,7 @@ setuptools-rust = "*" # # If this pinning is removed, we may still need to add a lower bound for the # pylint version. See https://github.com/certbot/certbot/pull/9229. -pylint = "3.0.2" +pylint = "3.3.3" # mypy often adds new checks that we need to conform our code to when updating # dependencies. To help control when this needs to be done, we pin mypy to a # compatible version here. diff --git a/tools/requirements.txt b/tools/requirements.txt index 48074d93a..739cbf958 100644 --- a/tools/requirements.txt +++ b/tools/requirements.txt @@ -7,29 +7,30 @@ # for more info. alabaster==0.7.16 ; python_version >= "3.9" and python_version < "4.0" apacheconfig==0.3.2 ; python_version >= "3.9" and python_version < "4.0" -astroid==3.0.3 ; python_version >= "3.9" and python_version < "4.0" +astroid==3.3.8 ; python_version >= "3.9" and python_version < "4.0" asttokens==3.0.0 ; python_version >= "3.9" and python_version < "4.0" -attrs==24.2.0 ; python_version >= "3.9" and python_version < "4.0" +attrs==24.3.0 ; python_version >= "3.9" and python_version < "4.0" azure-core==1.32.0 ; python_version >= "3.9" and python_version < "4.0" azure-devops==7.1.0b4 ; python_version >= "3.9" and python_version < "4.0" babel==2.16.0 ; python_version >= "3.9" and python_version < "4.0" +backports-tarfile==1.2.0 ; python_version >= "3.9" and python_version < "3.12" bcrypt==4.2.1 ; python_version >= "3.9" and python_version < "4.0" beautifulsoup4==4.12.3 ; python_version >= "3.9" and python_version < "4.0" -boto3==1.35.79 ; python_version >= "3.9" and python_version < "4.0" -botocore==1.35.79 ; python_version >= "3.9" and python_version < "4.0" +boto3==1.35.93 ; python_version >= "3.9" and python_version < "4.0" +botocore==1.35.93 ; python_version >= "3.9" and python_version < "4.0" build==1.2.2.post1 ; python_version >= "3.9" and python_version < "4.0" cachecontrol==0.14.1 ; python_version >= "3.9" and python_version < "4.0" cachetools==5.5.0 ; python_version >= "3.9" and python_version < "4.0" -certifi==2024.8.30 ; python_version >= "3.9" and python_version < "4.0" +certifi==2024.12.14 ; python_version >= "3.9" and python_version < "4.0" cffi==1.17.1 ; python_version >= "3.9" and python_version < "4.0" chardet==5.2.0 ; python_version >= "3.9" and python_version < "4.0" -charset-normalizer==3.4.0 ; python_version >= "3.9" and python_version < "4.0" +charset-normalizer==3.4.1 ; python_version >= "3.9" and python_version < "4.0" cleo==2.1.0 ; python_version >= "3.9" and python_version < "4.0" cloudflare==2.19.4 ; python_version >= "3.9" and python_version < "4.0" colorama==0.4.6 ; python_version >= "3.9" and python_version < "4.0" configargparse==1.7 ; python_version >= "3.9" and python_version < "4.0" configobj==5.0.9 ; python_version >= "3.9" and python_version < "4.0" -coverage==7.6.9 ; python_version >= "3.9" and python_version < "4.0" +coverage==7.6.10 ; python_version >= "3.9" and python_version < "4.0" crashtest==0.4.1 ; python_version >= "3.9" and python_version < "4.0" cryptography==43.0.3 ; python_version >= "3.9" and python_version < "4.0" cython==0.29.37 ; python_version >= "3.9" and python_version < "4.0" @@ -38,10 +39,10 @@ deprecated==1.2.15 ; python_version >= "3.9" and python_version < "4.0" dill==0.3.9 ; python_version >= "3.9" and python_version < "4.0" distlib==0.3.9 ; python_version >= "3.9" and python_version < "4.0" distro==1.9.0 ; python_version >= "3.9" and python_version < "4.0" -dns-lexicon==3.18.0 ; python_version >= "3.9" and python_version < "4.0" +dns-lexicon==3.20.1 ; python_version >= "3.9" and python_version < "4.0" dnspython==2.7.0 ; python_version >= "3.9" and python_version < "4.0" docutils==0.21.2 ; python_version >= "3.9" and python_version < "4.0" -dulwich==0.21.7 ; python_version >= "3.9" and python_version < "4.0" +dulwich==0.22.7 ; python_version >= "3.9" and python_version < "4.0" exceptiongroup==1.2.2 ; python_version >= "3.9" and python_version < "3.11" execnet==2.1.1 ; python_version >= "3.9" and python_version < "4.0" executing==2.1.0 ; python_version >= "3.9" and python_version < "4.0" @@ -49,7 +50,7 @@ fabric==3.2.2 ; python_version >= "3.9" and python_version < "4.0" fastjsonschema==2.21.1 ; python_version >= "3.9" and python_version < "4.0" filelock==3.16.1 ; python_version >= "3.9" and python_version < "4.0" google-api-core==2.24.0 ; python_version >= "3.9" and python_version < "4.0" -google-api-python-client==2.155.0 ; python_version >= "3.9" and python_version < "4.0" +google-api-python-client==2.157.0 ; python_version >= "3.9" and python_version < "4.0" google-auth-httplib2==0.2.0 ; python_version >= "3.9" and python_version < "4.0" google-auth==2.37.0 ; python_version >= "3.9" and python_version < "4.0" googleapis-common-protos==1.66.0 ; python_version >= "3.9" and python_version < "4.0" @@ -65,14 +66,16 @@ ipython==8.18.1 ; python_version >= "3.9" and python_version < "4.0" isodate==0.7.2 ; python_version >= "3.9" and python_version < "4.0" isort==5.13.2 ; python_version >= "3.9" and python_version < "4.0" jaraco-classes==3.4.0 ; python_version >= "3.9" and python_version < "4.0" +jaraco-context==6.0.1 ; python_version >= "3.9" and python_version < "4.0" +jaraco-functools==4.1.0 ; python_version >= "3.9" and python_version < "4.0" jedi==0.19.2 ; python_version >= "3.9" and python_version < "4.0" jeepney==0.8.0 ; python_version >= "3.9" and python_version < "4.0" and sys_platform == "linux" -jinja2==3.1.4 ; python_version >= "3.9" and python_version < "4.0" +jinja2==3.1.5 ; python_version >= "3.9" and python_version < "4.0" jmespath==1.0.1 ; python_version >= "3.9" and python_version < "4.0" josepy==1.14.0 ; python_version >= "3.9" and python_version < "4.0" jsonlines==4.0.0 ; python_version >= "3.9" and python_version < "4.0" -jsonpickle==4.0.0 ; python_version >= "3.9" and python_version < "4.0" -keyring==24.3.1 ; python_version >= "3.9" and python_version < "4.0" +jsonpickle==4.0.1 ; python_version >= "3.9" and python_version < "4.0" +keyring==25.6.0 ; python_version >= "3.9" and python_version < "4.0" markdown-it-py==3.0.0 ; python_version >= "3.9" and python_version < "4.0" markupsafe==3.0.2 ; python_version >= "3.9" and python_version < "4.0" matplotlib-inline==0.1.7 ; python_version >= "3.9" and python_version < "4.0" @@ -83,35 +86,35 @@ msgpack==1.1.0 ; python_version >= "3.9" and python_version < "4.0" msrest==0.7.1 ; python_version >= "3.9" and python_version < "4.0" mypy-extensions==1.0.0 ; python_version >= "3.9" and python_version < "4.0" mypy==1.9.0 ; python_version >= "3.9" and python_version < "4.0" -nh3==0.2.19 ; python_version >= "3.9" and python_version < "4.0" +nh3==0.2.20 ; python_version >= "3.9" and python_version < "4.0" oauthlib==3.2.2 ; python_version >= "3.9" and python_version < "4.0" packaging==24.2 ; python_version >= "3.9" and python_version < "4.0" paramiko==3.5.0 ; python_version >= "3.9" and python_version < "4.0" parsedatetime==2.6 ; python_version >= "3.9" and python_version < "4.0" parso==0.8.4 ; python_version >= "3.9" and python_version < "4.0" -pexpect==4.9.0 ; python_version >= "3.9" and python_version < "4.0" +pexpect==4.9.0 ; python_version >= "3.9" and python_version < "4.0" and sys_platform != "win32" pip==24.3.1 ; python_version >= "3.9" and python_version < "4.0" pkginfo==1.12.0 ; python_version >= "3.9" and python_version < "4.0" platformdirs==4.3.6 ; python_version >= "3.9" and python_version < "4.0" pluggy==1.5.0 ; python_version >= "3.9" and python_version < "4.0" ply==3.11 ; python_version >= "3.9" and python_version < "4.0" -poetry-core==1.9.1 ; python_version >= "3.9" and python_version < "4.0" +poetry-core==2.0.0 ; python_version >= "3.9" and python_version < "4.0" poetry-plugin-export==1.8.0 ; python_version >= "3.9" and python_version < "4.0" -poetry==1.8.5 ; python_version >= "3.9" and python_version < "4.0" +poetry==2.0.0 ; python_version >= "3.9" and python_version < "4.0" prompt-toolkit==3.0.48 ; python_version >= "3.9" and python_version < "4.0" proto-plus==1.25.0 ; python_version >= "3.9" and python_version < "4.0" -protobuf==5.29.1 ; python_version >= "3.9" and python_version < "4.0" -ptyprocess==0.7.0 ; python_version >= "3.9" and python_version < "4.0" +protobuf==5.29.2 ; python_version >= "3.9" and python_version < "4.0" +ptyprocess==0.7.0 ; python_version >= "3.9" and python_version < "4.0" and sys_platform != "win32" pure-eval==0.2.3 ; python_version >= "3.9" and python_version < "4.0" pyasn1-modules==0.4.1 ; python_version >= "3.9" and python_version < "4.0" pyasn1==0.6.1 ; python_version >= "3.9" and python_version < "4.0" pycparser==2.22 ; python_version >= "3.9" and python_version < "4.0" -pygments==2.18.0 ; python_version >= "3.9" and python_version < "4.0" -pylint==3.0.2 ; python_version >= "3.9" and python_version < "4.0" +pygments==2.19.1 ; python_version >= "3.9" and python_version < "4.0" +pylint==3.3.3 ; python_version >= "3.9" and python_version < "4.0" pynacl==1.5.0 ; python_version >= "3.9" and python_version < "4.0" pyopenssl==24.3.0 ; python_version >= "3.9" and python_version < "4.0" pyotp==2.9.0 ; python_version >= "3.9" and python_version < "4.0" -pyparsing==3.2.0 ; python_version >= "3.9" and python_version < "4.0" +pyparsing==3.2.1 ; python_version >= "3.9" and python_version < "4.0" pyproject-api==1.8.0 ; python_version >= "3.9" and python_version < "4.0" pyproject-hooks==1.2.0 ; python_version >= "3.9" and python_version < "4.0" pyrfc3339==2.0.1 ; python_version >= "3.9" and python_version < "4.0" @@ -125,7 +128,7 @@ pytz==2024.2 ; python_version >= "3.9" and python_version < "4.0" pywin32-ctypes==0.2.3 ; python_version >= "3.9" and python_version < "4.0" and sys_platform == "win32" pywin32==308 ; python_version >= "3.9" and python_version < "4.0" and sys_platform == "win32" pyyaml==6.0.2 ; python_version >= "3.9" and python_version < "4.0" -rapidfuzz==3.10.1 ; python_version >= "3.9" and python_version < "4.0" +rapidfuzz==3.11.0 ; python_version >= "3.9" and python_version < "4.0" readme-renderer==44.0 ; python_version >= "3.9" and python_version < "4.0" requests-file==2.1.0 ; python_version >= "3.9" and python_version < "4.0" requests-oauthlib==2.0.0 ; python_version >= "3.9" and python_version < "4.0" @@ -138,7 +141,7 @@ s3transfer==0.10.4 ; python_version >= "3.9" and python_version < "4.0" secretstorage==3.3.3 ; python_version >= "3.9" and python_version < "4.0" and sys_platform == "linux" semantic-version==2.10.0 ; python_version >= "3.9" and python_version < "4.0" setuptools-rust==1.10.2 ; python_version >= "3.9" and python_version < "4.0" -setuptools==75.6.0 ; python_version >= "3.9" and python_version < "4.0" +setuptools==75.7.0 ; python_version >= "3.9" and python_version < "4.0" shellingham==1.5.4 ; python_version >= "3.9" and python_version < "4.0" six==1.17.0 ; python_version >= "3.9" and python_version < "4.0" snowballstemmer==2.2.0 ; python_version >= "3.9" and python_version < "4.0" @@ -158,24 +161,24 @@ tomli==2.2.1 ; python_version >= "3.9" and python_full_version <= "3.11.0a6" tomlkit==0.13.2 ; python_version >= "3.9" and python_version < "4.0" tox==4.23.2 ; python_version >= "3.9" and python_version < "4.0" traitlets==5.14.3 ; python_version >= "3.9" and python_version < "4.0" -trove-classifiers==2024.10.21.16 ; python_version >= "3.9" and python_version < "4.0" +trove-classifiers==2025.1.6.15 ; python_version >= "3.9" and python_version < "4.0" twine==6.0.1 ; python_version >= "3.9" and python_version < "4.0" -types-cffi==1.16.0.20240331 ; python_version >= "3.9" and python_version < "4.0" -types-httplib2==0.22.0.20240310 ; python_version >= "3.9" and python_version < "4.0" +types-cffi==1.16.0.20241221 ; python_version >= "3.9" and python_version < "4.0" +types-httplib2==0.22.0.20241221 ; python_version >= "3.9" and python_version < "4.0" types-pyopenssl==24.1.0.20240722 ; python_version >= "3.9" and python_version < "4.0" types-pyrfc3339==2.0.1.20241107 ; python_version >= "3.9" and python_version < "4.0" types-python-dateutil==2.9.0.20241206 ; python_version >= "3.9" and python_version < "4.0" -types-pytz==2024.2.0.20241003 ; python_version >= "3.9" and python_version < "4.0" -types-pywin32==308.0.0.20241128 ; python_version >= "3.9" and python_version < "4.0" +types-pytz==2024.2.0.20241221 ; python_version >= "3.9" and python_version < "4.0" +types-pywin32==308.0.0.20241221 ; python_version >= "3.9" and python_version < "4.0" types-requests==2.31.0.6 ; python_version >= "3.9" and python_version < "4.0" -types-setuptools==75.6.0.20241126 ; python_version >= "3.9" and python_version < "4.0" +types-setuptools==75.6.0.20241223 ; python_version >= "3.9" and python_version < "4.0" types-urllib3==1.26.25.14 ; python_version >= "3.9" and python_version < "4.0" typing-extensions==4.12.2 ; python_version >= "3.9" and python_version < "4.0" uritemplate==4.1.1 ; python_version >= "3.9" and python_version < "4.0" urllib3==1.26.20 ; python_version >= "3.9" and python_version < "4.0" -virtualenv==20.28.0 ; python_version >= "3.9" and python_version < "4.0" +virtualenv==20.28.1 ; python_version >= "3.9" and python_version < "4.0" wcwidth==0.2.13 ; python_version >= "3.9" and python_version < "4.0" wheel==0.45.1 ; python_version >= "3.9" and python_version < "4.0" wrapt==1.17.0 ; python_version >= "3.9" and python_version < "4.0" -xattr==1.1.0 ; python_version >= "3.9" and python_version < "4.0" and sys_platform == "darwin" +xattr==1.1.4 ; python_version >= "3.9" and python_version < "4.0" and sys_platform == "darwin" zipp==3.21.0 ; python_version >= "3.9" and python_version < "3.12"