Skip to content

Commit 028da95

Browse files
committed
have the glossary use 'import package' and 'distribution package' expanded terms
1 parent 11e7643 commit 028da95

File tree

7 files changed

+89
-99
lines changed

7 files changed

+89
-99
lines changed

source/current.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ what tools are currently recommended, then here it is.
1414
Installation Tool Recommendations
1515
=================================
1616

17-
* Use :ref:`pip` to install Python :term:`distributions <Distribution>` from
17+
* Use :ref:`pip` to install Python :term:`packages <Distribution Package>` from
1818
:term:`PyPI <Python Package Index (PyPI)>`. [1]_ [2]_
1919

2020
* Use :ref:`virtualenv`, or `pyvenv`_ to isolate application specific

source/development.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -269,14 +269,14 @@ Three options are available in this area:
269269
2. devpi provides higher-level caching option, potentially shared amongst
270270
many users or machines, and
271271
3. bandersnatch provides a local complete mirror of all PyPI :term:`packages
272-
<Package (Meaning #2)>`.
272+
<Distribution Package>`.
273273

274274

275275
Caching with pip
276276
----------------
277277

278278
pip provides a number of facilities for speeding up installation by using local
279-
cached copies of :term:`packages <Package (Meaning #2)>`:
279+
cached copies of :term:`packages <Distribution Package>`:
280280

281281
1. `Fast & local installs
282282
<https://pip.pypa.io/en/latest/user_guide.html#fast-local-installs>`_ by
@@ -304,14 +304,14 @@ Complete mirror with bandersnatch
304304
----------------------------------
305305

306306
bandersnatch will set up a complete local mirror of all PyPI :term:`packages
307-
<Package (Meaning #2)>` (externally-hosted packages are not mirrored). See
307+
<Distribution Package>` (externally-hosted packages are not mirrored). See
308308
the `bandersnatch documentation for getting that going`__.
309309

310310
__ https://bitbucket.org/pypa/bandersnatch/overview
311311

312312
A benefit of devpi is that it will create a mirror which includes
313-
:term:`packages <Package (Meaning #2)>` that are external to PyPI, unlike
314-
bandersnatch which will only cache :term:`packages <Package (Meaning #2)>`
313+
:term:`packages <Distribution Package>` that are external to PyPI, unlike
314+
bandersnatch which will only cache :term:`packages <Distribution Package>`
315315
hosted on PyPI.
316316

317317

source/distributing.rst

+12-12
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ We recommend the following installation sequence:
3535

3636
1. For building :term:`wheels <Wheel>`: ``pip install wheel`` [1]_
3737

38-
2. For uploading :term:`packages <Package (Meaning #2)>`: ``pip install twine``
38+
2. For uploading :term:`packages <Distribution Package>`: ``pip install twine``
3939
[1]_
4040

4141

@@ -130,7 +130,7 @@ from `sampleproject/setup.py
130130

131131
packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
132132

133-
It's required to list the :term:`packages <Package (Meaning #1)>` to be included
133+
It's required to list the :term:`packages <Import Package>` to be included
134134
in your project. Although they can be listed manually,
135135
``setuptools.find_packages`` finds them automatically. Use the ``exclude``
136136
keyword argument to omit packages that are not intended to be released and
@@ -214,8 +214,7 @@ For more on using "install_requires" see :ref:`install_requires vs Requirements
214214
Package Data
215215
------------
216216

217-
Often, additional files need to be installed into a :term:`package <Package
218-
(Meaning #1)>`. These files are often data that’s closely related to the
217+
Often, additional files need to be installed into a :term:`package <Import Package>`. These files are often data that’s closely related to the
219218
package’s implementation, or text files containing documentation that might be
220219
of interest to programmers using the package. These files are called "package
221220
data".
@@ -246,7 +245,7 @@ Data Files
246245

247246
Although configuring :ref:`Package Data` is sufficient for most needs, in some
248247
cases you may need to place data files *outside* of your :term:`packages
249-
<Package (Meaning #1)>`. The ``data_files`` directive allows you to do that.
248+
<Import Package>`. The ``data_files`` directive allows you to do that.
250249

251250
from `sampleproject/setup.py
252251
<https://github.com/pypa/sampleproject/blob/master/setup.py>`_
@@ -258,7 +257,7 @@ from `sampleproject/setup.py
258257
Each (directory, files) pair in the sequence specifies the installation
259258
directory and the files to install there. If directory is a relative path, it is
260259
interpreted relative to the installation prefix (Python’s sys.prefix for
261-
pure-Python :term:`distributions <Distribution>`, sys.exec_prefix for
260+
pure-Python :term:`distributions <Distribution Package>`, sys.exec_prefix for
262261
distributions that contain extension modules). Each file name in files is
263262
interpreted relative to the ``setup.py`` script at the top of the project source
264263
distribution.
@@ -295,10 +294,10 @@ Although ``setup.py`` supports a `scripts
295294
keyword for pointing to pre-made scripts, the recommended approach to achieve
296295
cross-platform compatibility is to use "console_script" `entry points
297296
<http://pythonhosted.org/setuptools/setuptools.html#dynamic-discovery-of-services-and-plugins>`_
298-
that register your script interfaces. You can then let the toolchain handle
299-
the work of turning these interfaces into actual scripts [2]_. The scripts
300-
will be generated during the install of your
301-
:term:`distribution <Distribution>`.
297+
that register your script interfaces. You can then let the toolchain handle the
298+
work of turning these interfaces into actual scripts [2]_. The scripts will be
299+
generated during the install of your :term:`distribution <Distribution
300+
Package>`.
302301

303302
For more information, see `Automatic Script Creation
304303
<http://pythonhosted.org/setuptools/setuptools.html#automatic-script-creation>`_
@@ -345,8 +344,9 @@ Packaging your Project
345344
======================
346345

347346
To have your project installable from a :term:`Package Index` like :term:`PyPI
348-
<Python Package Index (PyPI)>`, you'll need to create a :term:`Distribution`
349-
(aka ":term:`Package <Package (Meaning #2)>`" ) for your project.
347+
<Python Package Index (PyPI)>`, you'll need to create a :term:`Distribution
348+
<Distribution Package>` (aka ":term:`Package <Distribution Package>`" ) for your
349+
project.
350350

351351

352352

source/glossary.rst

+52-62
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,29 @@ Glossary
1818

1919
Built Distribution
2020

21-
A :term:`Distribution` format containing files and metadata that only
22-
need to be moved to the correct location on the target system, to be
23-
installed. :term:`Wheel` is such a format, whereas distutil's
24-
:term:`Source Distribution <Source Distribution (or "sdist")>` is not,
25-
in that it requires a build step before it can be installed. This
26-
format does not imply that python files have to be precompiled
27-
(:term:`Wheel` intentionally does not include compiled python files).
28-
29-
30-
Distribution
31-
32-
A Python distribution is a versioned archive file that contains Python
33-
:term:`packages <Package (Meaning #1)>`, :term:`modules <module>`, and
34-
other resource files that are used to distribute a :term:`Release`. The
35-
distribution file is what an end-user will download from the internet
36-
and install. Distributions are often referred to as ":term:`Packages
37-
<Package (Meaning #2)>`".
21+
A :term:`Distribution <Distribution Package>` format containing files
22+
and metadata that only need to be moved to the correct location on the
23+
target system, to be installed. :term:`Wheel` is such a format, whereas
24+
distutil's :term:`Source Distribution <Source Distribution (or
25+
"sdist")>` is not, in that it requires a build step before it can be
26+
installed. This format does not imply that python files have to be
27+
precompiled (:term:`Wheel` intentionally does not include compiled
28+
python files).
29+
30+
31+
Distribution Package
32+
33+
A versioned archive file that contains Python :term:`packages <Import
34+
Package>`, :term:`modules <module>`, and other resource files that are
35+
used to distribute a :term:`Release`. The distribution file is what an
36+
end-user will download from the internet and install.
37+
38+
A distribution package is more commonly referred to with the single
39+
words "package" or "distribution", but this guide may use the expanded
40+
term when more clarity is needed to prevent confusion with an
41+
:term:`Import Package` which is also commonly called a "package", or
42+
another kind of distribution (e.g. Linux or Python itself), which often
43+
use the single term "distribution".
3844

3945
Egg
4046

@@ -63,61 +69,45 @@ Glossary
6369
multiple individual distributions.
6470

6571

66-
Module
67-
68-
The basic unit of code reusability in Python, existing in one of two
69-
types: :term:`Pure Module`, or :term:`Extension Module`.
70-
71-
72-
Package (Meaning #1)
72+
Import Package
7373

7474
A Python module which can contain other modules or recursively, other
75-
packages. You can import a package: ``import mypackage``.
76-
77-
For the purpose of distinguishing from the :term:`second meaning
78-
<Package (Meaning #2)>` of "package", this guide may use the phrase
79-
"Import Package" for clarity.
80-
75+
packages.
8176

82-
Package (Meaning #2)
77+
An import package is more commonly referred to with the single word
78+
"package", but this guide will use the expanded term when more clarity
79+
is needed to prevent confusion with a :term:`Distribution Package` which
80+
is also commonly called a "package".
8381

84-
A synonym for :term:`Distribution`. It is common in Python to refer to a
85-
distribution using the term "package". While the two meanings of the
86-
term "package" is not always 100% unambigous, the context of the term
87-
"package" is usually sufficient to distinguish the meaning of the
88-
word. For example, the python installation tool :ref:`pip` is an acronym
89-
for "pip installs packages". while technically the tool installs
90-
distributions. Even the site where distributions are distributed at is
91-
called the ":term:`Python Package Index <Python Package Index (PyPI)>`"
92-
(and not the "Python Distribution Index").
82+
Module
9383

94-
For the purpose of distinguishing from the :term:`first meaning<Package
95-
(Meaning #1)>` of "package", this guide may use the phrase "Distribution
96-
Package" for clarity.
84+
The basic unit of code reusability in Python, existing in one of two
85+
types: :term:`Pure Module`, or :term:`Extension Module`.
9786

9887

9988
Package Index
10089

10190
A repository of distributions with a web interface to automate
102-
:term:`Distribution` discovery and consumption.
91+
:term:`package <Distribution Package>` discovery and consumption.
10392

10493

10594
Project
10695

10796
A library, framework, script, plugin, application, or collection of data
10897
or other resources, or some combination thereof that is intended to be
109-
packaged into a :term:`Distribution`.
98+
packaged into a :term:`Distribution <Distribution Package>`.
11099

111-
Since most projects create :term:`Distributions <Distribution>` using
112-
:ref:`distutils` or :ref:`setuptools`, another practical way to define
113-
projects currently is something that contains a :term:`setup.py` at the
114-
root of the project src directory, where "setup.py" is the project
115-
specification filename used by :ref:`distutils` and :ref:`setuptools`.
100+
Since most projects create :term:`Distributions <Distribution Package>`
101+
using :ref:`distutils` or :ref:`setuptools`, another practical way to
102+
define projects currently is something that contains a :term:`setup.py`
103+
at the root of the project src directory, where "setup.py" is the
104+
project specification filename used by :ref:`distutils` and
105+
:ref:`setuptools`.
116106

117107
Python projects must have unique names, which are registered on
118108
:term:`PyPI <Python Package Index (PyPI)>`. Each project will then
119109
contain one or more :term:`Releases <Release>`, and each release may
120-
comprise one or more :term:`distributions <Distribution>`.
110+
comprise one or more :term:`distributions <Distribution Package>`.
121111

122112
Note that there is a strong convention to name a project after the name
123113
of the package that is imported to run that project. However, this
@@ -153,14 +143,14 @@ Glossary
153143
by a version identifier.
154144

155145
Making a release may entail the publishing of multiple
156-
:term:`Distributions <Distribution>`. For example, if version 1.0 of a
157-
project was released, it could be available in both a source
146+
:term:`Distributions <Distribution Package>`. For example, if version
147+
1.0 of a project was released, it could be available in both a source
158148
distribution format and a Windows installer distribution format.
159149

160150

161151
Requirement
162152

163-
A specification for a :term:`package <Package (Meaning #2)>` to be
153+
A specification for a :term:`package <Distribution Package>` to be
164154
installed. :ref:`pip`, the :term:`PYPA <Python Packaging Authority
165155
(PyPA)>` recommended installer, allows various forms of specification
166156
that can all be considered a "requirement". For more information, see the
@@ -188,10 +178,10 @@ Glossary
188178

189179
Source Distribution (or "sdist")
190180

191-
A :term:`distribution <Distribution>` format (usually generated using
192-
``python setup.py sdist``) that provides metadata and the essential
193-
source files needed for installing by a tool like :ref:`pip`, or for
194-
generating a :term:`Built Distribution`.
181+
A :term:`distribution <Distribution Package>` format (usually generated
182+
using ``python setup.py sdist``) that provides metadata and the
183+
essential source files needed for installing by a tool like :ref:`pip`,
184+
or for generating a :term:`Built Distribution`.
195185

196186

197187
System Package
@@ -215,7 +205,7 @@ Glossary
215205

216206
Working Set
217207

218-
A collection of :term:`distributions <Distribution>` available for
219-
importing. These are the distributions that are on the `sys.path`
220-
variable. At most, one :term:`Distribution` for a project is possible in
221-
a working set.
208+
A collection of :term:`distributions <Distribution Package>` available
209+
for importing. These are the distributions that are on the `sys.path`
210+
variable. At most, one :term:`Distribution <Distribution Package>` for a
211+
project is possible in a working set.

source/installing.rst

+14-14
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ Tutorial on Installing Packages
99
:local:
1010

1111
This tutorial covers the basics of how to install Python :term:`packages
12-
<Package (Meaning #2)>`.
13-
14-
It's important to note that the term ":term:`package <Package (Meaning #2)>`" in
15-
this context is being used as a synonym for a :term:`distribution` (i.e. a
16-
bundle of software to be installed), not to refer to the kind of :term:`package
17-
<Package (Meaning #1)>` that you import in your Python source code (i.e. a
18-
directory of modules). It is common in the Python community to refer to a
19-
:term:`distribution` using the term "package". Using the term "distribution" is
20-
often not preferred, because it can easily be confused with a Linux
12+
<Distribution Package>`.
13+
14+
It's important to note that the term "package" in this context is being used as
15+
a synonym for a :term:`distribution <Distribution Package>` (i.e. a bundle of
16+
software to be installed), not to refer to the kind of :term:`package <Import
17+
Package>` that you import in your Python source code (i.e. a container of
18+
modules). It is common in the Python community to refer to a :term:`distribution
19+
<Distribution Package>` using the term "package". Using the term "distribution"
20+
is often not preferred, because it can easily be confused with a Linux
2121
distribution, or another larger software distribution like Python itself.
2222

2323

@@ -74,8 +74,8 @@ We recommend the following installation sequence:
7474
Virtual Environments
7575
====================
7676

77-
Python "Virtual Environments" allow Python :term:`packages <Package (Meaning
78-
#2)>` to be installed in an isolated location for a particular application,
77+
Python "Virtual Environments" allow Python :term:`packages <Distribution
78+
Package>` to be installed in an isolated location for a particular application,
7979
rather than being installed globally.
8080

8181
Imagine you have an application that needs version 1 of LibFoo, but another
@@ -88,7 +88,7 @@ Or more generally, what if you want to install an application and leave it be?
8888
If an application works, any change in its libraries or the versions of those
8989
libraries can break the application.
9090

91-
Also, what if you can’t install :term:`packages <Package (Meaning #2)>` into the
91+
Also, what if you can’t install :term:`packages <Distribution Package>` into the
9292
global site-packages directory? For instance, on a shared host.
9393

9494
In all these cases, virtual environments can help you. They have their own
@@ -214,7 +214,7 @@ default, pip only finds stable versions.
214214
Wheels
215215
------
216216

217-
:term:`Wheel` is a pre-built :term:`distribution <Distribution>` format that
217+
:term:`Wheel` is a pre-built :term:`distribution <Distribution Package>` format that
218218
provides faster installation compared to :term:`Source Distributions (sdist)
219219
<Source Distribution (or "sdist")>`, especially when a project contains compiled
220220
extensions.
@@ -246,7 +246,7 @@ comparison, see :ref:`Wheel vs Egg`.
246246
User Installs
247247
-------------
248248

249-
To install :term:`packages <Package (Meaning #2)>` that are isolated to the
249+
To install :term:`packages <Distribution Package>` that are isolated to the
250250
current user, use the ``--user`` flag:
251251

252252
::

source/projects.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,9 @@ User irc:#pypa |
277277
Dev irc:#pypa-dev
278278

279279
A package in the Python Standard Library that has support for creating and
280-
installing :term:`distributions <Distribution>`. :ref:`Setuptools` provides
281-
enhancements to distutils, and is much more commonly used than just using
282-
distutils by itself.
280+
installing :term:`distributions <Distribution Package>`. :ref:`Setuptools`
281+
provides enhancements to distutils, and is much more commonly used than just
282+
using distutils by itself.
283283

284284

285285
.. _venv:

source/technical.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ pip vs easy_install
122122
===================
123123

124124
`easy_install` was released in 2004, as part of :ref:`setuptools`. It was
125-
notable at the time for installing :term:`packages <Package (Meaning #2)>` from
125+
notable at the time for installing :term:`packages <Distribution Package>` from
126126
:term:`PyPI <Python Package Index (PyPI)>` using requirement specifiers, and
127127
automatically installing dependencies.
128128

@@ -197,7 +197,7 @@ Wheel vs Egg
197197

198198
* :term:`Wheel` has an :ref:`official PEP <PEP427s>`. :term:`Egg` did not.
199199

200-
* :term:`Wheel` is a :term:`distribution <Distribution>` format, i.e a packaging
200+
* :term:`Wheel` is a :term:`distribution <Distribution Package>` format, i.e a packaging
201201
format. [2]_ :term:`Egg` was both a distribution format and a runtime
202202
installation format (if left zipped), and was designed to be importable.
203203

0 commit comments

Comments
 (0)