gpt4 book ai didi

python - 运行后如何清理有毒环境?

转载 作者:行者123 更新时间:2023-12-01 19:33:49 25 4
gpt4 key购买 nike

我有以下tox.ini 文件:

[tox]
envlist = flake8,py{35,36,37,38}{,-keyring}

[testenv]
usedevelop = True
install_command = pip install -U {opts} {packages}
deps =
.[test]
keyring: .[keyring]
setenv =
COVERAGE_FILE = .coverage.{envname}
commands=
pytest {toxinidir}/tests -n 4 {posargs}

[testenv:flake8]
basepython = python3
deps = flake8
commands=
flake8 src tests

[flake8]
ignore: F401,E402,E501,W605,W503

当我运行 tox 命令时,它会创建一个 .tox 文件夹,其中包含 [tox] 部分中指定的每个环境的文件夹tox.ini

我希望在运行 tox 时测试成功后自动删除这些特定文件夹,而无需手动运行 rm -rf .tox/NAME_OF_THE_ENV。我搜索了 tox 文档,但一无所获。

可以这样做吗?如果是,怎么办?

最佳答案

我知道这并不完全是您所要求的,但值得一提的是,tox 的 -r/--recreate 标志将 force recreation of virtual environments

关于python - 运行后如何清理有毒环境?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59563746/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com