2009-02-21 21:33:52 -05:00
|
|
|
|
PEP: 376
|
2010-03-29 05:03:10 -04:00
|
|
|
|
Title: Database of Installed Python Distributions
|
2009-02-21 21:33:52 -05:00
|
|
|
|
Author: Tarek Ziadé <tarek@ziade.org>
|
2018-02-20 19:36:21 -05:00
|
|
|
|
Status: Final
|
2009-02-21 21:33:52 -05:00
|
|
|
|
Type: Standards Track
|
2022-06-14 17:22:20 -04:00
|
|
|
|
Topic: Packaging
|
2009-02-21 21:33:52 -05:00
|
|
|
|
Content-Type: text/x-rst
|
|
|
|
|
Created: 22-Feb-2009
|
2009-05-14 18:03:08 -04:00
|
|
|
|
Python-Version: 2.7, 3.2
|
2023-08-30 23:39:48 -04:00
|
|
|
|
Post-History: `22-Jun-2009 <https://mail.python.org/archives/list/python-dev@python.org/thread/ILLTIOZAULMDY5CAS6GOITEYJ4HNFATQ/>`__
|
2022-10-07 11:29:13 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. canonical-pypa-spec:: :ref:`packaging:core-metadata`
|
|
|
|
|
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
|
|
|
|
Abstract
|
|
|
|
|
========
|
|
|
|
|
|
2010-03-29 05:03:10 -04:00
|
|
|
|
The goal of this PEP is to provide a standard infrastructure to manage
|
|
|
|
|
project distributions installed on a system, so all tools that are
|
|
|
|
|
installing or removing projects are interoperable.
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2010-03-29 05:03:10 -04:00
|
|
|
|
To achieve this goal, the PEP proposes a new format to describe installed
|
|
|
|
|
distributions on a system. It also describes a reference implementation
|
|
|
|
|
for the standard library.
|
2010-03-25 06:36:15 -04:00
|
|
|
|
|
2022-10-07 11:29:13 -04:00
|
|
|
|
In the past an attempt was made to create an installation database
|
|
|
|
|
(see :pep:`262`).
|
2010-03-25 06:36:15 -04:00
|
|
|
|
|
2022-01-21 06:03:51 -05:00
|
|
|
|
Combined with :pep:`345`, the current proposal supersedes :pep:`262`.
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2020-02-24 08:23:09 -05:00
|
|
|
|
Note: the implementation plan didn't go as expected, so it should be
|
|
|
|
|
considered informative only for this PEP.
|
|
|
|
|
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2009-04-24 12:03:02 -04:00
|
|
|
|
Rationale
|
|
|
|
|
=========
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2009-06-23 04:50:10 -04:00
|
|
|
|
There are two problems right now in the way distributions are installed in
|
2009-06-22 09:06:55 -04:00
|
|
|
|
Python:
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2010-03-25 06:36:15 -04:00
|
|
|
|
- There are too many ways to do it and this makes interoperation difficult.
|
2010-03-29 05:03:10 -04:00
|
|
|
|
- There is no API to get information on installed distributions.
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2009-06-22 09:06:55 -04:00
|
|
|
|
How distributions are installed
|
|
|
|
|
-------------------------------
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2010-03-30 17:53:35 -04:00
|
|
|
|
Right now, when a distribution is installed in Python, every element can
|
|
|
|
|
be installed in a different directory.
|
2009-05-16 12:02:06 -04:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
For instance, ``Distutils`` installs the pure Python code in the ``purelib``
|
2018-01-17 22:44:30 -05:00
|
|
|
|
directory, which is ``lib/python2.6/site-packages`` for unix-like systems and
|
2020-02-04 13:02:40 -05:00
|
|
|
|
Mac OS X, or ``Lib\site-packages`` under Python's installation directory for
|
2010-03-25 06:36:15 -04:00
|
|
|
|
Windows.
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
Additionally, the ``install_egg_info`` subcommand of the Distutils ``install``
|
|
|
|
|
command adds an ``.egg-info`` file for the project into the ``purelib``
|
2010-03-25 06:36:15 -04:00
|
|
|
|
directory.
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
For example, for the ``docutils`` distribution, which contains one package an
|
2009-07-02 06:13:23 -04:00
|
|
|
|
extra module and executable scripts, three elements are installed in
|
2020-02-04 13:02:40 -05:00
|
|
|
|
``site-packages``:
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
- ``docutils``: The ``docutils`` package.
|
|
|
|
|
- ``roman.py``: An extra module used by ``docutils``.
|
|
|
|
|
- ``docutils-0.5-py2.6.egg-info``: A file containing the distribution metadata
|
2022-01-21 06:03:51 -05:00
|
|
|
|
as described in :pep:`314`. This file corresponds to the file
|
2020-02-04 13:02:40 -05:00
|
|
|
|
called ``PKG-INFO``, built by the ``sdist`` command.
|
2009-04-24 12:03:02 -04:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
Some executable scripts, such as ``rst2html.py``, are also added in the
|
|
|
|
|
``bin`` directory of the Python installation.
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
Another project called ``setuptools`` [#setuptools]_ has two other formats
|
|
|
|
|
to install distributions, called ``EggFormats`` [#eggformats]_:
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
- a self-contained ``.egg`` directory, that contains all the distribution files
|
|
|
|
|
and the distribution metadata in a file called ``PKG-INFO`` in a subdirectory
|
|
|
|
|
called ``EGG-INFO``. ``setuptools`` creates other files in that directory that can
|
2009-07-02 05:46:04 -04:00
|
|
|
|
be considered as complementary metadata.
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
- an ``.egg-info`` directory installed in ``site-packages``, that contains the same
|
|
|
|
|
files ``EGG-INFO`` has in the ``.egg`` format.
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2009-07-02 04:45:29 -04:00
|
|
|
|
The first format is automatically used when you install a distribution that
|
2009-07-02 05:46:04 -04:00
|
|
|
|
uses the ``setuptools.setup`` function in its setup.py file, instead of
|
|
|
|
|
the ``distutils.core.setup`` one.
|
2009-07-02 04:45:29 -04:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
``setuptools`` also add a reference to the distribution into an
|
2010-03-29 05:03:10 -04:00
|
|
|
|
``easy-install.pth`` file.
|
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
Last, the ``setuptools`` project provides an executable script called
|
|
|
|
|
``easy_install`` [#easyinstall]_ that installs all distributions, including
|
|
|
|
|
distutils-based ones in self-contained ``.egg`` directories.
|
2009-07-02 04:45:29 -04:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
If you want to have standalone ``.egg-info`` directories for your distributions,
|
|
|
|
|
e.g. the second ``setuptools`` format, you have to force it when you work
|
|
|
|
|
with a setuptools-based distribution or with the ``easy_install`` script.
|
|
|
|
|
You can force it by using the ``--single-version-externally-managed`` option
|
|
|
|
|
**or** the ``--root`` option. This will make the ``setuptools`` project install
|
2010-03-29 05:03:10 -04:00
|
|
|
|
the project like distutils does.
|
2009-07-02 04:45:29 -04:00
|
|
|
|
|
|
|
|
|
This option is used by :
|
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
- the ``pip`` [#pip]_ installer
|
2009-07-02 04:45:29 -04:00
|
|
|
|
- the Fedora packagers [#fedora]_.
|
|
|
|
|
- the Debian packagers [#debian]_.
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2009-04-24 12:03:02 -04:00
|
|
|
|
Uninstall information
|
2009-02-21 21:33:52 -05:00
|
|
|
|
---------------------
|
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
Distutils doesn't provide an ``uninstall`` command. If you want to uninstall
|
2009-06-23 04:50:10 -04:00
|
|
|
|
a distribution, you have to be a power user and remove the various elements
|
2020-02-04 13:02:40 -05:00
|
|
|
|
that were installed, and then look over the ``.pth`` file to clean them if
|
2009-06-25 05:43:46 -04:00
|
|
|
|
necessary.
|
2009-05-16 12:02:06 -04:00
|
|
|
|
|
2009-06-25 05:43:46 -04:00
|
|
|
|
And the process differs depending on the tools you have used to install the
|
2020-02-04 13:02:40 -05:00
|
|
|
|
distribution and if the distribution's ``setup.py`` uses Distutils or
|
2009-06-22 09:06:55 -04:00
|
|
|
|
Setuptools.
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2009-05-25 06:22:46 -04:00
|
|
|
|
Under some circumstances, you might not be able to know for sure that you
|
2009-06-22 09:06:55 -04:00
|
|
|
|
have removed everything, or that you didn't break another distribution by
|
2009-06-23 08:14:02 -04:00
|
|
|
|
removing a file that is shared among several distributions.
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2009-06-25 05:43:46 -04:00
|
|
|
|
But there's a common behavior: when you install a distribution, files are
|
|
|
|
|
copied in your system. And it's possible to keep track of these files for
|
|
|
|
|
later removal.
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
Moreover, the Pip project has gained an ``uninstall`` feature lately. It
|
|
|
|
|
records all installed files, using the ``record`` option of the ``install``
|
2010-03-29 05:03:10 -04:00
|
|
|
|
command.
|
|
|
|
|
|
2009-02-21 21:33:52 -05:00
|
|
|
|
What this PEP proposes
|
|
|
|
|
----------------------
|
|
|
|
|
|
|
|
|
|
To address those issues, this PEP proposes a few changes:
|
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
- A new ``.dist-info`` structure using a directory, inspired on one format of
|
|
|
|
|
the ``EggFormats`` standard from ``setuptools``.
|
|
|
|
|
- New APIs in ``pkgutil`` to be able to query the information of installed
|
2009-06-22 09:06:55 -04:00
|
|
|
|
distributions.
|
2009-07-01 05:04:12 -04:00
|
|
|
|
- An uninstall function and an uninstall script in Distutils.
|
2009-05-25 06:22:46 -04:00
|
|
|
|
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2010-03-29 05:03:10 -04:00
|
|
|
|
One .dist-info directory per installed distribution
|
|
|
|
|
===================================================
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2010-04-01 17:33:33 -04:00
|
|
|
|
This PEP proposes an installation format inspired by one of the options in the
|
2020-02-04 13:02:40 -05:00
|
|
|
|
``EggFormats`` standard, the one that uses a distinct directory located in the
|
2010-04-01 17:33:33 -04:00
|
|
|
|
site-packages directory.
|
2009-06-08 05:54:02 -04:00
|
|
|
|
|
2010-04-01 17:33:33 -04:00
|
|
|
|
This distinct directory is named as follows::
|
2009-07-01 09:15:40 -04:00
|
|
|
|
|
2010-04-01 17:33:33 -04:00
|
|
|
|
name + '-' + version + '.dist-info'
|
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
This ``.dist-info`` directory can contain these files:
|
2009-06-08 05:54:02 -04:00
|
|
|
|
|
2022-01-21 06:03:51 -05:00
|
|
|
|
- ``METADATA``: contains metadata, as described in :pep:`345`, :pep:`314` and :pep:`241`.
|
2020-02-04 13:02:40 -05:00
|
|
|
|
- ``RECORD``: records the list of installed files
|
|
|
|
|
- ``INSTALLER``: records the name of the tool used to install the project
|
|
|
|
|
- ``REQUESTED``: the presence of this file indicates that the project
|
2018-03-19 22:04:45 -04:00
|
|
|
|
installation was explicitly requested (i.e., not installed as a dependency).
|
2009-05-25 06:22:46 -04:00
|
|
|
|
|
2010-04-01 17:33:33 -04:00
|
|
|
|
The METADATA, RECORD and INSTALLER files are mandatory, while REQUESTED may
|
|
|
|
|
be missing.
|
|
|
|
|
|
|
|
|
|
This proposal will not impact Python itself because the metadata files are not
|
2009-05-25 06:22:46 -04:00
|
|
|
|
used anywhere yet in the standard library besides Distutils.
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
It will impact the ``setuptools`` and ``pip`` projects but, given the fact that
|
|
|
|
|
they already work with a directory that contains a ``PKG-INFO`` file, the change
|
2009-10-14 14:39:17 -04:00
|
|
|
|
will have no deep consequences.
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
|
|
|
|
|
2010-03-29 05:03:10 -04:00
|
|
|
|
RECORD
|
|
|
|
|
------
|
2009-02-28 09:22:01 -05:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
A ``RECORD`` file is added inside the ``.dist-info`` directory at installation
|
|
|
|
|
time when installing a source distribution using the ``install`` command.
|
|
|
|
|
Notice that when installing a binary distribution created with ``bdist`` command
|
|
|
|
|
or a ``bdist``-based command, the ``RECORD`` file will be installed as well since
|
|
|
|
|
these commands use the ``install`` command to create binary distributions.
|
2009-07-03 09:21:10 -04:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
The ``RECORD`` file holds the list of installed files. These correspond
|
|
|
|
|
to the files listed by the ``record`` option of the ``install`` command, and will
|
2009-07-02 06:13:23 -04:00
|
|
|
|
be generated by default. This allows the implementation of an uninstallation
|
2020-02-04 13:02:40 -05:00
|
|
|
|
feature, as explained later in this PEP. The ``install`` command also provides
|
|
|
|
|
an option to prevent the ``RECORD`` file from being written and this option
|
2009-07-02 06:13:23 -04:00
|
|
|
|
should be used when creating system packages.
|
2009-06-05 04:35:30 -04:00
|
|
|
|
|
|
|
|
|
Third-party installation tools also should not overwrite or delete files
|
|
|
|
|
that are not in a RECORD file without prompting or warning.
|
|
|
|
|
|
2022-01-21 06:03:51 -05:00
|
|
|
|
This RECORD file is inspired from :pep:`262` FILES.
|
2009-05-16 12:02:06 -04:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
The ``RECORD`` file is a CSV file, composed of records, one line per
|
2009-06-08 05:54:02 -04:00
|
|
|
|
installed file. The ``csv`` module is used to read the file, with
|
2009-07-01 09:37:33 -04:00
|
|
|
|
these options:
|
2009-06-08 05:54:02 -04:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
- field delimiter : ``,``
|
|
|
|
|
- quoting char : ``"``.
|
2009-06-30 18:10:55 -04:00
|
|
|
|
- line terminator : ``os.linesep`` (so ``\r\n`` or ``\n``)
|
2009-06-08 05:54:02 -04:00
|
|
|
|
|
2010-04-21 14:22:03 -04:00
|
|
|
|
When a distribution is installed, files can be installed under:
|
|
|
|
|
|
|
|
|
|
- the **base location**: path defined by the ``--install-lib`` option,
|
|
|
|
|
which defaults to the site-packages directory.
|
|
|
|
|
|
|
|
|
|
- the **installation prefix**: path defined by the ``--prefix`` option, which
|
|
|
|
|
defaults to ``sys.prefix``.
|
|
|
|
|
|
|
|
|
|
- any other path on the system.
|
|
|
|
|
|
|
|
|
|
|
2010-03-29 05:03:10 -04:00
|
|
|
|
Each record is composed of three elements:
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2010-04-21 14:22:03 -04:00
|
|
|
|
- the file's **path**
|
2010-04-22 04:46:45 -04:00
|
|
|
|
|
2010-04-21 14:22:03 -04:00
|
|
|
|
- a '/'-separated path, relative to the **base location**, if the file is
|
|
|
|
|
under the **base location**.
|
2010-04-22 04:46:45 -04:00
|
|
|
|
|
2010-04-21 14:22:03 -04:00
|
|
|
|
- a '/'-separated path, relative to the **base location**, if the file
|
|
|
|
|
is under the **installation prefix** AND if the **base location** is a
|
|
|
|
|
subpath of the **installation prefix**.
|
2010-04-22 04:46:45 -04:00
|
|
|
|
|
2010-04-21 14:22:03 -04:00
|
|
|
|
- an absolute path, using the local platform separator
|
2009-04-24 12:03:02 -04:00
|
|
|
|
|
2012-09-15 08:10:49 -04:00
|
|
|
|
- a hash of the file's contents.
|
2020-02-04 13:02:40 -05:00
|
|
|
|
Notice that ``pyc`` and ``pyo`` generated files don't have any hash because
|
|
|
|
|
they are automatically produced from ``py`` files. So checking the hash
|
|
|
|
|
of the corresponding ``py`` file is enough to decide if the file and
|
|
|
|
|
its associated ``pyc`` or ``pyo`` files have changed.
|
2012-09-15 08:10:49 -04:00
|
|
|
|
|
2012-11-09 20:58:41 -05:00
|
|
|
|
The hash is either the empty string or the hash algorithm as named in
|
2012-09-15 08:10:49 -04:00
|
|
|
|
``hashlib.algorithms_guaranteed``, followed by the equals character
|
2012-11-09 20:58:41 -05:00
|
|
|
|
``=``, followed by the urlsafe-base64-nopad encoding of the digest
|
2012-09-15 08:10:49 -04:00
|
|
|
|
(``base64.urlsafe_b64encode(digest)`` with trailing ``=`` removed).
|
2009-04-24 12:03:02 -04:00
|
|
|
|
|
2009-05-16 12:02:06 -04:00
|
|
|
|
- the file's size in bytes
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2009-07-02 06:13:23 -04:00
|
|
|
|
The ``csv`` module is used to generate this file, so the field separator is
|
2010-04-01 17:33:33 -04:00
|
|
|
|
",". Any "," character found within a field is escaped automatically by
|
|
|
|
|
``csv``.
|
2009-05-25 06:22:46 -04:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
When the file is read, the ``U`` option is used so the universal newline
|
2022-01-21 06:03:51 -05:00
|
|
|
|
support (see :pep:`278`) is activated, avoiding any trouble
|
2009-06-23 04:50:10 -04:00
|
|
|
|
reading a file produced on a platform that uses a different new line
|
|
|
|
|
terminator.
|
|
|
|
|
|
2010-03-29 05:03:10 -04:00
|
|
|
|
Here's an example of a RECORD file (extract)::
|
2009-05-16 12:02:06 -04:00
|
|
|
|
|
2012-11-09 20:58:41 -05:00
|
|
|
|
lib/python2.6/site-packages/docutils/__init__.py,md5=nWt-Dge1eug4iAgqLS_uWg,9544
|
2010-04-23 05:20:20 -04:00
|
|
|
|
lib/python2.6/site-packages/docutils/__init__.pyc,,
|
2012-11-09 20:58:41 -05:00
|
|
|
|
lib/python2.6/site-packages/docutils/core.py,md5=X90C_JLIcC78PL74iuhPnA,66188
|
2010-04-23 05:20:20 -04:00
|
|
|
|
lib/python2.6/site-packages/docutils/core.pyc,,
|
2012-11-09 20:58:41 -05:00
|
|
|
|
lib/python2.6/site-packages/roman.py,md5=7YhfNczihNjOY0FXlupwBg,234
|
2010-04-23 05:20:20 -04:00
|
|
|
|
lib/python2.6/site-packages/roman.pyc,,
|
2012-11-09 20:58:41 -05:00
|
|
|
|
/usr/local/bin/rst2html.py,md5=g22D3amDLJP-FhBzCi7EvA,234
|
2010-04-23 05:20:20 -04:00
|
|
|
|
/usr/local/bin/rst2html.pyc,,
|
2012-11-09 20:58:41 -05:00
|
|
|
|
python2.6/site-packages/docutils-0.5.dist-info/METADATA,md5=ovJyUNzXdArGfmVyb0onyA,195
|
2010-04-23 05:20:20 -04:00
|
|
|
|
lib/python2.6/site-packages/docutils-0.5.dist-info/RECORD,,
|
2009-05-16 12:02:06 -04:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
Notice that the ``RECORD`` file can't contain a hash of itself and is just mentioned here
|
2009-05-16 12:02:06 -04:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
A project that installs a ``config.ini`` file in ``/etc/myapp`` will be added like this::
|
2010-03-25 05:43:50 -04:00
|
|
|
|
|
2012-11-09 20:58:41 -05:00
|
|
|
|
/etc/myapp/config.ini,md5=gLfd6IANquzGLhOkW4Mfgg,9544
|
2010-03-25 05:43:50 -04:00
|
|
|
|
|
|
|
|
|
For a windows platform, the drive letter is added for the absolute paths,
|
2010-03-25 06:36:15 -04:00
|
|
|
|
so a file that is copied in c:\MyApp\ will be::
|
2010-03-25 05:43:50 -04:00
|
|
|
|
|
2012-11-09 20:58:41 -05:00
|
|
|
|
c:\etc\myapp\config.ini,md5=gLfd6IANquzGLhOkW4Mfgg,9544
|
2010-03-25 05:43:50 -04:00
|
|
|
|
|
|
|
|
|
|
2010-03-29 05:03:10 -04:00
|
|
|
|
INSTALLER
|
|
|
|
|
---------
|
2009-06-05 04:35:30 -04:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
The ``install`` command has a new option called ``installer``. This option
|
2016-05-03 06:52:22 -04:00
|
|
|
|
is the name of the tool used to invoke the installation. It's a normalized
|
2020-02-04 13:02:40 -05:00
|
|
|
|
lower-case string matching ``[a-z0-9_\-\.]``.
|
2009-06-05 04:35:30 -04:00
|
|
|
|
|
|
|
|
|
$ python setup.py install --installer=pkg-system
|
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
It defaults to ``distutils`` if not provided.
|
2009-06-05 04:35:30 -04:00
|
|
|
|
|
2009-06-22 09:06:55 -04:00
|
|
|
|
When a distribution is installed, the INSTALLER file is generated in the
|
2020-02-04 13:02:40 -05:00
|
|
|
|
``.dist-info`` directory with this value, to keep track of **who** installed the
|
2009-06-22 09:06:55 -04:00
|
|
|
|
distribution. The file is a single-line text file.
|
2009-06-05 04:35:30 -04:00
|
|
|
|
|
2010-03-29 05:03:10 -04:00
|
|
|
|
|
|
|
|
|
REQUESTED
|
|
|
|
|
---------
|
2009-10-14 14:39:17 -04:00
|
|
|
|
|
|
|
|
|
Some install tools automatically detect unfulfilled dependencies and
|
|
|
|
|
install them. In these cases, it is useful to track which
|
|
|
|
|
distributions were installed purely as a dependency, so if their
|
|
|
|
|
dependent distribution is later uninstalled, the user can be alerted
|
2010-03-30 17:53:35 -04:00
|
|
|
|
of the orphaned dependency.
|
2009-10-14 14:39:17 -04:00
|
|
|
|
|
|
|
|
|
If a distribution is installed by direct user request (the usual
|
2010-03-29 05:03:10 -04:00
|
|
|
|
case), a file REQUESTED is added to the .dist-info directory of the
|
2009-10-14 14:39:17 -04:00
|
|
|
|
installed distribution. The REQUESTED file may be empty, or may
|
|
|
|
|
contain a marker comment line beginning with the "#" character.
|
|
|
|
|
|
|
|
|
|
If an install tool installs a distribution automatically, as a
|
|
|
|
|
dependency of another distribution, the REQUESTED file should not be
|
|
|
|
|
created.
|
|
|
|
|
|
|
|
|
|
The ``install`` command of distutils by default creates the REQUESTED
|
2010-03-30 17:53:35 -04:00
|
|
|
|
file. It accepts ``--requested`` and ``--no-requested`` options to explicitly
|
2009-10-14 14:39:17 -04:00
|
|
|
|
specify whether the file is created.
|
|
|
|
|
|
2010-04-07 09:29:07 -04:00
|
|
|
|
If a distribution that was already installed on the system as a dependency
|
2009-10-14 14:39:17 -04:00
|
|
|
|
is later installed by name, the distutils ``install`` command will
|
2010-03-29 05:03:10 -04:00
|
|
|
|
create the REQUESTED file in the .dist-info directory of the existing
|
2009-10-14 14:39:17 -04:00
|
|
|
|
installation.
|
|
|
|
|
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2010-03-29 05:03:10 -04:00
|
|
|
|
Implementation details
|
|
|
|
|
======================
|
|
|
|
|
|
2020-02-24 08:23:09 -05:00
|
|
|
|
Note: this section is non-normative. In the end, this PEP was
|
|
|
|
|
implemented by third-party libraries and tools, not the standard
|
|
|
|
|
library.
|
|
|
|
|
|
2010-03-29 05:03:10 -04:00
|
|
|
|
New functions and classes in pkgutil
|
|
|
|
|
------------------------------------
|
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
To use the ``.dist-info`` directory content, we need to add in the standard
|
|
|
|
|
library a set of APIs. The best place to put these APIs is ``pkgutil``.
|
2009-04-13 16:52:58 -04:00
|
|
|
|
|
2010-03-29 05:03:10 -04:00
|
|
|
|
Functions
|
|
|
|
|
~~~~~~~~~
|
|
|
|
|
|
|
|
|
|
The new functions added in the ``pkgutil`` module are :
|
|
|
|
|
|
|
|
|
|
- ``distinfo_dirname(name, version)`` -> directory name
|
2009-06-04 05:36:32 -04:00
|
|
|
|
|
2010-03-29 05:03:10 -04:00
|
|
|
|
``name`` is converted to a standard distribution name by replacing any
|
|
|
|
|
runs of non-alphanumeric characters with a single '-'.
|
|
|
|
|
|
|
|
|
|
``version`` is converted to a standard version string. Spaces become
|
|
|
|
|
dots, and all other non-alphanumeric characters (except dots) become
|
|
|
|
|
dashes, with runs of multiple dashes condensed to a single dash.
|
|
|
|
|
|
|
|
|
|
Both attributes are then converted into their filename-escaped form,
|
|
|
|
|
i.e. any '-' characters are replaced with '_' other than the one in
|
|
|
|
|
'dist-info' and the one separating the name from the version number.
|
2009-07-02 05:46:04 -04:00
|
|
|
|
|
|
|
|
|
- ``get_distributions()`` -> iterator of ``Distribution`` instances.
|
|
|
|
|
|
2010-03-29 05:03:10 -04:00
|
|
|
|
Provides an iterator that looks for ``.dist-info`` directories in
|
2009-07-02 05:46:04 -04:00
|
|
|
|
``sys.path`` and returns ``Distribution`` instances for
|
|
|
|
|
each one of them.
|
|
|
|
|
|
|
|
|
|
- ``get_distribution(name)`` -> ``Distribution`` or None.
|
|
|
|
|
|
2010-04-21 14:22:03 -04:00
|
|
|
|
- ``obsoletes_distribution(name, version=None)`` -> iterator of ``Distribution``
|
|
|
|
|
instances.
|
|
|
|
|
|
|
|
|
|
Iterates over all distributions to find which distributions *obsolete*
|
|
|
|
|
``name``. If a ``version`` is provided, it will be used to filter the results.
|
|
|
|
|
|
|
|
|
|
- ``provides_distribution(name, version=None)`` -> iterator of ``Distribution``
|
|
|
|
|
instances.
|
|
|
|
|
|
|
|
|
|
Iterates over all distributions to find which distributions *provide*
|
|
|
|
|
``name``. If a ``version`` is provided, it will be used to filter the results.
|
2009-07-02 05:46:04 -04:00
|
|
|
|
Scans all elements in ``sys.path`` and looks for all directories ending with
|
2010-03-29 05:03:10 -04:00
|
|
|
|
``.dist-info``. Returns a ``Distribution`` corresponding to the
|
2020-02-04 13:02:40 -05:00
|
|
|
|
``.dist-info`` directory that contains a METADATA that matches ``name``
|
|
|
|
|
for the ``name`` metadata.
|
2009-07-02 05:46:04 -04:00
|
|
|
|
|
2010-03-30 17:53:35 -04:00
|
|
|
|
This function only returns the first result founded, since no more than one
|
2010-03-25 06:36:15 -04:00
|
|
|
|
values are expected. If the directory is not found, returns None.
|
2009-07-02 05:46:04 -04:00
|
|
|
|
|
|
|
|
|
- ``get_file_users(path)`` -> iterator of ``Distribution`` instances.
|
|
|
|
|
|
|
|
|
|
Iterates over all distributions to find out which distributions uses ``path``.
|
|
|
|
|
``path`` can be a local absolute path or a relative '/'-separated path.
|
2009-06-04 05:36:32 -04:00
|
|
|
|
|
2010-04-07 09:29:07 -04:00
|
|
|
|
A local absolute path is an absolute path in which occurrences of '/'
|
|
|
|
|
have been replaced by the system separator given by ``os.sep``.
|
|
|
|
|
|
|
|
|
|
|
2009-06-12 06:00:17 -04:00
|
|
|
|
Distribution class
|
2010-03-29 05:03:10 -04:00
|
|
|
|
~~~~~~~~~~~~~~~~~~
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2009-07-02 07:45:00 -04:00
|
|
|
|
A new class called ``Distribution`` is created with the path of the
|
2020-02-04 13:02:40 -05:00
|
|
|
|
``.dist-info`` directory provided to the constructor. It reads the metadata
|
|
|
|
|
contained in ``METADATA`` when it is instantiated.
|
2009-06-04 05:36:32 -04:00
|
|
|
|
|
2009-06-23 08:14:02 -04:00
|
|
|
|
``Distribution(path)`` -> instance
|
|
|
|
|
|
|
|
|
|
Creates a ``Distribution`` instance for the given ``path``.
|
|
|
|
|
|
2009-06-12 06:00:17 -04:00
|
|
|
|
``Distribution`` provides the following attributes:
|
2009-05-19 08:43:34 -04:00
|
|
|
|
|
2009-06-12 06:00:17 -04:00
|
|
|
|
- ``name``: The name of the distribution.
|
2009-05-25 06:22:46 -04:00
|
|
|
|
|
2009-06-12 06:00:17 -04:00
|
|
|
|
- ``metadata``: A ``DistributionMetadata`` instance loaded with the
|
2010-03-29 05:03:10 -04:00
|
|
|
|
distribution's METADATA file.
|
2009-05-25 06:22:46 -04:00
|
|
|
|
|
2009-10-14 14:39:17 -04:00
|
|
|
|
- ``requested``: A boolean that indicates whether the REQUESTED
|
2010-04-07 09:29:07 -04:00
|
|
|
|
metadata file is present (in other words, whether the distribution was
|
2009-10-14 14:39:17 -04:00
|
|
|
|
installed by user request).
|
|
|
|
|
|
2009-06-04 05:36:32 -04:00
|
|
|
|
And following methods:
|
2009-05-25 06:22:46 -04:00
|
|
|
|
|
2012-09-15 08:10:49 -04:00
|
|
|
|
- ``get_installed_files(local=False)`` -> iterator of (path, hash, size)
|
2009-05-25 06:22:46 -04:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
Iterates over the ``RECORD`` entries and return a tuple ``(path, hash, size)``
|
2009-06-04 05:36:32 -04:00
|
|
|
|
for each line. If ``local`` is ``True``, the path is transformed into a
|
2020-02-04 13:02:40 -05:00
|
|
|
|
local absolute path. Otherwise the raw value from ``RECORD`` is returned.
|
2009-05-25 06:22:46 -04:00
|
|
|
|
|
2009-07-01 09:15:40 -04:00
|
|
|
|
A local absolute path is an absolute path in which occurrences of '/'
|
|
|
|
|
have been replaced by the system separator given by ``os.sep``.
|
|
|
|
|
|
2009-05-25 06:22:46 -04:00
|
|
|
|
- ``uses(path)`` -> Boolean
|
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
Returns ``True`` if ``path`` is listed in ``RECORD``. ``path``
|
2009-05-25 06:22:46 -04:00
|
|
|
|
can be a local absolute path or a relative '/'-separated path.
|
2009-05-19 08:43:34 -04:00
|
|
|
|
|
2010-03-29 05:03:10 -04:00
|
|
|
|
- ``get_distinfo_file(path, binary=False)`` -> file object
|
2009-06-08 05:54:02 -04:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
Returns a file located under the ``.dist-info`` directory.
|
2009-06-08 05:54:02 -04:00
|
|
|
|
|
|
|
|
|
Returns a ``file`` instance for the file pointed by ``path``.
|
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
``path`` has to be a '/'-separated path relative to the ``.dist-info``
|
2009-06-08 05:54:02 -04:00
|
|
|
|
directory or an absolute path.
|
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
If ``path`` is an absolute path and doesn't start with the ``.dist-info``
|
2009-06-08 05:54:02 -04:00
|
|
|
|
directory path, a ``DistutilsError`` is raised.
|
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
If ``binary`` is ``True``, opens the file in read-only binary mode (``rb``),
|
|
|
|
|
otherwise opens it in read-only mode (``r``).
|
2009-06-08 05:54:02 -04:00
|
|
|
|
|
2010-03-29 05:03:10 -04:00
|
|
|
|
- ``get_distinfo_files(local=False)`` -> iterator of paths
|
2009-06-08 05:54:02 -04:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
Iterates over the ``RECORD`` entries and returns paths for each line if the path
|
|
|
|
|
is pointing to a file located in the ``.dist-info`` directory or one of its
|
2010-03-25 06:36:15 -04:00
|
|
|
|
subdirectories.
|
2009-06-08 05:54:02 -04:00
|
|
|
|
|
|
|
|
|
If ``local`` is ``True``, each path is transformed into a
|
2020-02-04 13:02:40 -05:00
|
|
|
|
local absolute path. Otherwise the raw value from ``RECORD`` is returned.
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2009-06-23 08:14:02 -04:00
|
|
|
|
|
2010-03-25 05:43:50 -04:00
|
|
|
|
Notice that the API is organized in five classes that work with directories
|
2022-01-21 06:03:51 -05:00
|
|
|
|
and Zip files (so it works with files included in Zip files, see :pep:`273` for
|
|
|
|
|
more details). These classes are described in the documentation
|
2009-07-02 05:46:04 -04:00
|
|
|
|
of the prototype implementation for interested readers [#prototype]_.
|
2009-06-23 08:14:02 -04:00
|
|
|
|
|
2010-03-29 05:03:10 -04:00
|
|
|
|
Examples
|
|
|
|
|
~~~~~~~~
|
2009-05-25 06:22:46 -04:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
Let's use some of the new APIs with our ``docutils`` example::
|
2009-05-25 06:22:46 -04:00
|
|
|
|
|
2010-03-29 05:03:10 -04:00
|
|
|
|
>>> from pkgutil import get_distribution, get_file_users, distinfo_dirname
|
2009-06-23 08:14:02 -04:00
|
|
|
|
>>> dist = get_distribution('docutils')
|
2009-06-12 06:00:17 -04:00
|
|
|
|
>>> dist.name
|
2009-06-23 08:14:02 -04:00
|
|
|
|
'docutils'
|
2009-06-12 06:00:17 -04:00
|
|
|
|
>>> dist.metadata.version
|
2009-06-23 08:14:02 -04:00
|
|
|
|
'0.5'
|
2009-05-25 06:22:46 -04:00
|
|
|
|
|
2010-03-29 05:03:10 -04:00
|
|
|
|
>>> distinfo_dirname('docutils', '0.5')
|
|
|
|
|
'docutils-0.5.dist-info'
|
|
|
|
|
|
|
|
|
|
>>> distinfo_dirname('python-ldap', '2.5')
|
|
|
|
|
'python_ldap-2.5.dist-info'
|
|
|
|
|
|
|
|
|
|
>>> distinfo_dirname('python-ldap', '2.5 a---5')
|
|
|
|
|
'python_ldap-2.5.a_5.dist-info'
|
|
|
|
|
|
2009-06-12 06:00:17 -04:00
|
|
|
|
>>> for path, hash, size in dist.get_installed_files()::
|
2009-06-23 04:50:10 -04:00
|
|
|
|
... print '%s %s %d' % (path, hash, size)
|
2009-05-16 12:02:06 -04:00
|
|
|
|
...
|
2010-03-30 17:04:30 -04:00
|
|
|
|
python2.6/site-packages/docutils/__init__.py,b690274f621402dda63bf11ba5373bf2,9544
|
|
|
|
|
python2.6/site-packages/docutils/core.py,9c4b84aff68aa55f2e9bf70481b94333,66188
|
|
|
|
|
python2.6/site-packages/roman.py,a4b84aff68aa55f2e9bf70481b943D3,234
|
2010-03-29 05:03:10 -04:00
|
|
|
|
/usr/local/bin/rst2html.py,a4b84aff68aa55f2e9bf70481b943D3,234
|
2010-03-30 17:04:30 -04:00
|
|
|
|
python2.6/site-packages/docutils-0.5.dist-info/METADATA,6fe57de576d749536082d8e205b77748,195
|
|
|
|
|
python2.6/site-packages/docutils-0.5.dist-info/RECORD
|
2009-06-23 08:14:02 -04:00
|
|
|
|
|
|
|
|
|
>>> dist.uses('docutils/core.py')
|
|
|
|
|
True
|
|
|
|
|
|
|
|
|
|
>>> dist.uses('/usr/local/bin/rst2html.py')
|
2009-05-25 06:22:46 -04:00
|
|
|
|
True
|
2009-05-16 12:02:06 -04:00
|
|
|
|
|
2010-03-29 05:03:10 -04:00
|
|
|
|
>>> dist.get_distinfo_file('METADATA')
|
2009-05-25 06:22:46 -04:00
|
|
|
|
<open file at ...>
|
|
|
|
|
|
2009-10-14 14:39:17 -04:00
|
|
|
|
>>> dist.requested
|
|
|
|
|
True
|
|
|
|
|
|
2009-05-25 06:22:46 -04:00
|
|
|
|
|
2010-03-29 05:03:10 -04:00
|
|
|
|
New functions in Distutils
|
|
|
|
|
--------------------------
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2009-06-23 04:50:10 -04:00
|
|
|
|
Distutils already provides a very basic way to install a distribution, which
|
2020-02-04 13:02:40 -05:00
|
|
|
|
is running the ``install`` command over the ``setup.py`` script of the
|
2009-06-22 09:06:55 -04:00
|
|
|
|
distribution.
|
2009-03-28 15:08:48 -04:00
|
|
|
|
|
2022-01-21 06:03:51 -05:00
|
|
|
|
:pep:`Distutils2 <262>` will provide a very basic ``uninstall`` function, that
|
2010-04-26 17:36:54 -04:00
|
|
|
|
is added in ``distutils2.util`` and takes the name of the distribution to
|
|
|
|
|
uninstall as its argument. ``uninstall`` uses the APIs described earlier and
|
|
|
|
|
remove all unique files, as long as their hash didn't change. Then it removes
|
|
|
|
|
empty directories left behind.
|
2009-03-28 15:08:48 -04:00
|
|
|
|
|
2009-07-02 06:13:23 -04:00
|
|
|
|
``uninstall`` returns a list of uninstalled files::
|
2009-03-28 15:08:48 -04:00
|
|
|
|
|
2010-04-26 17:36:54 -04:00
|
|
|
|
>>> from distutils2.util import uninstall
|
2009-06-23 08:14:02 -04:00
|
|
|
|
>>> uninstall('docutils')
|
|
|
|
|
['/opt/local/lib/python2.6/site-packages/docutils/core.py',
|
|
|
|
|
...
|
|
|
|
|
'/opt/local/lib/python2.6/site-packages/docutils/__init__.py']
|
2009-05-07 05:02:23 -04:00
|
|
|
|
|
2010-04-01 17:33:33 -04:00
|
|
|
|
If the distribution is not found, a ``DistutilsUninstallError`` is raised.
|
2009-03-28 15:08:48 -04:00
|
|
|
|
|
2009-06-05 04:35:30 -04:00
|
|
|
|
Filtering
|
2010-03-29 05:03:10 -04:00
|
|
|
|
~~~~~~~~~
|
2009-06-05 04:35:30 -04:00
|
|
|
|
|
2009-05-25 06:22:46 -04:00
|
|
|
|
To make it a reference API for third-party projects that wish to control
|
2020-02-04 13:02:40 -05:00
|
|
|
|
how ``uninstall`` works, a second callable argument can be used. It's
|
|
|
|
|
called for each file that is removed. If the callable returns ``True``, the
|
2009-07-02 06:13:23 -04:00
|
|
|
|
file is removed. If it returns False, it's left alone.
|
2009-03-28 15:08:48 -04:00
|
|
|
|
|
2009-04-24 12:03:02 -04:00
|
|
|
|
Examples::
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2009-04-24 12:03:02 -04:00
|
|
|
|
>>> def _remove_and_log(path):
|
|
|
|
|
... logging.info('Removing %s' % path)
|
|
|
|
|
... return True
|
2009-05-16 12:02:06 -04:00
|
|
|
|
...
|
2009-06-23 08:14:02 -04:00
|
|
|
|
>>> uninstall('docutils', _remove_and_log)
|
2009-05-07 05:02:23 -04:00
|
|
|
|
|
2009-04-24 12:03:02 -04:00
|
|
|
|
>>> def _dry_run(path):
|
|
|
|
|
... logging.info('Removing %s (dry run)' % path)
|
|
|
|
|
... return False
|
2009-05-16 12:02:06 -04:00
|
|
|
|
...
|
2009-06-23 08:14:02 -04:00
|
|
|
|
>>> uninstall('docutils', _dry_run)
|
2009-03-28 15:08:48 -04:00
|
|
|
|
|
2010-04-01 17:33:33 -04:00
|
|
|
|
Of course, a third-party tool can use lower-level ``pkgutil`` APIs to
|
|
|
|
|
implement its own uninstall feature.
|
2009-05-16 12:02:06 -04:00
|
|
|
|
|
2009-06-05 04:35:30 -04:00
|
|
|
|
Installer marker
|
2010-03-29 05:03:10 -04:00
|
|
|
|
~~~~~~~~~~~~~~~~
|
2009-06-05 04:35:30 -04:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
As explained earlier in this PEP, the ``install`` command adds an ``INSTALLER``
|
|
|
|
|
file in the ``.dist-info`` directory with the name of the installer.
|
2009-06-05 04:35:30 -04:00
|
|
|
|
|
2010-04-01 17:33:33 -04:00
|
|
|
|
To avoid removing distributions that were installed by another packaging
|
|
|
|
|
system, the ``uninstall`` function takes an extra argument ``installer`` which
|
2010-04-26 17:36:54 -04:00
|
|
|
|
defaults to ``distutils2``.
|
2009-06-05 04:35:30 -04:00
|
|
|
|
|
2009-07-02 06:13:23 -04:00
|
|
|
|
When called, ``uninstall`` controls that the ``INSTALLER`` file matches
|
|
|
|
|
this argument. If not, it raises a ``DistutilsUninstallError``::
|
2009-06-05 04:35:30 -04:00
|
|
|
|
|
2009-06-23 08:14:02 -04:00
|
|
|
|
>>> uninstall('docutils')
|
2009-06-05 04:35:30 -04:00
|
|
|
|
Traceback (most recent call last):
|
|
|
|
|
...
|
2009-06-23 08:14:02 -04:00
|
|
|
|
DistutilsUninstallError: docutils was installed by 'cool-pkg-manager'
|
2009-06-05 04:35:30 -04:00
|
|
|
|
|
2009-06-23 08:14:02 -04:00
|
|
|
|
>>> uninstall('docutils', installer='cool-pkg-manager')
|
2009-06-05 04:35:30 -04:00
|
|
|
|
|
2009-06-12 06:00:17 -04:00
|
|
|
|
This allows a third-party application to use the ``uninstall`` function
|
2009-10-11 15:47:09 -04:00
|
|
|
|
and strongly suggest that no other program remove a distribution it has
|
2009-06-05 04:35:30 -04:00
|
|
|
|
previously installed. This is useful when a third-party program that relies
|
|
|
|
|
on Distutils APIs does extra steps on the system at installation time,
|
|
|
|
|
it has to undo at uninstallation time.
|
|
|
|
|
|
2009-07-01 05:04:12 -04:00
|
|
|
|
Adding an Uninstall script
|
2010-03-29 05:03:10 -04:00
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2009-07-01 05:04:12 -04:00
|
|
|
|
|
2020-02-04 13:02:40 -05:00
|
|
|
|
An ``uninstall`` script is added in Distutils2. and is used like this::
|
2009-07-01 05:04:12 -04:00
|
|
|
|
|
2010-04-26 17:36:54 -04:00
|
|
|
|
$ python -m distutils2.uninstall projectname
|
2009-07-01 05:04:12 -04:00
|
|
|
|
|
2009-07-02 06:13:23 -04:00
|
|
|
|
Notice that script doesn't control if the removal of a distribution breaks
|
|
|
|
|
another distribution. Although it makes sure that all the files it removes
|
2009-07-01 05:04:12 -04:00
|
|
|
|
are not used by any other distribution, by using the uninstall function.
|
|
|
|
|
|
2009-10-14 14:39:17 -04:00
|
|
|
|
Also note that this uninstall script pays no attention to the
|
|
|
|
|
REQUESTED metadata; that is provided only for use by external tools to
|
|
|
|
|
provide more advanced dependency management.
|
2009-07-01 05:04:12 -04:00
|
|
|
|
|
2009-05-14 05:32:29 -04:00
|
|
|
|
Backward compatibility and roadmap
|
|
|
|
|
==================================
|
|
|
|
|
|
2010-03-29 05:03:10 -04:00
|
|
|
|
These changes don't introduce any compatibility problems since they
|
|
|
|
|
will be implemented in:
|
|
|
|
|
|
|
|
|
|
- pkgutil in new functions
|
|
|
|
|
- distutils2
|
|
|
|
|
|
|
|
|
|
The plan is to include the functionality outlined in this PEP in pkgutil for
|
2010-04-26 17:36:54 -04:00
|
|
|
|
Python 3.2, and in Distutils2.
|
2009-05-14 05:32:29 -04:00
|
|
|
|
|
2010-03-29 05:03:10 -04:00
|
|
|
|
Distutils2 will also contain a backport of the new pgkutil, and can be used for
|
|
|
|
|
2.4 onward.
|
2009-05-14 18:19:41 -04:00
|
|
|
|
|
2009-10-14 14:39:17 -04:00
|
|
|
|
Distributions installed using existing, pre-standardization formats do not have
|
|
|
|
|
the necessary metadata available for the new API, and thus will be
|
|
|
|
|
ignored. Third-party tools may of course to continue to support previous
|
|
|
|
|
formats in addition to the new format, in order to ease the transition.
|
2009-03-28 15:08:48 -04:00
|
|
|
|
|
2009-06-23 08:14:02 -04:00
|
|
|
|
|
2009-05-16 12:02:06 -04:00
|
|
|
|
References
|
|
|
|
|
==========
|
|
|
|
|
|
2009-06-23 08:14:02 -04:00
|
|
|
|
.. [#distutils]
|
|
|
|
|
http://docs.python.org/distutils
|
|
|
|
|
|
2010-04-26 17:36:54 -04:00
|
|
|
|
.. [#distutils2]
|
|
|
|
|
http://hg.python.org/distutils2
|
|
|
|
|
|
2009-05-16 13:13:54 -04:00
|
|
|
|
.. [#setuptools]
|
|
|
|
|
http://peak.telecommunity.com/DevCenter/setuptools
|
|
|
|
|
|
2009-07-02 05:46:04 -04:00
|
|
|
|
.. [#easyinstall]
|
|
|
|
|
http://peak.telecommunity.com/DevCenter/EasyInstall
|
|
|
|
|
|
2009-05-16 13:13:54 -04:00
|
|
|
|
.. [#pip]
|
|
|
|
|
http://pypi.python.org/pypi/pip
|
2009-05-16 12:02:06 -04:00
|
|
|
|
|
2009-05-25 06:22:46 -04:00
|
|
|
|
.. [#eggformats]
|
|
|
|
|
http://peak.telecommunity.com/DevCenter/EggFormats
|
|
|
|
|
|
2009-07-02 04:45:29 -04:00
|
|
|
|
.. [#fedora]
|
|
|
|
|
http://fedoraproject.org/wiki/Packaging/Python/Eggs#Providing_Eggs_using_Setuptools
|
|
|
|
|
|
|
|
|
|
.. [#debian]
|
|
|
|
|
http://wiki.debian.org/DebianPython/NewPolicy
|
2009-06-23 04:50:10 -04:00
|
|
|
|
|
2009-07-02 05:46:04 -04:00
|
|
|
|
.. [#prototype]
|
2010-03-25 05:43:50 -04:00
|
|
|
|
http://bitbucket.org/tarek/pep376/
|
2009-07-02 05:46:04 -04:00
|
|
|
|
|
2009-10-14 14:39:17 -04:00
|
|
|
|
Acknowledgements
|
|
|
|
|
================
|
2009-02-21 21:33:52 -05:00
|
|
|
|
|
2010-03-25 06:36:15 -04:00
|
|
|
|
Jim Fulton, Ian Bicking, Phillip Eby, Rafael Villar Burke, and many people at
|
|
|
|
|
Pycon and Distutils-SIG.
|
2009-02-28 09:22:01 -05:00
|
|
|
|
|
2009-02-21 21:33:52 -05:00
|
|
|
|
Copyright
|
|
|
|
|
=========
|
|
|
|
|
|
|
|
|
|
This document has been placed in the public domain.
|
|
|
|
|
|
|
|
|
|
|
2009-02-28 09:22:01 -05:00
|
|
|
|
|
2009-02-21 21:33:52 -05:00
|
|
|
|
..
|
|
|
|
|
Local Variables:
|
|
|
|
|
mode: indented-text
|
|
|
|
|
indent-tabs-mode: nil
|
|
|
|
|
sentence-end-double-space: t
|
|
|
|
|
fill-column: 70
|
|
|
|
|
coding: utf-8
|
|
|
|
|
End:
|