-
Notifications
You must be signed in to change notification settings - Fork 1k
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
WIP: Add sdist format specification and metadata field (PEP 643) #785
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d3f138b
Add sdist format specification and metadata field (PEP 643)
pfmoore 67c57a0
Clarify that the constraints on wheel metadata only apply for version…
pfmoore 311b358
Fix details of sdist name format
pfmoore 5da5bc6
Apply suggestions from code review
pfmoore 886bb62
Various updates for PEP 643
pfmoore 7cc7fac
Merge branch 'pep643' of https://github.com/pfmoore/python-packaging-…
pfmoore 75c4acc
Merge branch 'master' into pep643
pfmoore File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
.. _binary-distribution-format: | ||
|
||
========================== | ||
Binary distribution format | ||
========================== | ||
|
||
The binary distribution format (:term:`wheel <Wheel>`) is defined in :pep:`427`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
|
||
.. _source-distribution-format: | ||
|
||
========================== | ||
Source distribution format | ||
========================== | ||
|
||
The current standard format of source distribution format is identified by the | ||
presence of a :file:`pyproject.toml` file in the distribution archive. The layout | ||
of such a distribution was originally specified in :pep:`517` and is formally | ||
documented here. | ||
|
||
There is also the legacy source distribution format, implicitly defined by the | ||
behaviour of ``distutils`` module in the standard library, when executing | ||
:command:`setup.py sdist`. This document does not attempt to standardise this | ||
format, except to note that if a legacy source distribution contains a | ||
``PKG-INFO`` file using metadata version 2.2 or later, then it MUST follow | ||
the rules applicable to source distributions defined in the metadata | ||
specification. | ||
|
||
Source distributions are also known as *sdists* for short. | ||
|
||
Source distribution file name | ||
============================= | ||
|
||
The file name of a sdist is not currently standardised, although the *de facto* | ||
form is ``{name}-{version}.tar.gz``, where ``{name}`` is the canonicalized form | ||
of the project name (see :pep:`503` for the canonicalization rules) with ``-`` | ||
characters replaced with ``_``, and ``{version}`` is the project version. | ||
|
||
The name and version components of the filename MUST match the values stored | ||
in the metadata contained in the file. | ||
|
||
Source distribution file format | ||
=============================== | ||
|
||
A ``.tar.gz`` source distribution (sdist) contains a single top-level directory | ||
called ``{name}-{version}`` (e.g. ``foo-1.0``), containing the source files of | ||
the package. The name and version MUST match the metadata stored in the file. | ||
This directory must also contain a :file:`pyproject.toml` in the format defined in | ||
:ref:`declaring-build-dependencies`, and a ``PKG-INFO`` file containing | ||
metadata in the format described in the :ref:`core-metadata` specification. The | ||
metadata MUST conform to at least version 2.2 of the metadata specification. | ||
|
||
No other content of a sdist is required or defined. Build systems can store | ||
whatever information they need in the sdist to build the project. | ||
|
||
The tarball should use the modern POSIX.1-2001 pax tar format, which specifies | ||
UTF-8 based file names. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Old PEP removed but no mention of a new PEP 643? Is this intentional?
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.
Yes, because PEP 643 does not specify the whole format, just the addition. I didn't think it made sense to say "Version 2.1 was specified in 566, which also made this document canonical, then 643 updated it to 2.2" with the result that the paragraph becomes an extended audit trail of all the PEPs that change the spec.
IMO, the whole point of making this document canonical is that we don't need to link back to the PEPs. 2.1 linking back to 566 was OK, as that was the version that changed the canonical source of the spec. But now we've moved to the next version, I think it's time to drop the (essentially historical, now) note.