Open coretl opened 4 months ago
for the extra job something like this could work:
# tox must currently be configured via an embedded ini string
# See: https://github.com/tox-dev/tox/issues/999
[tool.tox]
legacy_tox_ini = """
[tox]
skipsdist=True
envlist = pre-commit,type-checking,tests,docs
[testenv:{pre-commit,type-checking,tests,docs}]
# Don't create a virtualenv for the command, requires tox-direct plugin
direct = True
passenv = *
allowlist_externals =
pytest
pre-commit
mypy
sphinx-build
sphinx-autobuild
commands =
pre-commit: pre-commit run --all-files {posargs}
type-checking: mypy src tests {posargs}
tests: pytest --cov=blueapi --cov-report term --cov-report xml:cov.xml {posargs}
docs: sphinx-{posargs:build -EW --keep-going} -T docs build/html
[testenv:custom-job]
direct = True
passenv = *
commands =
# Replace this line with whatever command this job should run
echo Running custom job tasks {posargs}
"""
interesting, so does that mean that if you don't add it to the envlist then it won't run when you do tox -p
?
possibly, will test soon
At the moment we use tox to:
tox -e docs
to invokesphinx
with the right args including forautobuild
tox -p
to do the tasks that CI will run, but in parallel in a single terminal under a single version of pythontox-direct
We considered using
nox
, but it doesn't have a parallel option at the moment as per https://github.com/wntrblm/nox/issues/544We would like to add the ability to do something like
tox -e lock
to generatedev-requirements.txt
as specified in https://github.com/DiamondLightSource/blueapi/pull/499To do this we should should update to tox 4 and work out what changes are needed to support the current workflow, and also work out how to add a
lock
command that will not be run by the equivalent oftox -p