This is an example of migrating a module to use type annotations, following the gradual migration strategy. Changes to `i18n.py`: - Add `from __future__ import annotations` - Add `from typing import Callable` import - Add type annotations for translation function and variables - Add type: ignore[no-redef] comment to suppress mypy warning about conditional definition of _ in try/except/else blocks Changes to pyproject.toml: - Add `ironicclient/common/i18n.py` to mypy files list for type checking Change-Id: Iffd9b5aff0530c2ddde0889cc31aa99e64b7f5a2 Signed-off-by: Karan Anand <anandkarancompsci@gmail.com>
14 lines
382 B
TOML
14 lines
382 B
TOML
[build-system]
|
|
requires = ["pbr>=6.0.0", "setuptools>=64.0.0"]
|
|
build-backend = "pbr.build"
|
|
|
|
[tool.mypy]
|
|
python_version = "3.10"
|
|
warn_return_any = true
|
|
warn_unused_configs = true
|
|
ignore_missing_imports = true
|
|
# Modules that have been fully type-annotated. Add modules here as they are
|
|
# migrated to enable strict type checking for them.
|
|
files = [
|
|
"ironicclient/common/i18n.py",
|
|
] |