Tox 找不到 setup.cfg 文件
Tox cannot find setup.cfg file
我正在尝试使用 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
我正在尝试使用 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