Skip to content
This repository was archived by the owner on Mar 13, 2024. It is now read-only.

Commit dd95a77

Browse files
coretlgilesknap
authored andcommitted
Improve tox-direct handling
- Environment variable no longer needs to be set - All commands run with tox-direct by default - All environment variables passed through
1 parent 9da307f commit dd95a77

File tree

2 files changed

+13
-17
lines changed

2 files changed

+13
-17
lines changed

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ RUN pip install --upgrade pip build && \
2929
# set up a virtual environment and put it in PATH
3030
RUN python -m venv /venv
3131
ENV PATH=/venv/bin:$PATH
32-
ENV TOX_DIRECT=1
3332

3433
# install the wheel and generate the requirements file
3534
RUN pip install --upgrade pip && \

setup.cfg

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -106,24 +106,21 @@ source =
106106
# NOTE that we pre-install all tools in the dev dependencies (including tox).
107107
# Hence the use of allowlist_externals instead of using the tox virtualenvs.
108108
# This ensures a match between developer time tools in the IDE and tox tools.
109-
# Setting TOX_DIRECT=1 in the environment will make this even faster
110109
[tox:tox]
111110
skipsdist = True
112111

113-
[testenv:pytest]
114-
allowlist_externals = pytest
115-
commands = pytest {posargs}
116-
117-
[testenv:mypy]
118-
allowlist_externals = mypy
119-
commands = mypy src tests {posargs}
120-
121-
[testenv:pre-commit]
122-
allowlist_externals = pre-commit
123-
commands = pre-commit run --all-files {posargs}
124-
125-
[testenv:docs]
126-
allowlist_externals =
112+
[testenv:{pre-commit,mypy,pytest,docs}]
113+
# Don't create a virtualenv for the command, requires tox-direct plugin
114+
direct = True
115+
passenv = *
116+
allowlist_externals =
117+
pytest
118+
pre-commit
119+
mypy
127120
sphinx-build
128121
sphinx-autobuild
129-
commands = sphinx-{posargs:build -EW --keep-going} -T docs build/html
122+
commands =
123+
pytest: pytest {posargs}
124+
mypy: mypy src tests {posargs}
125+
pre-commit: pre-commit run --all-files {posargs}
126+
docs: sphinx-{posargs:build -EW --keep-going} -T docs build/html

0 commit comments

Comments
 (0)