check-manifest icon indicating copy to clipboard operation
check-manifest copied to clipboard

Read config from tox.ini

Open vuolter opened this issue 6 years ago • 9 comments

Currently check-manifest reads its configuration just from the setup.cfg file. Because the setup.cfg is basically an ini file, read the same config from the, widely used, tox.ini file should not to be so hard. Just an idea. Bye.

vuolter avatar Jul 10 '17 10:07 vuolter

I'm not opposed to the idea, but when would this be useful?

mgedmin avatar Jul 10 '17 12:07 mgedmin

Like many devs I use travis for ci and tox for tests. Travis can be set to deploy and release code automatically, so you can use tox in travis for testing and check-manifest in tox for manifest validation. In short you can verify the manifest before the code is deployed. In this context, I think put the check-manifest config in the tox.ini would more "coherent".

vuolter avatar Jul 10 '17 17:07 vuolter

Makes sense.

The only thing remaining is to decide which config file should take preference if I find configuration in both files.

I remember there was a tool that could be configured in tox.ini (or setup.cfg, or its own config file), but I'm not sure which one it was -- flake8? coverage? Whichever it was, I would like to copy their priorities, for consistency.

mgedmin avatar Jul 10 '17 19:07 mgedmin

The tool I was thinking of was coverage -- but the docs don't say which config file takes precedence.

mgedmin avatar Jul 10 '17 19:07 mgedmin

The source code indicates that coverage reads .coveragerc, then setup.cfg, then tox.ini, and it stops after the first file that has any configuration.

I was thinking of simply passing multiple filenames to ConfigParser, which would merge the configs.

mgedmin avatar Jul 10 '17 19:07 mgedmin

@mgedmin Any progress about this enhancement? Thx.

vuolter avatar Oct 14 '17 08:10 vuolter

Would you care to provide a pull request? I find it hard to motivate myself to work on something when I'm not sure how it should work.

mgedmin avatar Oct 16 '17 08:10 mgedmin

This was resolved by https://github.com/mgedmin/check-manifest/pull/86 ?

There is now also pyproject.toml support, and that is the new recommended approach.

jayvdb avatar Dec 30 '19 07:12 jayvdb

There is now also pyproject.toml support, and that is the new recommended approach.

Recommended by whom? ;-)

I personally do not like pyproject.toml for 3rd-party tool settings because it has surprising side effects: it also requires that you switch your Python project to a PEP-518 build configuration.

mgedmin avatar Dec 30 '19 08:12 mgedmin