Add Support for `pyproject.toml` configuration.
In relation to #300, this pulls request adds the feature. The current implementation makes use of tomlkit to support 3.8 compatibility. If the project moves to only support 3.11 and up, then tomlkit can be replaced with tomllib (built-in to Python stdlib).
The current ordering places the pyproject.toml configuration directly before cli commands, making it the last configuration file to be parsed. This pushes new users to use the pyproject.toml configuration.
Usage
To use the new configuration, add a section named [tool.green] into your pyproject.toml:
[tool.green]
verbosity = 2
run-coverage = true
And green will take it from there.
I have seen other projects make tomllib an optional dependency only for older versions of python: prior to 3.11. We could have similar logic here.
I've added support using the specifier found at https://github.com/hukkin/tomli to allow toml support on versions below 3.11.
I'm not sure why the CI isn't running automatically. I enabled it...again. Let's get this problem fixed:
!!
********************************************************************************
One of the parsed requirements in `extras_require[toml]` looks like a valid environment marker:
'python_version < "3.11"'
Please make sure that the configuration file is correct.
You can use dangling lines to avoid this problem.
See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html#opt-2 for details.
********************************************************************************
!!
Sorry for the delay, but here are the changes. They should work for setting the version identifier. Let me know if there's anything else!
Will you please merge main into this PR? That will fix at least some of the CI failures.