From 11faa0e67d6e70ff7f48266e9a57e733e42dd009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Beraud?= Date: Mon, 7 Nov 2022 10:54:38 +0100 Subject: [PATCH] Fix linters and bindep on jammy Bump linter requirements - follow the changes made in keystone in commits 6dfde5b48b388e32e34a385c3a9ef48da7c7c49b and 5c71ebd7a92d25df83e2e7cc5fad9990e9eebbf5 in order to fix compatibility with Python 3.10. Remove python-dev from bindep - it's no longer supported by jammy and lead us to the following errors with the announce-release job: ``` No package matching 'python-dev' is available ``` Co-Authored-By: Herve Beraud Change-Id: If687a2678733ce018bd31c602140f073ab1a1a65 --- bindep.txt | 2 +- keystoneauth1/discover.py | 2 +- keystoneauth1/identity/v3/oauth2_client_credential.py | 3 --- keystoneauth1/identity/v3/oidc.py | 2 +- test-requirements.txt | 5 ++--- tox.ini | 4 +++- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/bindep.txt b/bindep.txt index 6d2470ac..be82c774 100644 --- a/bindep.txt +++ b/bindep.txt @@ -2,7 +2,7 @@ # see https://docs.openstack.org/infra/bindep/ for additional information. build-essential [platform:dpkg test] -python-dev [platform:dpkg test] +python3-dev [platform:dpkg test] python3-devel [platform:rpm test] libkrb5-dev [platform:dpkg test] krb5-devel [platform:rpm test] diff --git a/keystoneauth1/discover.py b/keystoneauth1/discover.py index af06db3c..f586e95a 100644 --- a/keystoneauth1/discover.py +++ b/keystoneauth1/discover.py @@ -197,7 +197,7 @@ def normalize_version_number(version): Examples: (1,), [1, 2], ('12', '34', '56'), (LATEST,), (2, 'latest') :return: A tuple of len >= 2 comprising integers and/or LATEST. :raises TypeError: If the input version cannot be interpreted. - """ + """ # noqa: D412 # Copy the input var so the error presents the original value ver = version diff --git a/keystoneauth1/identity/v3/oauth2_client_credential.py b/keystoneauth1/identity/v3/oauth2_client_credential.py index ff923d19..dac91df5 100644 --- a/keystoneauth1/identity/v3/oauth2_client_credential.py +++ b/keystoneauth1/identity/v3/oauth2_client_credential.py @@ -46,7 +46,6 @@ class OAuth2ClientCredentialMethod(base.AuthMethod): data for the auth type. :rtype: tuple(string, dict) """ - auth_data = { 'id': self.oauth2_client_id, 'secret': self.oauth2_client_secret @@ -67,7 +66,6 @@ class OAuth2ClientCredentialMethod(base.AuthMethod): should be prefixed with the plugin identifier. For example the password plugin returns its username value as 'password_username'. """ - return dict(('oauth2_client_credential_%s' % p, getattr(self, p)) for p in self._method_parameters) @@ -100,7 +98,6 @@ class OAuth2ClientCredential(base.AuthConstructor): dict is a valid, non-failure response. :rtype: dict """ - # get headers for X-Auth-Token headers = super(OAuth2ClientCredential, self).get_headers( session, **kwargs) diff --git a/keystoneauth1/identity/v3/oidc.py b/keystoneauth1/identity/v3/oidc.py index 4d010f44..39855463 100644 --- a/keystoneauth1/identity/v3/oidc.py +++ b/keystoneauth1/identity/v3/oidc.py @@ -452,7 +452,7 @@ class OidcAccessToken(_OidcBase): self.access_token = access_token def get_payload(self, session): - """OidcAccessToken does not require a payload.""" + """OidcAccessToken does not require a payload.""" # noqa: D403 return {} def get_unscoped_auth_ref(self, session): diff --git a/test-requirements.txt b/test-requirements.txt index bb35c198..7f7b131f 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,10 +2,9 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking>=3.0.1,<3.1.0 # Apache-2.0 -flake8-docstrings==0.2.1.post1 # MIT +hacking~=4.1.0 # Apache-2.0 +flake8-docstrings~=1.6.0 # MIT flake8-import-order>=0.17.1 #LGPLv3 -pycodestyle>=2.0.0,<2.6.0 # MIT bandit<1.6.0,>=1.1.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 8ed5887b..45284278 100644 --- a/tox.ini +++ b/tox.ini @@ -53,10 +53,12 @@ commands = oslo_debug_helper -t keystoneauth1/tests {posargs} # D102: Missing docstring in public method # D103: Missing docstring in public function # D104: Missing docstring in public package +# D107: Missing docstring in __init__ # D203: 1 blank line required before class docstring (deprecated in pep257) +# D401: First line should be in imperative mood; try rephrasing # W503 line break before binary operator # W504 line break after binary operator -ignore = D100,D101,D102,D103,D104,D203,W503,W504 +ignore = D100,D101,D102,D103,D104,D107,D203,D401,W503,W504 # H106: Don’t put vim configuration in source files # H203: Use assertIs(Not)None to check for None enable-extensions=H106,H203