Skip to content

Conversation

@ferdnyc
Copy link
Contributor

@ferdnyc ferdnyc commented Dec 2, 2025

It was reported in #3585 that the online documentation page for the CLI is showing this message at the bottom of the page:

config file ‘/home/docs/.config/tox/config.ini’ missing (change via env var TOX_USER_CONFIG_FILE)

That message is the .epilog property of the IniConfig class in tox.config.cli.ini.

TBH I don't really understand the point of the message. Most users will never need or have a Tox user config file, preferring that all of their configuration come from project-local configs. And that's fine, or at least it seems like it should be. But that message is always there at the end of the CLI help output. And it completely ignores the local configuration, focusing exclusively on the (wholly unnecessary) user config file.

(For example...)

$ cd /path/to/tox-dev/tox/
$ tox list --help |tail -n2

config file '/home/ferd/.config/tox/config.ini' missing (change via env var TOX_USER_CONFIG_FILE)

$ tox config --assert-config > /tmp/config.ini
$ TOX_USER_CONFIG_FILE="/tmp/config.ini" \
  tox list --help |tail -n2

config file '/tmp/config.ini' active (changed via env var TOX_USER_CONFIG_FILE)

$ TOX_USER_CONFIG_FILE="/tmp/config.ini" \
  tox -c ./tox.toml list --help |tail -n2

config file '/tmp/config.ini' active (changed via env var TOX_USER_CONFIG_FILE)

Regardless, we definitely don't want that message displayed when Sphinx is formatting the parser help for inclusion in the HTML documentation. So, just brute-force set it to None before returning it to Sphinx:

When calling tox.config.cli.parse._get_parser_doc() from the Sphinx documentation build, reset the .epilog property on the returned parser object. This ensures the help will be formatted without any messages about configuration files.

Fixes #3585

  • ran the linter to address style issues (tox -e fix)
  • wrote descriptive pull request text
  • ensured there are test(s) validating the fix
  • added news fragment in docs/changelog folder
  • updated/extended the documentation

When calling `tox.config.cli.parse._get_parser_doc()` from the Sphinx
documentation build, reset the `.epilog` property on the returned
parser object. This ensures the help will be formatted without any
messages about configuration files.

Fixes tox-dev#3585

Signed-off-by: FeRD (Frank Dana) <[email protected]>
@ferdnyc ferdnyc requested a review from gaborbernat as a code owner December 2, 2025 03:11
@ferdnyc ferdnyc changed the title Parser: Drop epilog message for Sphinx help CLI Parser: Drop epilog message for Sphinx help Dec 2, 2025
@gaborbernat gaborbernat merged commit 80ba0cb into tox-dev:main Dec 4, 2025
51 of 53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[docs][4.14.0+] Sphinx possibly misconfigured @ CLI interface page in docs

2 participants