From f4dafbeef63f206957d394c80d05a38a111153cf Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Wed, 21 May 2025 17:56:01 +0100 Subject: [PATCH] Move mypy configuration to pyproject.toml Change-Id: I5938f47c5941bdbe57f2219a78153d5431e93eb7 Signed-off-by: Stephen Finucane --- .pre-commit-config.yaml | 1 - mypy.ini | 20 -------------------- pyproject.toml | 16 ++++++++++++++++ tox.ini | 2 +- 4 files changed, 17 insertions(+), 22 deletions(-) delete mode 100644 mypy.ini diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e9aee93c07a..b7b269e0fdf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -51,7 +51,6 @@ repos: rev: v1.14.1 hooks: - id: mypy - args: [--config-file=./mypy.ini] pass_filenames: false # need to list alembic here; otherwise it doesn't see internals # necessary to detect one of 'ignored' errors and complains about diff --git a/mypy.ini b/mypy.ini deleted file mode 100644 index b65d4d47c8f..00000000000 --- a/mypy.ini +++ /dev/null @@ -1,20 +0,0 @@ -# Config file options: https://mypy.readthedocs.io/en/stable/config_file.html - -[mypy] -incremental = True -pretty = True -show_error_context = True -show_column_numbers = True -warn_unused_ignores = True -# remove gradually as progress is made -disable_error_code = import-untyped,var-annotated,import-not-found - -# honor excludes by not following there through imports -follow_imports = silent - -files = neutron - -# NOTE: Gradually enable type checking for each package. -# Finally, when the whole repo is migrated this option can be deleted -# and rules applied to the whole repo. -exclude = (?x)(^neutron/tests/$) diff --git a/pyproject.toml b/pyproject.toml index 5e862a9593a..428af22b453 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,19 @@ [build-system] requires = ["pbr>=6.0.0", "setuptools>=64.0.0"] build-backend = "pbr.build" + +[tool.mypy] +incremental = true +pretty = true +show_error_context = true +show_column_numbers = true +warn_unused_ignores = true +# remove gradually as progress is made +disable_error_code = "import-untyped,var-annotated,import-not-found" +# honor excludes by not following there through imports +follow_imports = "silent" +files = "neutron" +# NOTE: Gradually enable type checking for each package. +# Finally, when the whole repo is migrated this option can be deleted +# and rules applied to the whole repo. +exclude = "(?x)(^neutron/tests/$)" diff --git a/tox.ini b/tox.ini index 88c35dc24ce..48327f4a2a2 100644 --- a/tox.ini +++ b/tox.ini @@ -124,7 +124,7 @@ commands = [testenv:mypy] deps = {[testenv:pep8]deps} -commands = mypy --config-file ./mypy.ini +commands = mypy [testenv:releasenotes] description =