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

Commit 10e2396

Browse files
coretlgilesknap
authored andcommitted
Made tox faster with tox-direct
1 parent c975f6d commit 10e2396

File tree

2 files changed

+21
-20
lines changed

2 files changed

+21
-20
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ RUN cd /project && \
2626

2727
RUN python -m venv /venv
2828
ENV PATH=/venv/bin:$PATH
29+
ENV TOX_DIRECT=1
2930

3031
RUN cd /project && \
3132
pip install --upgrade pip && \

setup.cfg

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ dev =
4242
setuptools_scm[toml]>=6.2
4343
sphinx-rtd-theme-github-versions
4444
tox
45+
tox-direct
4546
types-mock
4647

4748
[options.packages.find]
@@ -75,9 +76,8 @@ extend-ignore =
7576
F811, # support typing.overload decorator
7677
F722, # allow Annotated[typ, some_func("some string")]
7778
exclude =
78-
ui_*
7979
.tox
80-
.venv
80+
venv
8181

8282
[tool:pytest]
8383
# Run pytest with all our checkers, and don't spam us with massive tracebacks on error
@@ -103,22 +103,22 @@ source =
103103
# NOTE that we pre-install all tools in the dev dependencies (including tox).
104104
# Hence the use of allowlist_externals instead of using the tox virtualenvs.
105105
# This ensures a match between developer time tools in the IDE and tox tools.
106+
# Setting TOX_DIRECT=1 in the environment will make this even faster
106107
[tox:tox]
107-
minversion = 3.7
108-
skipsdist=true
109-
skipinstall=true
110-
111-
[testenv:{pre-commit,mypy,pytest,docs}]
112-
passenv =
113-
PYTHONPATH
114-
HOME
115-
allowlist_externals =
116-
pytest
117-
pre-commit
118-
mypy
119-
sphinx-build
120-
commands =
121-
pytest: pytest tests {posargs}
122-
mypy: mypy src tests {posargs}
123-
pre-commit: pre-commit run --all-files {posargs}
124-
docs: sphinx-build -EWT --keep-going docs build/html {posargs}
108+
skipsdist = True
109+
110+
[testenv:pytest]
111+
allowlist_externals = pytest
112+
commands = pytest {posargs}
113+
114+
[testenv:mypy]
115+
allowlist_externals = mypy
116+
commands = mypy src tests {posargs}
117+
118+
[testenv:pre-commit]
119+
allowlist_externals = pre-commit
120+
commands = pre-commit run --all-files {posargs}
121+
122+
[testenv:docs]
123+
allowlist_externals = sphinx-build
124+
commands = sphinx-build -EWT --keep-going docs build/html {posargs}

0 commit comments

Comments
 (0)