@@ -102,3 +102,94 @@ known_first_party = ["mddj"]
102102
103103[tool .check-sdist ]
104104git-only = [" .*" , " Makefile" , " docs/*" , " scripts/*" ]
105+
106+
107+ [tool .tox ]
108+ requires = [" tox>=4.22" ]
109+ env_list = [
110+ " lint" ,
111+ " mypy" ,
112+ " covclean" ,
113+ " covcombine" ,
114+ " covreport" ,
115+ " 3.8" ,
116+ " 3.9" ,
117+ " 3.10" ,
118+ " 3.11" ,
119+ " 3.12" ,
120+ " 3.13" ,
121+ " 3.14" ,
122+ ]
123+
124+ [tool .tox .labels ]
125+ ci = [" 3.8" , " 3.9" , " 3.10" , " 3.11" , " 3.12" , " 3.13" , " 3.14" , " covcombine" , " covreport" ]
126+ ci-mypy = [" mypy-py38" , " mypy-py313" ]
127+ ci-package-check = [" twine-check" ]
128+
129+ [tool .tox .env_run_base ]
130+ description = " Run tests and coverage"
131+ package = " wheel"
132+ wheel_build_env = " build_wheel"
133+ dependency_groups = [" test" ]
134+ commands = [[" coverage" , " run" , " -m" , " pytest" , " -v" , {replace = " posargs" , extend = true }]]
135+ depends = [" clean" ]
136+
137+ [tool .tox .env .covclean ]
138+ description = " Clean coverage outputs"
139+ skip_install = true
140+ dependency_groups = [" coverage" ]
141+ commands = [[" coverage" , " erase" ]]
142+
143+ [tool .tox .env .covcombine ]
144+ description = " Combine coverage outputs"
145+ skip_install = true
146+ dependency_groups = [" coverage" ]
147+ commands = [[" coverage" , " combine" ]]
148+ depends = [" 3.8" , " 3.9" , " 3.10" , " 3.11" , " 3.12" , " 3.13" ]
149+
150+ [tool .tox .env .covreport ]
151+ description = " Report on combined coverage outputs"
152+ skip_install = true
153+ dependency_groups = [" coverage" ]
154+ commands_pre = [[" coverage" , " html" , " --fail-under=0" ]]
155+ commands = [[" coverage" , " report" ]]
156+ depends = [" covcombine" ]
157+
158+ [tool .tox .env .lint ]
159+ description = " Run linterse and formatters"
160+ dependency_groups = [" lint" ]
161+ commands = [[" pre-commit" , " run" , " -a" , {replace = " posargs" , extend = true }]]
162+ depends = []
163+
164+ [tool .tox .env .mypy ]
165+ package = " skip"
166+ description = " Run static type checking under {base_python}"
167+ dependency_groups = [" typing" ]
168+ commands = [[" mypy" , " src/" , {replace = " posargs" , extend = true } ]]
169+ depends = []
170+
171+ [tool .tox .env .mypy-py38 ]
172+ base = [" tool.tox.env.mypy" ]
173+
174+ [tool .tox .env .mypy-py313 ]
175+ base = [" env.mypy" ]
176+
177+ [tool .tox .env .twine-check ]
178+ description = " check the metadata on a package build"
179+ allowlist_externals = [" rm" ]
180+ dependency_groups = [" build" ]
181+ commands_pre = [[" rm" , " -rf" , " dist/" ]]
182+ # check that twine validating package data works
183+ commands = [[" python" , " -m" , " build" ],
184+ [" twine" , " check" , " dist/*" ]]
185+
186+
187+ [tool .tox .env .docs ]
188+ description = " build docs with sphinx"
189+ basepython = [" python3.12" ]
190+ dependency_groups = [" docs" ]
191+ allowlist_externals = [" rm" ]
192+ changedir = " docs/"
193+ # clean the build dir before rebuilding
194+ commands_pre = [[" rm" , " -rf" , " _build/" ]]
195+ commands = [[" sphinx-build" , " -d" , " _build/doctrees" , " -b" , " dirhtml" , " -W" , " ." , " _build/dirhtml" , {replace = " posargs" , extend = true }]]
0 commit comments