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

PEP 770: Add the additional-files table and reserve dist-info dirs #4283

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sethmlarson
Copy link
Contributor

@sethmlarson sethmlarson commented Feb 25, 2025

  • Change is either:
    • To a Draft PEP
    • To an Accepted or Final PEP, with Steering Council approval
    • To fix an editorial issue (markup, typo, link, header, etc)
  • PR title prefixed with PEP number (e.g. PEP 123: Summary of changes)

cc @rgommers


📚 Documentation preview 📚: https://pep-previews--4283.org.readthedocs.build/

@jkowalleck
Copy link

I believe this proposal constitutes a significant scope change and is not aligned with the original objectives.

The initial scope was to add SBOM to packages. However, the proposed changes introduce the addition of arbitrary data to packages, which significantly broadens the scope. This new capability/topic deviates from the original focus and introduces complexities that will progress at a different pace than the initial scope. It appears that this change could be an attempt to shift the focus or slow down the progress by diverting from the original scope.

I strongly oppose this PR and the proposed changes. If there is a substantial interest in including arbitrary data in packages, a separate PEP should be initiated.

Copy link
Contributor

@rgommers rgommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick update @sethmlarson. I reviewed both the diff and the full new text, it looks pretty good to me. This change is a signifcant improvement overall in my opinion.

The checks on what .dist-info directories are already in use looks thorough, thanks for that.

The sentence under Acknowledgements referencing PEP 639 is out of date now, it still says that this PEP implements the PEP 639-like scheme.

You may want to mention somewhere that using a separate [additional-files] key means that packages can start using it directly after acceptance of this PEP, rather than have a >1 yr rollout plan that would have been needed with a core metadata version bump.

You may want to mention that SBOM tooling should always check the actual artifact of interest; no assumptions can be made about the sboms directory having the same contents between different artifacts for a single version of a package.


* Most subdirectories under ``.dist-info`` are to do with licensing,
one of which (``licenses``) is specified by :pep:`639` and other
(``license_files``) which is being used by the Hatch build backend.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The various spellings of the licenses directory looks like a potential issue (if not very related to this PR). PEP 639 is pretty clear that it must be lower-case licenses. Hatch always tries following packaging standards, so I assume that this is an oversight. It's also possible though that there's a conflict with REUSE, because https://reuse.software/faq/#multi-licensing requires an upper-case LICENSES directory. So it's likely that both may have to be allowed (which you already did for license_files in this PR), and the up-to-date version of PEP 639 language in the packaging user guide made more permissive.

license_files looks more like a mistake though.

There's a whole bunch of issues on the Hatch issue tracker about licenses, so hard to tell what the current state is. @ofek maybe you can clarify, and check if this Hatch mention needs a tweak?

``src`` 3
``calmjs_artifacts`` 3
``.idea`` 2
====================== ===============
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of these look like mistakes. Possible exceptions are the license-related directories and include. Is it easy to find the artifacts that contained include?

================= ==========
Directory name PEP
================= ==========
``licenses`` :pep:`639`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add LICENSES to this list of allowed directory names as well (see more extensive comment further down)?

================= ==========

Build backends MUST NOT create subdirectories in the ``.dist-info`` directory
beyond the names in the registry to avoid collisions with future reserved names.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the text say anything here about other tools like frontends and publishing tools? I'd expect that build frontends want to do nothing, however twine and uv publish MAY want to validate new artifacts before uploading them.

* Other subdirectory names under ``.dist-info`` appear to be either not
widespread or accidental.

As a result of this query
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incomplete sentence. I think you want to draw a conclusion here. Probably that it's recommended for frontends to not complain about unknown directory names for the sake of backwards compatibility?

@rgommers
Copy link
Contributor

@jkowalleck please don't post the same comment in two places. You seem to be new to Python packaging conversations, so for context: Discourse is the right place for high-level discussion and comments like "I prefer approach X over approach Y because Z"; PEP PRs are more editorial and for initial reviews on correctness/completeness before posting to a broader audience on Discourse.

@rgommers
Copy link
Contributor

@sethmlarson the description of PEP 725 looks pretty good as well. I'd suggest one small tweak to make the first bullet point more clear, since "abstract dependencies" isn't a well-defined term and you're only giving virtual: rather than a pkg: example. I suggest to add a more apples to apples comparison for OpenSSL/libssl: the PEP 725 dependency specifier pkg:generic/openssl is what will result in pkg:pkg:rpm/almalinux/[email protected] in an SBOM.

The analogy that I tend to use is "dependencies in pyproject.toml vs. "resolved dependencies in a lock file".

@jkowalleck
Copy link

jkowalleck commented Feb 26, 2025

re: #4283 (review)

You may want to mention somewhere that using a separate [additional-files] key means that packages can start using it directly after acceptance of this PEP, rather than have a >1 yr rollout plan that would have been needed with a core metadata version bump.

Is "additional-files" part of core metadata already?

@pfmoore
Copy link
Member

pfmoore commented Feb 26, 2025

Is "additional-files" part of core metadata already?

It's not a metadata item, it's a key in pyproject.toml.

@jkowalleck
Copy link

jkowalleck commented Feb 26, 2025

re: #4283 (review)

You may want to mention somewhere that using a separate [additional-files] key means that packages can start using it directly after acceptance of this PEP, rather than have a >1 yr rollout plan that would have been needed with a core metadata version bump.

Is "additional-files" part of core metadata already?

re: #4283 (comment)

Is "additional-files" part of core metadata already?

It's not a metadata item, it's a key in pyproject.toml.

Could you explain what this "rather than have a >1 yr rollout plan that would have been needed with a core metadata version bump" is supposed to mean?

Copy link
Member

@pfmoore pfmoore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me. I think any comments I might have had have already been covered by @rgommers

You've put a lot more details into the specification of additional-files than I had anticipated, but that's a good thing - it feels like it's well prepared for any future use.

@pfmoore
Copy link
Member

pfmoore commented Feb 26, 2025

@jkowalleck If we put the data into the core metadata (ignoring for now the problem that we don't have a viable way of doing so that conforms to the rules around dynamic and static metadata) , then we'd have to wait for a new metadata version to be implemented by build backends, recognised by PyPI and other tools, and supported throughout the ecosystem before it would be usable. The experience with the license-files metadata is that (a) this is a slow process, and (b) if tools try to implement support before the infrastructure is in place, we end up causing problems for users that take even longer to fix.

Conversely, if we add a new key to pyproject.toml, tools can add support for it with very little need to wait for infrastructure support. The .dist-info subdirectories are currently unregulated, so as long as tools write content that won't be invalidated by this PEP, they won't hit problems by being early in doing so.

But as @rgommers said, can this discussion be relocated to Discourse if you wish to continue it, please?

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

Successfully merging this pull request may close these issues.

4 participants