@@ -22,15 +22,28 @@ docker = [
2222lint = [
2323 " molecule>=25.7.0" ,
2424 " pre-commit>=4.1" ,
25- " pre-commit-uv>=4.1.4" ,
26- " toml>=0.10.2"
25+ " pre-commit-uv>=4.1.4"
2726]
2827pkg = [
2928 " build>=0.9" ,
3029 " pip>=25.2" ,
3130 " pipx>=1.7.1" ,
3231 " twine>=4.0.1"
3332]
33+ type = [
34+ " types-docker" ,
35+ " mypy>=1.17.1" ,
36+ " mypy-baseline>=0.7.3" ,
37+ " pytest" , # for mypy
38+ " toml>=0.10.2" ,
39+ " types-toml>=0.10.8.20240310" ,
40+ " openstacksdk>=4.7.0" ,
41+ " boto3>=1.40.26" ,
42+ " google-auth>=2.40.3" ,
43+ " python-vagrant>=1.0.0" ,
44+ " ansible-core>=2.17.13" ,
45+ " pycryptodome>=3.23.0"
46+ ]
3447
3548[project ]
3649# https://peps.python.org/pep-0621/#readme
@@ -122,16 +135,36 @@ changelog = "https://github.com/ansible-community/molecule-plugins/releases"
122135[tool .codespell ]
123136skip = " uv.lock"
124137
138+ [tool .mypy ]
139+ files = " ."
140+ color_output = true
141+ error_summary = true
142+ # explicit_package_bases = true
143+ namespace_packages = false
144+ exclude = [
145+ " .ansible" ,
146+ " .cache" ,
147+ " .tox" ,
148+ " .venv" ,
149+ " node_modules" ,
150+ " build" ,
151+ " dist" ,
152+ " site" ,
153+ " scenarios"
154+ ]
155+ strict = true
156+
125157[tool .pytest .ini_options ]
126158addopts = " -v -rxXs --doctest-modules --durations 10 -p no:pytest_ansible"
127159doctest_optionflags = " ALLOW_UNICODE ELLIPSIS"
128160junit_suite_name = " molecule_test_suite"
129161norecursedirs = [" dist" , " doc" , " build" , " .tox" , " .eggs" , " src" , " test/*/scenarios" , " test/*/resources" ]
130162
131163[tool .ruff ]
132- target-version = " py39 "
164+ target-version = " py310 "
133165# Same as Black.
134166line-length = 88
167+ unsafe-fixes = true
135168lint.ignore = [
136169 " E501" , # we use black
137170 # we deliberately ignore these:
@@ -195,12 +228,13 @@ uv_sync_flags = ["--upgrade", "--prerelease=allow"]
195228uv_sync_locked = false
196229
197230[tool .tox .env .lint ]
198- dependency_groups = [" lint" ]
231+ dependency_groups = [" lint" , " dev " , " type " ]
199232description = " Run all linters"
200233runner = " uv-venv-lock-runner"
201- skip_install = false
202234commands_pre = []
203235commands = [
236+ # move inside a pre-commit hook once https://github.com/orsinium-labs/mypy-baseline/pull/30 is released
237+ [" bash" , " -c" , " mypy --no-error-summary --hide-error-context | mypy-baseline filter --hide-stats --allow-unsynced && mypy --no-error-summary --hide-error-context | mypy-baseline sync --sort-baseline" ],
204238 [" pre-commit" , " run" , " -a" ],
205239 [" bash" , " {tox_root}/tools/generate-templates.sh" ],
206240 [" rm" , " -rf" , " test/roles" ]
0 commit comments