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

deprecate setup.cfg support #3523

Open
RonnyPfannschmidt opened this issue May 31, 2018 · 7 comments
Open

deprecate setup.cfg support #3523

RonnyPfannschmidt opened this issue May 31, 2018 · 7 comments
Labels
topic: config related to config handling, argument parsing and config file type: deprecation feature that will be removed in the future

Comments

@RonnyPfannschmidt
Copy link
Member

#3062 demonstrates that its not a sustainable option to hijack config files that will be parsed using a different parser

we should deprecate setup.cfg usage and unless someone comes up with a sustainable option to support it, drop it

@pytestbot
Copy link
Contributor

GitMate.io thinks possibly related issues are #3086 (Remove [pytest] section support in setup.cfg), #3050 (deprecate pytest.config), #3268 (Issue warning when "[pytest]" section is used in a ".cfg" file passed with "-c"), #830 (deprecate resultlog), and #2107 (pytest alias in setup.cfg not working).

@blueyed
Copy link
Contributor

blueyed commented May 31, 2018

I've skimmed #3062 - and see the issue, but just wanted to state that I considered setup.cfg a good central place for configuring different tools, and not having pytest there anymore would be bad.

  1. Given that it causes no problems for most users it might be better to never drop it, but rather not recommend it (i.e. in docs)?

  2. pytest should probably just use configparser for setup.cfg, too (Cannot setup log_format in setup.cfg, because of InterpolationMissingOptionError` #3062 (comment)). While this would not work with Python 2 out of the box, we could either find some workaround, or document that for Python 2 you would have to use pytest.ini (that could probably be detected even).

I agree that it is quite messy, but having to move pytest config from setup.cfg to pytest.ini will also be messy for pytest users, especially since only users that configure "log_format" and similar options are affected in the end.

And for Python 3 (the future) it seems to be straight-forward: configparser should be used, which then would also enable the feature it provides, that is causing this issue in the first place.
Sure, "log_format" would look different when being used in setup.cfg vs. pytest.ini, but that appears to be necessary for setup.cfg - and makes sense once you know about its interpolation feature.

@RonnyPfannschmidt
Copy link
Member Author

@blueyed feel free to make a pr implementing that

im going to deprecate it as i dont have the time and motivation and its currently broken in strange ways - im happy to keep it if somebody comes up with a reasonably correct way to have pytest config in setup.cfg that is not completely mindboogling

however also keep in mind that pyproject.toml is upcoming, already standardized and very likely a much saner migration target

@nicoddemus nicoddemus added the type: deprecation feature that will be removed in the future label Sep 19, 2018
@nicoddemus
Copy link
Member

This has been deprecated for some time

@blueyed
Copy link
Contributor

blueyed commented Sep 21, 2018

we should deprecate setup.cfg usage

Then I might have understood it incorrectly - I've assumed [tool:pytest] should also be deprecated (but I just saw that 3.7.4 complains about [pytest] that should become [tool:pytest]).
If this is only about [pytest] without tool: prefix I am totally fine with it.
But from the initial comment I think @RonnyPfannschmidt wants to deprecate it altogether?!
(I've found 0fffa6b when looking quickly around, but it appears to be about [pytest] only - https://github.com/blueyed/pytest/blob/661c00009763ffc57f018057775497accb1c9409/src/_pytest/deprecated.py#L58-L61.

So, re-open?

@RonnyPfannschmidt
Copy link
Member Author

yes - re-open for sure

se need to drop pytest section support for setup.cfg at some point - its fundamentally broken

@nicoddemus nicoddemus changed the title deprecate pytest section in setup.cfg deprecate setup.cfg support Sep 21, 2018
@nicoddemus
Copy link
Member

My bad guys. I've changed the title to what I think better conveys the purpose of the issue then, let me know if it's not good yet.

@Zac-HD Zac-HD added the topic: config related to config handling, argument parsing and config file label Jun 24, 2019
lewisacidic added a commit to lewisacidic/cookiecutter-conda-pyproject that referenced this issue Sep 13, 2019
Keeping pytest configuration in `setup.cfg` is deprecated (even with the
[tool.pytest] field, see pytest-dev/pytest#3523) so move it out to pytest.ini.
RonnyPfannschmidt added a commit to RonnyPfannschmidt/pytest that referenced this issue Feb 20, 2021
RonnyPfannschmidt added a commit to RonnyPfannschmidt/pytest that referenced this issue Feb 20, 2021
RonnyPfannschmidt added a commit to RonnyPfannschmidt/pytest that referenced this issue Jun 6, 2021
RonnyPfannschmidt added a commit to RonnyPfannschmidt/pytest that referenced this issue Jun 6, 2021
RonnyPfannschmidt added a commit to RonnyPfannschmidt/pytest that referenced this issue Jul 12, 2022
RonnyPfannschmidt added a commit to RonnyPfannschmidt/pytest that referenced this issue Jul 12, 2022
RonnyPfannschmidt added a commit to RonnyPfannschmidt/pytest that referenced this issue Jul 29, 2022
RonnyPfannschmidt added a commit to RonnyPfannschmidt/pytest that referenced this issue Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: config related to config handling, argument parsing and config file type: deprecation feature that will be removed in the future
Projects
None yet
Development

No branches or pull requests

5 participants