-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Provide support for dash-separated keys in setup.cfg, warns for future incompatibility of certain keys #2588
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really great. Nice work on creating tests for the warning as well as for the condition that led to this change. Also nice work on the guidance. I'm a little concerned about the explicit list of options. Let's mull over the tradeoffs there and we're good to go.
Looks great. Well done! |
Hi! I checked https://setuptools.readthedocs.io/en/latest/history.html#v54-1-0 but I wasn't entirely clear: is this meant to warn for all keys using hyphens in $ cat setup.cfg
[flake8]
extend-ignore = E203
max-line-length = 88
[isort]
profile = black
[tool:pytest]
addopts = -ra --color=yes
testpaths = Tests
$ python setup.py --version
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/dist.py:633: UserWarning: Usage of dash-separated 'extend-ignore' will not be supported in future versions. Please use the underscore name 'extend_ignore' instead
warnings.warn(
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/dist.py:633: UserWarning: Usage of dash-separated 'max-line-length' will not be supported in future versions. Please use the underscore name 'max_line_length' instead
warnings.warn(
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/dist.py:633: UserWarning: Usage of dash-separated 'extend-ignore' will not be supported in future versions. Please use the underscore name 'extend_ignore' instead
warnings.warn(
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/dist.py:633: UserWarning: Usage of dash-separated 'max-line-length' will not be supported in future versions. Please use the underscore name 'max_line_length' instead
warnings.warn(
8.2.0.dev0 Flake8 themselves say both underscores and hyphens are fine in https://flake8.pycqa.org/en/latest/user/configuration.html#project-configuration Thanks! |
@hugovk |
Oh, this was a case I hadn't considered during the review. I had expected it would only apply to sections that setuptools is using. The I believe we should come up with a patch to avoid these warnings. I'll convert Hugo's comment to an issue. @melissa-kun-li Would you be interested in working on the patch? In this case, I'd say a test is optional. Use |
@jaraco Sure! I'll work on a fix, I have an idea in mind |
…arnings fix setup.cfg warnings breaking tox (pypa/setuptools#2588)
Update description_file key in setup.cfg to silence deprecation warning. For reference, the setuptools change was introduced by pypa/setuptools#2588
Dash-separated options in 'setup.cfg' will become unsupported at some point in the future: pypa/setuptools#2588
Summary of changes
Closes #1608
This change will preserve dashes in the keys of
setup.cfg
. This will also implement a compatibility method which will warn users throughUserWarning
if they use an alias involving a dash which should technically be underscore separated (e.g. usingauthor-email
instead ofauthor_email
). After warning for these types of aliases, dash to underscore conversion will be performed for compatibility, but in the future Setuptools will no longer support the alias conversion.Pull Request Checklist
changelog.d/
.(See documentation for details)