Home > Software engineering >  Tox cannot find setup.cfg file
Tox cannot find setup.cfg file

Time:09-30

I am trying to use tox-gh-actions to automate testing on github pushes. In order to test the implementation, I am locally using tox with setup.cfg, command I use python -m tox but I always end up with the error:

ERROR: tox config file (either pyproject.toml, tox.ini, setup.cfg) not found

I already have a setup.cfg file in the folder from where I run the command. The code can be found at https://github.com/veedata/memories and the folder structure is:

- .github
  - workflows
    - test.yml
- package
  - __init__.py
  - packagefiles
- test
  - __init__.py
  - testfiles
- pyproject.toml
- README.md
- setup.cfg
- setup.py

my setup.cfg file:

[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]
...

If I use a tox.ini file instead of setup.cfg, the command works, but I would prefer to have everything in one file. Currently I already have a pyproject.toml file and have added the tox configuration there. But I still am curious if there is something with the setup.cfg file that I am missing to do?

CodePudding user response:

Note that setup.cfg requires the content to be under the tox:tox and testenv sections and is otherwise ignored.

Source: https://tox.readthedocs.io/en/latest/config.html#configuration-discovery

  • Related