Skip to content
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

global config not possible if project contains a pyproject.toml #4411

Open
ppena-LiveData opened this issue Jul 24, 2024 · 2 comments
Open
Labels
T: bug Something isn't working

Comments

@ppena-LiveData
Copy link

Describe the bug

We have multiple Python Git projects, which each have their own pyproject.toml, but we don't want to have to copy and paste the same [tool.black] section in each of them and would prefer to be able to have it configured in our user's ~/.black global config file. Unfortunately, black.files.find_pyproject_toml() doesn't check if the project's pyproject.toml file has a [tool.black] section before returning it, so that causes it to never check to see if there's a ~/.black global config file.

To Reproduce

Have a Python Git project with a pyproject.toml file that does not have a [tool.black] section, and have a ~/.black global config file in your user's directory. The file in your user's directory will be ignored.

Expected behavior

If a project's pyproject.toml file does not have a [tool.black] section, then black should look for a user-level ~/.black global config file.

Additional context

NOTE: this is similar to Issue #2863, but this asks for the [tool.black] section-searching to continue and not stop at the project level.

@ppena-LiveData ppena-LiveData added the T: bug Something isn't working label Jul 24, 2024
@Michallote
Copy link

Wouldn't this just make projects not self-contained? What happens when multiple contributors try then to contribute to a code base and black looses all reproducibility because they all have different configurations in their personal machine.

I know it is a stretch but this comes across as "I really don't want to specify my dependencies in my project why wont pip just use the global installation?". Just that it is what it actually does without a .venv and it is a endless source of bugs.

@ppena-LiveData
Copy link
Author

We're talking about config, not package installations. BTW, pip also provides global and local config locations, since some configurations should be shareable by all projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants