Skip to content

Commit 877aa5e

Browse files
committed
Merge tox configs into pyproject.toml
- Increase tox requirement to 4.21.2 to support native TOML configuration.
1 parent 83ca5fe commit 877aa5e

2 files changed

Lines changed: 55 additions & 57 deletions

File tree

pyproject.toml

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ lint = [
7777
"isort>=5.9.2",
7878
]
7979
build = [
80-
"tox>=4.3.3",
80+
"tox>=4.21.2",
8181
]
8282
dev = [
8383
{include-group = "lint"},
@@ -139,3 +139,57 @@ include_trailing_comma = true
139139
extend_skip = [
140140
"setup.py",
141141
]
142+
143+
[tool.tox]
144+
env_list = ["py314", "py313", "py312", "py311", "py310", "py39", "py38"]
145+
min_version = "4.22"
146+
147+
[tool.tox.env_run_base]
148+
description = "run unit tests"
149+
package = "editable"
150+
extras = ["adhoc_ssl"]
151+
commands = [["python", "-m", "unittest", {replace = "posargs", extend = true}]]
152+
153+
[tool.tox.env.build]
154+
description = "build a binary executable"
155+
package = "sdist"
156+
deps = [
157+
"pyinstaller",
158+
]
159+
extras = []
160+
commands = [["python", "tools/build.py", {replace = "posargs", extend = true}]]
161+
162+
[tool.tox.env.release]
163+
description = "build and release to PyPI"
164+
package = "skip"
165+
deps = [
166+
"build",
167+
"twine",
168+
]
169+
extras = []
170+
pass_env = [
171+
"TWINE_USERNAME",
172+
"TWINE_PASSWORD",
173+
]
174+
commands = [
175+
# Purge previously built files by bdist (wheel) to prevent deleted files
176+
# being included in the package.
177+
["python", "-c", "import shutil; shutil.rmtree('build', ignore_errors=True)"],
178+
179+
["python", "-m", "build", "--sdist", "--wheel"],
180+
["python", "-m", "twine", "upload", "--skip-existing", "dist/*"],
181+
]
182+
183+
[tool.tox.env.lint]
184+
description = "lint source code"
185+
package = "skip"
186+
dependency_groups = ["lint"]
187+
extras = []
188+
commands = [["flake8", {replace = "posargs", default = ["."], extend = true}]]
189+
190+
[tool.tox.env.isort]
191+
description = "sort imports for the source code"
192+
package = "skip"
193+
dependency_groups = ["lint"]
194+
extras = []
195+
commands = [["isort", {replace = "posargs", default = ["."], extend = true}]]

tox.ini

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)