Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate venv per job #42

Open
zsol opened this issue May 30, 2022 · 0 comments
Open

Separate venv per job #42

zsol opened this issue May 30, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@zsol
Copy link

zsol commented May 30, 2022

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:

  1. regular test cases + ones marked with no_jupyter, which exercise Black's behavior when black[jupyter] is not installed
  2. regular test cases + ones marked with jupyter
  3. 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
@amyreese amyreese added the enhancement New feature or request label Sep 18, 2022
@amyreese amyreese self-assigned this Sep 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants