-
Notifications
You must be signed in to change notification settings - Fork 932
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
Add PEP 517, PEP 518 & PEP 660 to specs and glossary #1111
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,19 +12,46 @@ Glossary | |
extensions. | ||
|
||
|
||
Build Frontend | ||
|
||
A tool that users interact with directly to trigger a build of | ||
a :term:`Project`, which in turn invokes the project's | ||
:term:`Build Backend` in a suitable environment | ||
to generate a :term:`Built Distribution` (i.e. a :term:`Wheel`), | ||
from a :term:`Source Tree` or :term:`Source Distribution`. | ||
Examples include :ref:`build`, as well as :ref:`pip` | ||
(when running a command such as ``pip wheel some-directory/``). | ||
Compare to :term:`Integration Frontend`. | ||
For more details, | ||
see the :ref:`build-frontend-backend-interface` specification. | ||
|
||
|
||
Build Backend | ||
|
||
A tool directly responsible for transforming a | ||
:term:`Source Tree` or :term:`Source Distribution` | ||
into a :term:`Built Distribution` (i.e. a :term:`Wheel`). | ||
Typically invoked by a :term:`Build Frontend` rather than directly. | ||
Examples include :ref:`flit`, :ref:`hatch` and :ref:`setuptools`. | ||
For more details, | ||
see the :ref:`build-frontend-backend-interface` specification. | ||
|
||
|
||
Built Distribution | ||
|
||
A :term:`Distribution <Distribution Package>` format containing files | ||
and metadata that only need to be moved to the correct location on the | ||
target system, to be installed. :term:`Wheel` is such a format, whereas | ||
distutil's :term:`Source Distribution <Source Distribution (or | ||
"sdist")>` is not, in that it requires a build step before it can be | ||
installed. This format does not imply that Python files have to be | ||
precompiled (:term:`Wheel` intentionally does not include compiled | ||
Python files). | ||
A :term:`Distribution` format containing files and metadata | ||
that only need to be moved to the correct location | ||
on the target system to be installed. | ||
:term:`Wheel` is such a format, whereas a :term:`Sdist` is not, | ||
in that it requires processing by the :term:`Project`'s | ||
:term:`Build Backend` before it can be installed. | ||
This format does not imply that Python files have to be precompiled | ||
(:term:`Wheel` intentionally does not include compiled Python files). | ||
|
||
|
||
Distribution Package | ||
Distribution | ||
Package | ||
Comment on lines
+53
to
+54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please don't add these -- we explicitly don't use the short forms here, to avoid ambiguity across the board. This is also called out in the definition here. If there's places where we're that using the short form to direct at this, I'd rather that we update those references to be more explicit. |
||
|
||
A versioned archive file that contains Python :term:`packages <Import | ||
Package>`, :term:`modules <Module>`, and other resource files that are | ||
|
@@ -39,6 +66,27 @@ Glossary | |
language distribution), which are often referred to with the single term | ||
"distribution". | ||
|
||
|
||
Editable Installation | ||
Editable Mode | ||
|
||
An installation mode implying that the :term:`Source Tree` of the | ||
:term:`project` being installed is available in a local directory, | ||
in which users expect that changes to its *Python* code | ||
become effective without the need of a new installation step. | ||
|
||
When a project is installed in "editable mode", | ||
users expect it to behave as identically as practical | ||
to a non-editable installation | ||
(though some minor differences might be visible). | ||
In particular, the code must be importable by other code, | ||
and metadata must be available by standard mechanisms | ||
such as ``importlib.metadata``. | ||
|
||
Formally specified in :pep:`660` and now defined in the | ||
:ref:`build-frontend-backend-interface` specification. | ||
|
||
|
||
Egg | ||
|
||
A :term:`Built Distribution` format introduced by :ref:`setuptools`, | ||
|
@@ -75,6 +123,22 @@ Glossary | |
is needed to prevent confusion with a :term:`Distribution Package` which | ||
is also commonly called a "package". | ||
|
||
|
||
Integration Frontend | ||
|
||
A tool that users run directly | ||
that takes a set of :term:`Requirement`\s, | ||
such as from a :term:`Project`'s :ref:`core-metadata`, | ||
a :term:`Requirements File` or specified manually, | ||
and attempts to update a working environment to satisfy them. | ||
This may require locating, building and installing | ||
a combination of :term:`Built Distribution`\s | ||
and :term:`Source Distribution`\s, | ||
including acting as a :term:`Build Frontend` in the latter case. | ||
In a command like ``pip install lxml==2.4.0``, | ||
:ref:`pip` is acting as an integration frontend. | ||
|
||
|
||
Module | ||
|
||
The basic unit of code reusability in Python, existing in one of two | ||
|
@@ -96,26 +160,30 @@ Glossary | |
|
||
Project | ||
|
||
A library, framework, script, plugin, application, or collection of data | ||
or other resources, or some combination thereof that is intended to be | ||
packaged into a :term:`Distribution <Distribution Package>`. | ||
|
||
Since most projects create :term:`Distributions <Distribution Package>` | ||
using either :pep:`518` ``build-system``, :ref:`distutils` or | ||
:ref:`setuptools`, another practical way to define projects currently | ||
is something that contains a :term:`pyproject.toml`, :term:`setup.py`, | ||
or :term:`setup.cfg` file at the root of the project source directory. | ||
|
||
Python projects must have unique names, which are registered on | ||
:term:`PyPI <Python Package Index (PyPI)>`. Each project will then | ||
contain one or more :term:`Releases <Release>`, and each release may | ||
comprise one or more :term:`distributions <Distribution Package>`. | ||
A library, framework, script, plugin, application, | ||
collection of data or other resources, or some combination thereof | ||
that is intended to be packaged into a :term:`Distribution`. | ||
Comment on lines
+163
to
+165
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think applications are necessarily packaged, often just installed in a virtual environment with locked deps. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've definitely seen deployment mechanisms where the application is being packaged like a regular Python package, and shipped with all its dependencies, as a bundle of files. This is how, for example, https://shiv.readthedocs.io/en/latest/ works and pyinstaller works. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For sure! My point was just not always |
||
|
||
Since most projects create :term:`Distribution`\s | ||
using a :term:`Build Backend` :ref:`declared <declaring-build-system>` | ||
within a :ref:`pyproject.toml file <pyproject-toml-config-file>`, | ||
(or else implicitly use :ref:`setuptools`), | ||
another practical way to define a project | ||
is something that contains a :term:`pyproject.toml` | ||
(or :term:`setup.py`/:term:`setup.cfg`) file | ||
at the root of the project :term:`Source Tree`. | ||
|
||
Python projects must have unique :ref:`names <core-metadata-name>`, | ||
which are registered on a :term:`Package Index` | ||
such as :term:`PyPI <Python Package Index (PyPI)>`. | ||
Each project will contain one or more :term:`Releases <Release>`, | ||
and each release may comprise one or more :term:`Distribution`\s. | ||
|
||
Note that there is a strong convention to name a project after the name | ||
of the package that is imported to run that project. However, this | ||
doesn't have to hold true. It's possible to install a distribution from | ||
the project 'foo' and have it provide a package importable only as | ||
'bar'. | ||
of the package that is imported to use that project. | ||
However, this doesn't have to hold true. | ||
It's possible to install a distribution from the project ``foo`` | ||
and have it provide a package importable only as ``bar``. | ||
|
||
|
||
Pure Module | ||
|
@@ -149,10 +217,13 @@ Glossary | |
domain name, ``pypi.python.org``, in 2017. It is powered by | ||
:ref:`warehouse`. | ||
|
||
|
||
pyproject.toml | ||
|
||
The tool-agnostic :term:`Project` specification file. | ||
Defined in :pep:`518`. | ||
The tool-agnostic :term:`Project` configuration file. | ||
Originally introduced in :pep:`518` and now defined in the | ||
:ref:`pyproject-toml-config-file` specification. | ||
|
||
|
||
Release | ||
|
||
|
@@ -167,28 +238,33 @@ Glossary | |
|
||
Requirement | ||
|
||
A specification for a :term:`package <Distribution Package>` to be | ||
installed. :ref:`pip`, the :term:`PYPA <Python Packaging Authority | ||
(PyPA)>` recommended installer, allows various forms of specification | ||
that can all be considered a "requirement". For more information, see the | ||
:ref:`pip:pip install` reference. | ||
A specification for a :term:`Package` | ||
to be installed by an :term:`Integration Frontend`. | ||
:ref:`pip`, the :term:`PyPA <Python Packaging Authority (PyPA)>` | ||
recommended installer, | ||
allows various forms of specification | ||
that can all be considered a "requirement". | ||
For more information, see the :ref:`pip:pip install` reference. | ||
|
||
|
||
Requirement Specifier | ||
|
||
A format used by :ref:`pip` to install packages from a :term:`Package | ||
Index`. For an EBNF diagram of the format, see the | ||
`pkg_resources.Requirement | ||
<https://setuptools.readthedocs.io/en/latest/pkg_resources.html#requirement-objects>`_ | ||
entry in the :ref:`setuptools` docs. For example, "foo>=1.3" is a | ||
requirement specifier, where "foo" is the project name, and the ">=1.3" | ||
portion is the :term:`Version Specifier` | ||
A syntax used to declare the name and version of a :term:`Package` | ||
that an :term:`Integration Frontend` such as :ref:`pip` | ||
should install from a :term:`Package Index`. | ||
For example, ``foo>=1.3`` is a requirement specifier, | ||
where ``foo`` is the :ref:`project name <core-metadata-name>` | ||
and ``>=1.3`` is the :term:`Version Specifier`. | ||
The format was initially specified in :pep:`508`, | ||
and is now defined in the :ref:`dependency-specifiers` specification. | ||
|
||
|
||
Requirements File | ||
|
||
A file containing a list of :term:`Requirements <Requirement>` that can | ||
be installed using :ref:`pip`. For more information, see the :ref:`pip` | ||
docs on :ref:`pip:Requirements Files`. | ||
A file containing a list of :term:`Requirement`\s that can | ||
be installed using an :term:`Integration Frontend`, such as :ref:`pip`. | ||
For more information, | ||
see the :ref:`pip` docs on :ref:`pip:Requirements Files`. | ||
|
||
|
||
setup.py | ||
|
@@ -200,17 +276,32 @@ Glossary | |
|
||
Source Archive | ||
|
||
An archive containing the raw source code for a :term:`Release`, prior | ||
to creation of a :term:`Source Distribution <Source Distribution (or | ||
"sdist")>` or :term:`Built Distribution`. | ||
An archive containing the :term:`Source Tree` for a :term:`Release`, | ||
prior to creation of a | ||
:term:`Source Distribution` or :term:`Built Distribution`. | ||
|
||
|
||
Source Distribution | ||
Sdist | ||
|
||
A :term:`Distribution` format | ||
(generated using, e.g., ``python -m build --sdist``) | ||
that provides metadata and the essential source files needed | ||
by a :term:`Build Backend` to generate a :term:`Built Distribution` | ||
for installation by an installer like :ref:`pip`. | ||
|
||
Source Distribution (or "sdist") | ||
|
||
A :term:`distribution <Distribution Package>` format (usually generated | ||
using ``python setup.py sdist``) that provides metadata and the | ||
essential source files needed for installing by a tool like :ref:`pip`, | ||
or for generating a :term:`Built Distribution`. | ||
Source Tree | ||
|
||
A collection of files and directories (typically from a VCS checkout) | ||
containing the raw source code of a :term:`project` | ||
that is used for development. | ||
Can be stored in a :term:`Source Archive` | ||
and is used by a :term:`Build Backend` to generate a | ||
:term:`Source Distribution` | ||
and in turn a :term:`Built Distribution`, | ||
as well as directly in an :term:`Editable Installation`. | ||
Typically contains a :ref:`pyproject-toml-config-file` at its root. | ||
|
||
|
||
System Package | ||
|
@@ -235,11 +326,15 @@ Glossary | |
wide. For more information, see the section on :ref:`Creating and using | ||
Virtual Environments`. | ||
|
||
|
||
Wheel | ||
|
||
A :term:`Built Distribution` format introduced by :pep:`427`, | ||
which is intended to replace the :term:`Egg` format. Wheel is currently | ||
supported by :ref:`pip`. | ||
A :term:`Built Distribution` format, introduced by :pep:`427` | ||
and now defined in the :ref:`binary-distribution-format` specification, | ||
which replaces the legacy :term:`Egg` format. | ||
Wheel is supported by :ref:`pip` and other installation tools, | ||
and is the primary output of :term:`Build Backend`\s. | ||
|
||
|
||
Working Set | ||
|
||
|
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.
I think we should remove sdist since backends just get a simple directory, which frontends may populate with sdist contents rather than using the source.