Merge "Run mypy from tox"

This commit is contained in:
Zuul
2025-12-05 18:53:31 +00:00
committed by Gerrit Code Review
3 changed files with 21 additions and 31 deletions

View File

@@ -12,30 +12,14 @@ repos:
- id: debug-statements
- id: check-yaml
files: .*\.(yaml|yml)$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.8
hooks:
- id: ruff-check
args: ['--fix', '--unsafe-fixes']
- id: ruff-format
- repo: https://opendev.org/openstack/hacking
rev: 8.0.0
hooks:
- id: hacking
additional_dependencies: []
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.5
hooks:
- id: ruff-check
args: ['--fix', '--unsafe-fixes']
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.18.2
hooks:
- id: mypy
additional_dependencies: [
'fixtures',
'keystoneauth',
'oslo.i18n',
'openstacksdk',
]
# keep this in-sync with '[tool.mypy] exclude' in 'pyproject.toml'
exclude: |
(?x)(
doc/.*
| releasenotes/.*
)

View File

@@ -44,15 +44,9 @@ packages = [
python_version = "3.10"
show_column_numbers = true
show_error_context = true
ignore_missing_imports = true
strict = true
# keep this in-sync with 'mypy.exclude' in '.pre-commit-config.yaml'
exclude = '''
(?x)(
doc
| releasenotes
)
'''
ignore_missing_imports = true
exclude = '(?x)(doc | releasenotes)'
[[tool.mypy.overrides]]
module = ["oslo_limit.tests.*"]

14
tox.ini
View File

@@ -12,11 +12,23 @@ commands =
stestr slowest
[testenv:pep8]
skip_install = true
description =
Run style checks.
deps =
pre-commit>=2.6.0 # MIT
{[testenv:mypy]deps}
commands =
pre-commit run -a
{[testenv:mypy]commands}
[testenv:mypy]
description =
Run type checks.
deps =
{[testenv]deps}
mypy
commands =
mypy --cache-dir="{envdir}/mypy_cache" {posargs:oslo_limit}
[testenv:venv]
commands = {posargs}