Skip to content

setup.cfg causes tox.toml to be ignored and fail with HandledError| SetupCfg ... #3645

@cpburnz

Description

@cpburnz

Issue

A setup.cfg prevents tox.toml from being used which causes tox to fail with the following error:

ROOT: HandledError| SetupCfg failed loading /home/caleb/tox-issue/setup.cfg due to section tox:tox not found

I think the problem is setup.cfg has a higher priority than tox.toml unlike tox.ini.

Why am I using setup.cfg? I'm the author of pathspec, and in order to support setuptools installs on old versions of Red Hat / Fedora, I generate setup.cfg from pyproject.toml. I currently use tox.ini to configure tox, and was looking to switch to tox.toml because it's the recommended config.

Environment

Provide at least:

  • OS: Manjaro Linux 25.0.10 (Arch Linux derivative)
  • Python 3.14.0
Output of pip list of the host Python, where tox is installed
Package       Version
------------- -------
cachetools    6.2.2
chardet       5.2.0
colorama      0.4.6
distlib       0.4.0
filelock      3.20.0
packaging     25.0
pip           25.2
platformdirs  4.5.0
pluggy        1.6.0
pyproject-api 1.10.0
tox           4.32.0
virtualenv    20.35.4

Output of running tox

Output of tox -rvv
ROOT: HandledError| SetupCfg failed loading /home/caleb/tox-issue/setup.cfg due to section tox:tox not found

Minimal example

python3.14 -m venv .venv
. .venv/bin/activate
pip install tox
touch setup.cfg
echo 'env_list = ["3.14"]' > tox.toml
tox

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions