我正在尝试使用 tox-gh-actions 对 github 推送进行自动化测试。为了测试实现,我在本地使用带有 setup.cfg 的 tox,命令我使用 python -m tox
但我总是以错误结束:
ERROR: tox config file (either pyproject.toml, tox.ini, setup.cfg) not found
我在运行命令的文件夹中已经有一个 setup.cfg 文件。代码可以在 https://github.com/veedata/memories 找到文件夹结构是:
- .github
- workflows
- test.yml
- package
- __init__.py
- packagefiles
- test
- __init__.py
- testfiles
- pyproject.toml
- README.md
- setup.cfg
- setup.py
我的 setup.cfg 文件:
[tox]
envlist = py36, py37, py38, py39
[testenv]
commands =
python -m unittest discover
[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
[metadata]
...
[options]
...
[options.packages.find]
...
如果我使用 tox.ini 文件而不是 setup.cfg,该命令有效,但我更愿意将所有内容都放在一个文件中。目前我已经有一个 pyproject.toml 文件并在那里添加了 tox 配置。但我仍然很好奇 setup.cfg 文件是否有什么我想做的?
最佳答案
Note that setup.cfg requires the content to be under the tox:tox and testenv sections and is otherwise ignored.
来源:https://tox.readthedocs.io/en/latest/config.html#configuration-discovery
关于python - Tox 找不到 setup.cfg 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69393787/