-
-
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
[FR] Implement PEP 639 #4629
Comments
Thank you very much @befeleme. Also possibly pending on pypa/packaging#799 + Any member of the community interested in giving it a go is very welcome! Footnotes
|
@befeleme one thing that I was also commenting some time ago in the discourse (see https://discuss.python.org/t/enforcing-consistent-metadata-for-packages/50008/101 and https://discuss.python.org/t/enforcing-consistent-metadata-for-packages/50008/102) is that I don't believe setuptools is in a condition to adopt version 2.2 of the core metadata, specifically As discussed in that thread, I don't think we can right now ensure 100% that So that is why we cannot "bump" into 2.2, and therefore we cannot bump into 2.4 either. If that is OK, we can adopt PEP 639 without bumping the metadata to 2.4. Or bump the metadata to 2.4 and use One example in which setuptools would have trouble to provide guarantees is when a package has In general Footnotes
|
In the worst case, why can you not simply set every field to be dynamic, except for To be clear, Footnotes
|
I'm assuming your concern here is with the statement in PEP 643 that says
That was never intended to make it hard for backends to implement the spec. I was always assuming that setuptools in particular would have a hard time "determining that metadata was generated from data that will not change", and so would default to dynamic. Maybe the PEP should have omitted that statement. It doesn't add much in practice - it effectively says "if you can do this, you must", which is pretty meaningless given that you wouldn't claim conformance to the spec if you didn't intend to implement it... Luckily it never made it into the formal specification. |
Ok, in that case, it may make sense. Because we can record the calculated values and have the Thank you very much, @pfmoore. |
Just to document what seems to be a viable approach for PEP 643:
|
Sounds good to me. Are plugins permitted to mess with data read from Having said that, not respecting the value from
So on reflection, (3) could probably be strengthened to say "When metadata is provided by |
"Permitted", I don't think so. But both plugins (via entry-points) and the user (via the This is an example of a plugin trying to change dependencies: #3982. In this particular case setuptools was able to block the attempt because the developer used the |
Cool. I think your response to the plugin author in the case you linked to was exactly right (and to be fair, the author seemed happy with that response). Ideally, as in this case, setuptools can stop the plugin doing things like that, but I think it's fine if you don't always manage to, and simply document that plugins and user code are required to conform to all relevant standards when overriding setuptools functionality. I imagine that if a plugin manages to violate standards, finding the reason for the resulting incorrect behaviour would be a bit of a nightmare, but that's a different problem |
#4698 is an attempt to implement PEP 643. I am trying a slightly unorthodox approach by marking the static values coming from If anyone is interested in having a look on the approach, please let me know your ideas. |
What's the problem this feature will solve?
The chaotic land of expressing license metadata in Python packaging will become more unified.
Describe the solution you'd like
See: https://peps.python.org/pep-0639
This will update the Core Metadata version to 2.4, so the previous features, updating them to 2.2 and 2.3, should land in first.
Alternative Solutions
No response
Additional context
A previous draft of the PEP has been already implemented in setuptools.
There's a feature request for another bit of the draft: #3596
The full implementation, including the Core Metadata bump, will require also the support on the side of PyPI first: pypi/warehouse#16620
Code of Conduct
The text was updated successfully, but these errors were encountered: