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

Support config in setup.cfg #688

Closed
Natim opened this issue Jan 30, 2019 · 9 comments
Closed

Support config in setup.cfg #688

Natim opened this issue Jan 30, 2019 · 9 comments

Comments

@Natim
Copy link

Natim commented Jan 30, 2019

Today, the config of black is exclusively in pyproject.toml.

However some project relies on setuptools.setup() rather than Flit.

Would it be possible to also store the config in setup.cfg?
Especially since the syntax would be the same?

[tool.black]
line-length = 99
include = \.pyi?$
exclude = \.git
          | \.hg
          | \.mypy_cache
          | \.tox
          | \.venv
          | _build
          | buck-out
          | build
          | dist

Note that other projects like zest.releaser, flake8, twine, wheel already support that.

@Natim Natim changed the title Support config un setup.cfg Support config in setup.cfg Jan 30, 2019
@leplatrem
Copy link

leplatrem commented Jan 30, 2019

I would be happy to contribute this, if it makes sense...

Indeed, in our project, we use the setup.cfg file to configure our package metadata, flake8 options, coverage, zest.releaser, etc. Our setup.py is 2 lines long 😉

I read this comment which made me doubt about what you'd think about this.

note: setup.cfg can read the __version__ attribute instead of parsing source files like it's done here

@JelleZijlstra
Copy link
Collaborator

Let's discuss this in #683.

@richardARPANET
Copy link

Support for this has been added to https://github.com/odwyersoftware/brunette 👍

@JulianVolodia
Copy link

@richardARPANET maybe we should work on flake8 and other projects to support pyproject.toml?

@richardARPANET
Copy link

@JulianVolodia just because the black maintainer is stubborn? Pass

@JulianVolodia
Copy link

@JulianVolodia just because the black maintainer is stubborn? Pass

sad... but true?

@mateusz-stint
Copy link

Main reason to support setup.cfg is because it would allow to have flake/pyling/isort/black/pytest/coverage settings in one neat file. Thanks to this root directory is clean and simple running of flake8; isort; pytest --cov.

I understand though - migrate to toml. But here flake also doesn't support it - https://gitlab.com/pycqa/flake8/-/issues/428.

@JulianVolodia
Copy link

@mateusz-stint but they wont even bc of that... I am thinking about automatic tracking of black mainstream for brunette

@jaklan
Copy link

jaklan commented Mar 19, 2022

@ambv I don't want to create a special issue for that, so I will just put my question here - the current adoption of pyproject.toml is much better than a few years ago, from my experience - almost all crucial Python dev tools already support it. The biggest blocker for a full migration to pyproject.toml-only setup is flake8. I just wonder have you ever discussed with guys to convince them to add support for pyproject.toml? I know they don't really bother about community requests because of their own opinions about TOML, but as the DIR maybe you would be able to change their attitude? Even the tox-like legacy support would be a big step forward here.

Imho the integrity of the dev ecosystem is pretty important for each language, and in case of Python it was quite problematic for years, but now we are in a state where we are really close to achieve that goal in terms of project configuration, next and next PEPs highlight the importance of pyproject.toml. It would be a real pity if these efforts would be anyhow impacted just because of one or two guys. Especially when flake8 is a part of PyCQA, and it would be beneficial for all if PSF and PyCQA were in the same boat here.

Usually we can figure such issues just as a Python community, but unfortunately - that's not the case here 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants