-
-
Notifications
You must be signed in to change notification settings - Fork 433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow configuration via pyproject.toml #664
Comments
This is a good idea. One twist: coverage.py has no required dependencies. It will need a toml parser to parse the pyproject.toml file. My inclination is to implement this so that if the toml module is available, then coverage will try to read the pyproject.toml file. Installing coverage won't install toml automatically, you'll have to do that yourself if you want to use pyproject.toml for configuration. |
@nedbat What about vendoring the toml library along with coverage? Would you be ok with that approach? Some projects do that (I think Pipenv does that with Pip, although there are probably examples in less chaotic projects as well [that's not to say that Pipenv is bad] ), to stay independent of other dependencies, and act as a self-contained dependency. |
Or on the other hand... your solution seems more sensible :) Just have to document that. |
You can also list it as optional dependency. |
+1 for optional dependency, isort does that for example: |
Coming soon! Issue: nedbat/coveragepy#664 PR: nedbat/coveragepy#699
This is finished as of df744f8 |
Awesome, @nedbat thanks for helping move this along. Assume this will land in the next release? |
Yes, if by next release you mean 5.0. |
This is available in 5.0b1: https://pypi.org/project/coverage/5.0b1/ |
nedbat/coveragepy#664 (+ later fixes) Signed-off-by: Stavros Ntentos <[email protected]>
nedbat/coveragepy#664 (+ later fixes) Signed-off-by: Stavros Ntentos <[email protected]>
nedbat/coveragepy#664 (+ later fixes) Signed-off-by: Stavros Ntentos <[email protected]>
Originally reported by pradyunsg (Bitbucket: pradyunsg, GitHub: pradyunsg)
As per PEP 518, tools can use
tool.<pypi-name>
namespace within thepyproject.toml
file if they own<pypi-name>
on PyPI.Allowing configuration via the above mechanism would allow for users to have a single file in their root directory, for configuring this
coverage
(and other tools) for their project. Essentially, this would allow eliminating a.coveragerc
file in the root of the project in favor of usingpyproject.toml
.The text was updated successfully, but these errors were encountered: