diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 34ee445..fa95ed5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,24 +13,24 @@ repos: - id: check-yaml files: .*\.(yaml|yml)$ - repo: https://opendev.org/openstack/hacking - rev: 7.0.0 + rev: 8.0.0 hooks: - id: hacking additional_dependencies: [] exclude: '^(doc|releasenotes|tools)/.*$' - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.13.0 + rev: v0.14.5 hooks: - - id: ruff + - id: ruff-check args: ['--fix', '--unsafe-fixes'] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.17.1 + rev: v1.18.2 hooks: - id: mypy additional_dependencies: [ 'types-requests', - 'types-WebOb>=1.8.0.20250319', + 'types-WebOb>=1.8.0.20250822', ] # keep this in-sync with '[tool.mypy] exclude' in 'pyproject.toml' exclude: | diff --git a/oslo_middleware/base.py b/oslo_middleware/base.py index dab966e..21029c5 100644 --- a/oslo_middleware/base.py +++ b/oslo_middleware/base.py @@ -141,7 +141,7 @@ class ConfigurableMiddleware: """Do whatever you'd like to the response.""" return response - @webob.dec.wsgify(RequestClass=NoContentTypeRequest) # type: ignore + @webob.dec.wsgify(RequestClass=NoContentTypeRequest) def __call__( self, req: webob.request.Request, diff --git a/oslo_middleware/cors.py b/oslo_middleware/cors.py index 7926bff..8f73adb 100644 --- a/oslo_middleware/cors.py +++ b/oslo_middleware/cors.py @@ -313,9 +313,7 @@ class CORS(base.ConfigurableMiddleware): return response # Doublecheck for an OPTIONS request. - # TODO(stephenfin): typeshed typing is incomplete and doesn't include - # OPTIONS - if request.method == 'OPTIONS': # type: ignore + if request.method == 'OPTIONS': return self._apply_cors_preflight_headers( request=request, response=response ) diff --git a/pyproject.toml b/pyproject.toml index 7ba7d73..44a3a34 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,22 +77,7 @@ select = ["E4", "E7", "E9", "F", "S", "UP"] python_version = "3.10" show_column_numbers = true show_error_context = true -ignore_missing_imports = true -follow_imports = "normal" -check_untyped_defs = true -warn_unused_ignores = false -warn_return_any = true -warn_unused_configs = true -warn_redundant_casts = true -strict_equality = true -disallow_untyped_decorators = true -disallow_any_generics = true -disallow_subclassing_any = true -disallow_untyped_calls = true -disallow_incomplete_defs = true -disallow_untyped_defs = true -no_implicit_reexport = true -extra_checks = true +strict = true # keep this in-sync with 'mypy.exclude' in '.pre-commit-config.yaml' exclude = ''' (?x)(