-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Consider accepting -
and _
in extras name
#4921
Comments
By all means, please do propose a PR (or series of PRs). The postponed error gives us the opportunity to rethink the approach. I think this is a good opportunity to delve into the real problems here and try to come up with good solutions. One think to consider before attempting to tackle the challenge on the title of the issue is that we learned with the community reports that the vast majority of errors are happening specifically for fields that are not even accepted by This is what I consider important when tackling this request and the preferred direction for the PR:
Finally, I would assume the person proposing the PR is willing to support the implementation at least during the period of time that it will take for it to reach stable levels. Note that the comment In hindsight, based on the feedback received, I found that in general, there is almost no usage of dashes, except for fields that are not supported by setuptools. Notes not specific to this request, but an important general reminder: Expecting that setuptools will not introduce deprecation changes in general and will not carry out the removals is unrealistic. We can try to improve communication, we can contribute togheter to write guides of what to do, and how projects can take measures to protect mission critic systems. We are also very happy to review approaches and discuss better solutions. We have been working very hard to implement warnings as visible and as informative as we can. We implemented suggestions from the community of how deprecation warnings should be displayed. We also have been criticised for not having clarity on the removal dates planned, and we changed those. Please note that we have been taking input on board, but it is not fair to expect that things will never change. Update: see #4923 (review). |
I agree with this suggestion. The proposed change seems to be just a partial reversion of #2588, so it shouldn't be difficult to put together. It appears that "not accepting invalid fields", altogether, would be far more disruptive than this normalization issue was. Something should presumably be done about that eventually, but it doesn't seem to be as high of a priority. (Have there been complaints about packages building incorrectly due to Setuptools ignoring a mis-typed key in Regarding the visibility of warnings, I hope @notatallshaw 's discussion will bring much-needed light. (Unfortunately I will not be able to participate in that discussion.) |
Ok, will do.
Understood. |
Completely disagree with this point, though. Instead, I believe this comment from @herebebeasties is correct:
Likewise, this comment from @eli-schwartz.
Very well, projects may pass wrong config according to I believe this is the crux of the governance changes we are seeking. Should Rather, I fervently wish that [Edited to add the following] Anyway, this is a long way of saying that I don't intend to handle 4913 with any PR. As for this,
Of course, there will have to be deprecations and removals. But we would like greater input into whether any given deprecation is really necessary. But I think that longer discussion should be in its own issue about governance. I can open that at a later time, or someone else can. |
FTR, underscores are invalid in the core packaging metadata: https://packaging.python.org/en/latest/specifications/core-metadata/#provides-extra-multiple-use. |
Very well. In that case, a better place to validate may be uploads to PyPI. Suppose nonconforming fields are rejected from upload. New packages and new versions must then conform. Meanwhile, builds continue to work. Maybe eventually, |
My personal feeling is that this should be nuanced. Ideally builds should not be deliberately broken on simple aesthetic grounds, the way that this change came across as. Neither adding nor removing a normalization rule here seems like hardly any maintenance burden. But on the other hand, there are conceivable removals that would carry huge benefits: in terms of clearer separation of responsibilities, performance, wheel size etc. I'm thinking in particular here of #4519, where the removal was a step towards making Setuptools function properly as purely a build backend (as opposed to a deprecated early-2010s attempt at a workflow tool that exposes a build API, which was itself originally an interface to
Unclear: who is "we"? I start to think that in the long term, the only viable solution is a separate "LTS" branch that's bugfixes-only in perpetuity (and which becomes the assumed default for legacy projects) while "modern Setuptools" becomes able to do what it needs to. (Perhaps separate LTS versions for projects not declaring a |
No, this is entirely backwards. Having a As I said in #4915 (comment):
There's a big support gap between:
If you want to change which setuptools versions to offer to people depending on whether they have bought into "committing to its future", you should look at people who did the latter, not the former. Lots of people were told that we "had to" add a pyproject.toml and that it does not affect the existing workflow, but only allows pip to be more explicit about what it needs. For example, I too, have a pyproject.toml which happily coexists with setup.cfg, and the latter continues to drive all configuration in 2025 and onward. (Sorry to be the bearer of bad news, but toml sucks and setup.cfg remains the superior configuration syntax and format, and works great. For people who were already using toml, it's not much churn to twiddle some headers so that existing keys end up in |
In #4923 (review) I listed some of my thoughts related to the fact that while I would consider accepting |
... Are there actually any in-between alternatives? Or else, what is the specific concern in #4913 , anyway? The best interpretation I can make is that you're concerned that someone might write (or have written 10+ years ago...) something intended for another tool and not for the |
When talking about extras specifically (I have a feeling that some comments refer to other configurations of setuptools too, but I'm not talking about that), in order to produce spec-compliant metadata, it shouldn't include underscores in said metadata. But the configuration file might allow those names, while converting them into spec-compliant format. It's probably a good idea to just normalize extra names in the configs, as long as the metadata is correct. |
Here is the changelog message for 78.0.2:
I advocate that the better option is to accept
-
and_
, and remove the deprecation warning. Anything else would risk major breaking changes throughout the ecosystem again.I traced down the issue where making the deprecation into a breaking change was discussed. #4864 (comment).
Quoting rather liberally,
And @jaraco said in response:
The ticket was closed when the tests were marked as xfail here.
@zanieb warned that the disruption would be quite large here:
And now, after all this, we are at option 2, punt. Sometime in 2026, we will do this all over again. Don't let's kid ourselves that the long tail of PyPI packages will release patches to comply with this change within a year.
So why not choose option 3, remove the deprecation, and roll forward accepting
-
and_
?The text was updated successfully, but these errors were encountered: