-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Support Configuration via tox.ini #2172
Comments
I don't think we should do this. |
Do you happen to know what about the pyproject.toml standard is different then the tox.ini standard? Particularly why the header names I use in tox.ini seem to break black's ability to process the tox.ini? If someone added something like this to their pyproject.toml, it would also start to cause black to fail. But I am not familiar enough with pyproject.toml's standard to understand what makes it incompatible?
so, a different way to look at this... Should an existence of a misconfiguration in a different setting break black in the pyproject.toml? |
Not too familiar with it, but obviously one is in TOML format (which is a standardized language) and one is in |
Also, there is negative traction towards expand pyproject.toml to other tools, particularly mypy. But going to chat in that thread and see if mindset has changed at all. |
Actually mypy is about to gain support for pyproject.toml (python/mypy#10219). |
@dciborow I don't use Tox so I wouldn't know for sure, but the main difference causing them to be incompatible is probably that tox.ini uses the INI file format which is different enough from the TOML file format. pyproject.toml is just a normal TOML file who's contents has been somewhat standardized for Python's packaging usage (and now also tools under the I don't think our TOML parser can just ignore a misconfigured value / table. That sounds complicated and prone to errors. In your case, the problem is that booleans values must be lowercase in TOML. And allowing Black to run even when the configuration fails to parse sounds dangerous. It could format files it should never format because it was unable to read the exclude option configured in that invalid file. |
Understand the points you are presenting. But to be super clear, the black configuration between the two files is identical. So to be clear on the reverse point that I am trying to make... if a pyproject.toml is misconfigured outside of the [tools.black] section, you would expect black to fail? Even when the black section is completely correct and readable by black? pyproject.toml
|
We're just using a TOML parser. If the TOML is valid, we use it. If it's not valid, we don't, because we can't. |
okay... let me do some more debugging... see if its something else in my .ini thats messing this up. It sounds like @JelleZijlstra , you would not expect the above sample to fail for black, given it was a valid TOML...? |
For context, Tox is adding |
We don't support multiple potential configuration files as this creates terrible precedence rules. There's been heated discussions about similar ideas before, we're not doing it. |
This is a shame. I can configure flake8 and isort in tox.ini but not black. |
Completely agree. Adding configuration to tox.ini is a defactor standard. Also |
@ikus060 I've since moved to a full pyproject.toml setup by resurrecting flakehell, a wrapper around flake8 with nice pyproject.toml support that had become unmaintained, as flakeheaven in case this is helpful to your project. |
- Adds a new tox `format` command - Locks black to the last version supporting python 2 - Configures black using pyproject.toml (unfortunately it cannot be configured using tox.ini, see psf/black#2172)
- Adds a new tox `format` command - Locks black to the last version supporting python 2 - Configures black using pyproject.toml (unfortunately it cannot be configured using tox.ini, see psf/black#2172)
- Adds a new tox `format` command - Locks black to the last version supporting python 2 - Configures black using pyproject.toml (unfortunately it cannot be configured using tox.ini, see psf/black#2172)
- Adds a new tox `format` command - Locks black to the last version supporting python 2 - Configures black using pyproject.toml (unfortunately it cannot be configured using tox.ini, see psf/black#2172)
- Adds a new tox `format` command - Locks black to the last version supporting python 2 - Configures black using pyproject.toml (unfortunately it cannot be configured using tox.ini, see psf/black#2172)
- Adds a new tox `format` command - Locks black to the last version supporting python 2 - Configures black using pyproject.toml (unfortunately it cannot be configured using tox.ini, see psf/black#2172)
- Adds a new tox `format` command - Locks black to the last version supporting python 2 - Configures black using pyproject.toml (unfortunately it cannot be configured using tox.ini, see psf/black#2172)
- Adds a new tox `format` command - Locks black to the last version supporting python 2 - Configures black using pyproject.toml (unfortunately it cannot be configured using tox.ini, see psf/black#2172)
- Adds a new tox `format` command - Locks black to the last version supporting python 2 - Configures black using pyproject.toml (unfortunately it cannot be configured using tox.ini, see psf/black#2172)
- Adds a new tox `format` command - Locks black to the last version supporting python 2 - Configures black using pyproject.toml (unfortunately it cannot be configured using tox.ini, see psf/black#2172)
- Adds a new tox `format` command - Locks black to the last version supporting python 2 - Configures black using pyproject.toml (unfortunately it cannot be configured using tox.ini, see psf/black#2172)
- Adds a new tox `format` command - Locks black to the last version supporting python 2 - Configures black using pyproject.toml (unfortunately it cannot be configured using tox.ini, see psf/black#2172)
- Adds a new tox `format` command - Locks black to the last version supporting python 2 - Configures black using pyproject.toml (unfortunately it cannot be configured using tox.ini, see psf/black#2172)
- Adds a new tox `format` command - Locks black to the last version supporting python 2 - Configures black using pyproject.toml (unfortunately it cannot be configured using tox.ini, see psf/black#2172)
- Adds a new tox `format` command - Locks black to the last version supporting python 2 - Configures black using pyproject.toml (unfortunately it cannot be configured using tox.ini, see psf/black#2172)
- Adds a new tox `format` command - Locks black to the last version supporting python 2 - Configures black using pyproject.toml (unfortunately it cannot be configured using tox.ini, see psf/black#2172)
- Adds a new tox `check-format` command - Locks black to the last version supporting python 2 - Configures black using pyproject.toml (unfortunately it cannot be configured using tox.ini, see psf/black#2172)
- Adds a new tox `check-format` command - Locks black to the last version supporting python 2 - Configures black using pyproject.toml (unfortunately it cannot be configured using tox.ini, see psf/black#2172)
- Adds a new tox `check-format` command - Locks black to the last version supporting python 2 - Configures black using pyproject.toml (unfortunately it cannot be configured using tox.ini, see psf/black#2172)
- Adds a new tox `check-format` command - Locks black to the last version supporting python 2 - Configures black using pyproject.toml (unfortunately it cannot be configured using tox.ini, see psf/black#2172)
- Adds a new tox `check-format` command - Locks black to the last version supporting python 2 - Configures black using pyproject.toml (unfortunately it cannot be configured using tox.ini, see psf/black#2172)
- Adds a new tox `check-format` command - Locks black to the last version supporting python 2 - Configures black using pyproject.toml (unfortunately it cannot be configured using tox.ini, see psf/black#2172)
Is your feature request related to a problem? Please describe.
Currently, all of my test configurations are colocated within my tox.ini file for my entire project, except for my black configuration for line count = 120, which is stored in our pyproject.toml, and is the only setting configured there.
Describe the solution you'd like A clear and concise description of what you want to
happen.
Instead of having path a pyproject.yml and a tox.ini, I would like to be able to include the black configurations directly with tox.ini.
Describe alternatives you've considered A clear and concise description of any
alternative solutions or features you've considered.
I can't seem to find any single type of configuration file that works for pytest, pylint, bandit, flake8, and black. Tox is supported by the most of these, so I am trying to chase this down.
The text was updated successfully, but these errors were encountered: