PSA: qualifications to the source distribution specification

I’m opening this DPO thread at @rgommers’ request.

PSA: this PR is going to make some clarifying changes to the source distribution specification. These changes clarify existing requirements, but packagers/build backend maintainers should be aware of them to ensure that they’re conforming with the living standard for source distributions.

The main changes:

  • The specification now emphasizes that source distributions MUST be a pax-style tar archive. This was already required, but has historically been loosely enforced by packaging tooling.
  • Source distributions MUST NOT use non-pax features, including GNU tar extensions or the V7 (“legacy”) style tar format.
  • Source distributions MUST NOT use vendor extensions to pax, including VENDOR.attr style pax records that are not defined within the pax specification itself.

These changes should have no impact on end users, since PyPI will continue to serve any source distributions that were created before these changes (as well as distributions that were created long before sdists were standardized at all). However, in the medium term, PyPI may decide to begin rejecting new sdist uploads that do not strictly conform to the sdist specification. This will be its own protracted process, since users will need to be alerted and given ample time to fix their distributions before a breaking change can be made.

(PyPI already rejects some sdist uploads as a matter of policy, but has not rejected non-pax sdists wholesale yet.)

15 Likes

Also mostly tangential to these changes, but for those curious about the overall pax/GNU split among sdists, I made this visualization:

And the full table for the top 15k packages:

(Thanks, as always, to @hugovk for making this data so easy to pull!)

5 Likes

Any chance of having a filter option to just show the packages that aren’t using PAX? I.e., how do I check that one of my projects isn’t already doing this? :sweat_smile:

1 Like

It has that here!

(Only for the top 15k currently, though.)

1 Like

Ah, missed the blue link at the top. Thanks!

1 Like

The linked PR with these spec clarifications is merged now. Thanks for working on this @woodruffw!

1 Like