pre-commit: Bump versions

We apply fold in the new black changes also.

Change-Id: I632728aa81e6c55423c0275a0a9b35e0753980a6
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2024-04-23 12:13:19 +01:00
parent a39bc3c855
commit e67a7b14b9
11 changed files with 35 additions and 42 deletions

View File

@ -4,7 +4,7 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: mixed-line-ending
@ -22,7 +22,7 @@ repos:
hooks:
- id: doc8
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.4.0
hooks:
- id: black
args: ['-S', '-l', '79']
@ -34,7 +34,7 @@ repos:
- flake8-import-order~=0.18.2
exclude: '^(doc|releasenotes|tools)/.*$'
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
rev: v1.9.0
hooks:
- id: mypy
additional_dependencies:

View File

@ -1780,8 +1780,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
name_or_id: str,
ignore_missing: ty.Literal[True] = True,
**query,
) -> ty.Optional[_service.Service]:
...
) -> ty.Optional[_service.Service]: ...
@ty.overload
def find_service(
@ -1789,8 +1788,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
name_or_id: str,
ignore_missing: ty.Literal[False],
**query,
) -> _service.Service:
...
) -> _service.Service: ...
# excuse the duplication here: it's mypy's fault
# https://github.com/python/mypy/issues/14764
@ -1800,8 +1798,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
name_or_id: str,
ignore_missing: bool,
**query,
) -> ty.Optional[_service.Service]:
...
) -> ty.Optional[_service.Service]: ...
def find_service(
self,

View File

@ -323,12 +323,12 @@ class SecurityGroupCloudMixin:
# as the equivalent value.
rule_def = {
'security_group_id': secgroup['id'],
'port_range_min': None
if port_range_min == -1
else port_range_min,
'port_range_max': None
if port_range_max == -1
else port_range_max,
'port_range_min': (
None if port_range_min == -1 else port_range_min
),
'port_range_max': (
None if port_range_max == -1 else port_range_max
),
'protocol': protocol,
'remote_ip_prefix': remote_ip_prefix,
'remote_group_id': remote_group_id,

View File

@ -21,8 +21,7 @@ class TagMixin:
_body: resource._ComponentManager
@classmethod
def _get_session(cls, session):
...
def _get_session(cls, session): ...
_tag_query_parameters = {
'tags': 'tags',

View File

@ -558,9 +558,9 @@ class Connection(
self.config._influxdb_config
and 'additional_metric_tags' in self.config.config
):
self.config._influxdb_config[
'additional_metric_tags'
] = self.config.config['additional_metric_tags']
self.config._influxdb_config['additional_metric_tags'] = (
self.config.config['additional_metric_tags']
)
# Register cleanup steps
atexit.register(self.close)

View File

@ -41,8 +41,7 @@ class DownloadMixin:
resource_response_key=None,
microversion=None,
**params,
):
...
): ...
def download(
self,

View File

@ -484,8 +484,7 @@ class Proxy(adapter.Adapter):
name_or_id: str,
ignore_missing: ty.Literal[True] = True,
**attrs,
) -> ty.Optional[ResourceType]:
...
) -> ty.Optional[ResourceType]: ...
@ty.overload
def _find(
@ -494,8 +493,7 @@ class Proxy(adapter.Adapter):
name_or_id: str,
ignore_missing: ty.Literal[False],
**attrs,
) -> ResourceType:
...
) -> ResourceType: ...
# excuse the duplication here: it's mypy's fault
# https://github.com/python/mypy/issues/14764
@ -506,8 +504,7 @@ class Proxy(adapter.Adapter):
name_or_id: str,
ignore_missing: bool,
**attrs,
) -> ty.Optional[ResourceType]:
...
) -> ty.Optional[ResourceType]: ...
def _find(
self,

View File

@ -2258,8 +2258,7 @@ class Resource(dict):
microversion: ty.Optional[str] = None,
all_projects: ty.Optional[bool] = None,
**params,
) -> ty.Optional['Resource']:
...
) -> ty.Optional['Resource']: ...
@ty.overload
@classmethod
@ -2273,8 +2272,7 @@ class Resource(dict):
microversion: ty.Optional[str] = None,
all_projects: ty.Optional[bool] = None,
**params,
) -> 'Resource':
...
) -> 'Resource': ...
# excuse the duplication here: it's mypy's fault
# https://github.com/python/mypy/issues/14764
@ -2290,8 +2288,7 @@ class Resource(dict):
microversion: ty.Optional[str] = None,
all_projects: ty.Optional[bool] = None,
**params,
):
...
): ...
@classmethod
def find(

View File

@ -31,7 +31,6 @@ _TRUE_VALUES = ('true', '1', 'yes')
class TestCase(base.BaseTestCase):
"""Test case base class for all tests."""
# A way to adjust slow test classes

View File

@ -199,9 +199,11 @@ class TestRoleAssignment(base.TestCase):
uri=self.get_mock_url(resource='users'),
status_code=200,
json={
'users': [user_data.json_response['user']]
if is_found
else []
'users': (
[user_data.json_response['user']]
if is_found
else []
)
},
)
)
@ -215,9 +217,11 @@ class TestRoleAssignment(base.TestCase):
),
status_code=200,
json={
'users': [user_data.json_response['user']]
if is_found
else []
'users': (
[user_data.json_response['user']]
if is_found
else []
)
},
)
)

View File

@ -146,13 +146,14 @@ application-import-names = openstack
# if they fix ALL of the occurances of one and only one of them.
# E203 Black will put spaces after colons in list comprehensions
# E501 Black takes care of line length for us
# E704 Black will occasionally put multiple statements on one line
# H238 New Style Classes are the default in Python3
# H301 Black will put commas after imports that can't fit on one line
# H4 Are about docstrings and there's just a huge pile of pre-existing issues.
# W503 Is supposed to be off by default but in the latest pycodestyle isn't.
# Also, both openstacksdk and Donald Knuth disagree with the rule. Line
# breaks should occur before the binary operator for readability.
ignore = E203, E501, H301, H238, H4, W503
ignore = E203, E501, E704, H301, H238, H4, W503
import-order-style = pep8
show-source = True
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,openstack/_services_mixin.py