Skip to content

Commit 9de5e58

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Bump Python version used for linters to 3.10"
2 parents 05accdd + 7c7c066 commit 9de5e58

5 files changed

Lines changed: 6 additions & 7 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ repos:
1515
files: .*\.(yaml|yml)$
1616
args: ['--unsafe']
1717
- repo: https://github.com/astral-sh/ruff-pre-commit
18-
rev: v0.11.2
18+
rev: v0.11.8
1919
hooks:
2020
- id: ruff
2121
args: ['--fix', '--unsafe-fixes']

openstackclient/compute/v2/server.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import json
2222
import logging
2323
import os
24-
import typing as ty
2524

2625
from cliff import columns as cliff_columns
2726
import iso8601
@@ -1874,7 +1873,7 @@ def _match_image(image_api, wanted_properties):
18741873

18751874
# Default to empty list if nothing was specified and let nova
18761875
# decide the default behavior.
1877-
networks: ty.Union[str, list[dict[str, str]], None] = []
1876+
networks: str | list[dict[str, str]] | None = []
18781877

18791878
if 'auto' in parsed_args.nics or 'none' in parsed_args.nics:
18801879
if len(parsed_args.nics) > 1:

openstackclient/shell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def _load_plugins(self):
9494
# instead.
9595
mod_versions = getattr(mod, 'API_VERSIONS', None)
9696
if mod_versions is not None and not isinstance(
97-
mod_versions, (dict, tuple)
97+
mod_versions, dict | tuple
9898
):
9999
raise TypeError(
100100
f'Plugin {mod} has incompatible API_VERSIONS. '

openstackclient/tests/unit/volume/v2/fakes.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import copy
1616
import random
17-
import typing as ty
1817
from unittest import mock
1918
import uuid
2019

@@ -92,7 +91,7 @@ def setUp(self):
9291
self.volume_sdk_client = self.app.client_manager.sdk_connection.volume
9392
self.set_volume_api_version() # default to the lowest
9493

95-
def set_volume_api_version(self, version: ty.Optional[str] = None):
94+
def set_volume_api_version(self, version: str | None = None):
9695
"""Set a fake block storage API version.
9796
9897
:param version: The fake microversion to "support". This must be None

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tool.mypy]
2-
python_version = "3.9"
2+
python_version = "3.10"
33
show_column_numbers = true
44
show_error_context = true
55
ignore_missing_imports = true
@@ -22,6 +22,7 @@ ignore_errors = true
2222

2323
[tool.ruff]
2424
line-length = 79
25+
target-version = "py310"
2526

2627
[tool.ruff.format]
2728
quote-style = "preserve"

0 commit comments

Comments
 (0)