如何为 tox 中的给定作业指定某些 python 版本?
我有一个包含很多作业的毒物配置,这是一个缩短的版本(我使用诗歌):
[tox]
skipsdist = true
envlist =
format,
formatting,
imports,
flake8,
pylint,
docs,
package
isolated_build = True
whitelist_externals = poetry
; Builds the documentation
[testenv:docs]
deps =
sphinx
sphinx_rtd_theme
toml
commands =
sphinx-apidoc -o {[project-info]doc_dir} {[project-info]src_dir}
sphinx-build -b html {[project-info]doc_src_dir} {[project-info]doc_html_output_dir}
; Builds the package
[testenv:package]
deps = poetry
commands =
poetry install
poetry build
我希望 docs 作业在任何给定的 python 解释器上运行,因为我不关心它的版本,但我希望 package
作业在几个指定的作业上运行(最好在一个地方指定)。我怎样才能做到这一点?
I have a tox config with quite a few jobs, here is a shortened version (Im using poetry):
[tox]
skipsdist = true
envlist =
format,
formatting,
imports,
flake8,
pylint,
docs,
package
isolated_build = True
whitelist_externals = poetry
; Builds the documentation
[testenv:docs]
deps =
sphinx
sphinx_rtd_theme
toml
commands =
sphinx-apidoc -o {[project-info]doc_dir} {[project-info]src_dir}
sphinx-build -b html {[project-info]doc_src_dir} {[project-info]doc_html_output_dir}
; Builds the package
[testenv:package]
deps = poetry
commands =
poetry install
poetry build
I would like the docs
job to run on any given python interpreter because I don't care about its version but I would like the package
job to run on a few specified ones (preferably in specified in one place). How can I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
basepython
设置,请参阅 https://tox.wiki/en/3.24.5/example/general.html#basepython-defaults-overriding奖励
而不是使用注释来描述毒性env,您应该使用描述设置,请参阅 https://tox。 wiki/en/3.24.5/config.html#conf-description
当您运行
tox -lv
时,您将获得有关可用环境的有用概述。You can use the
basepython
setting, see https://tox.wiki/en/3.24.5/example/general.html#basepython-defaults-overridingbonus
Instead of using a comment to describe the tox env, you should use the description setting, see https://tox.wiki/en/3.24.5/config.html#conf-description
When you run
tox -lv
, you get a helpful overview over the available environments.