Description
I'm trying to set up thx on the Black repo which is currently using tox. Main motivation is to have watch mode running lints (using precommit) and tests (using pytest).
In Black, we run 3 sets of tests:
- regular test cases + ones marked with
no_jupyter, which exercise Black's behavior when black[jupyter] is not installed
- regular test cases + ones marked with
jupyter
- fuzz tests
Each of these have slightly different (conflicting) sets of dependencies to be installed in the venv. The tox config currently recreates the venv on each test run and installs the correct deps before each test step. That's suboptimal for running the tests continuously.
What if thx could support separate venvs for jobs? Ideally in the above case I'd like to have at least two venvs: one that has black[jupyter] installed and one that doesn't. Ideally of course, I'd have a third one for fuzzing that also has hypothesmith and lark-parser installed.
Config format strawman
[tool.thx]
python_versions = ["3.9", "3.10"]
requirements = ["common_requirements.txt"]
[tool.thx.jobs.lint]
run = "pre-commit run -a"
once = true
[tool.thx.jobs.test_no_jupyter]
run = [
"coverage erase",
"pytest tests --run-optional no_jupyter --cov",
"coverage report",
]
requirements = ["test_no_jupyter_requirements.txt"] # merged with common
[tool.thx.jobs.test_jupyter]
run = [
"coverage erase",
"pytest tests --run-optional jupyter -m jupyter --cov",
"coverage report",
]
requirements = ["test_jupyter_requirements.txt"] # merged with common
Description
I'm trying to set up
thxon the Black repo which is currently using tox. Main motivation is to have watch mode running lints (using precommit) and tests (using pytest).In Black, we run 3 sets of tests:
no_jupyter, which exercise Black's behavior whenblack[jupyter]is not installedjupyterEach of these have slightly different (conflicting) sets of dependencies to be installed in the venv. The tox config currently recreates the venv on each test run and installs the correct deps before each test step. That's suboptimal for running the tests continuously.
What if
thxcould support separate venvs for jobs? Ideally in the above case I'd like to have at least two venvs: one that hasblack[jupyter]installed and one that doesn't. Ideally of course, I'd have a third one for fuzzing that also hashypothesmithandlark-parserinstalled.Config format strawman