2005-05-22 20:59:54 -04:00
|
|
|
|
PEP: 345
|
2005-05-23 09:08:09 -04:00
|
|
|
|
Title: Metadata for Python Software Packages 1.2
|
2005-05-22 20:59:54 -04:00
|
|
|
|
Version: $Revision$
|
|
|
|
|
Last-Modified: $Date$
|
2007-06-20 20:48:29 -04:00
|
|
|
|
Author: Richard Jones <richard@python.org>
|
2005-05-22 20:59:54 -04:00
|
|
|
|
Discussions-To: Distutils SIG
|
2010-03-21 18:24:43 -04:00
|
|
|
|
Status: Accepted
|
2005-05-22 20:59:54 -04:00
|
|
|
|
Type: Standards Track
|
2007-06-19 00:20:07 -04:00
|
|
|
|
Content-Type: text/x-rst
|
2005-05-22 20:59:54 -04:00
|
|
|
|
Created: 28-Apr-2005
|
|
|
|
|
Python-Version: 2.5
|
2009-11-24 04:14:32 -05:00
|
|
|
|
Post-History:
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Abstract
|
|
|
|
|
========
|
|
|
|
|
|
2010-01-06 11:55:00 -05:00
|
|
|
|
This PEP describes a mechanism for adding metadata to Python distributions.
|
2005-05-22 20:59:54 -04:00
|
|
|
|
It includes specifics of the field names, and their semantics and
|
|
|
|
|
usage.
|
|
|
|
|
|
|
|
|
|
This document specifies version 1.2 of the metadata format.
|
|
|
|
|
Version 1.0 is specified in PEP 241.
|
|
|
|
|
Version 1.1 is specified in PEP 314.
|
|
|
|
|
|
|
|
|
|
Version 1.2 of the metadata format adds a number of optional fields
|
|
|
|
|
designed to make third-party packaging of Python Software easier.
|
2009-10-20 03:59:46 -04:00
|
|
|
|
These fields are "Requires-Python", "Requires-External", "Requires-Dist",
|
2012-07-07 14:31:27 -04:00
|
|
|
|
"Provides-Dist", and "Obsoletes-Dist". This version also changes the
|
2009-12-25 07:27:22 -05:00
|
|
|
|
"Platform" field. Three new fields were also added: "Maintainer",
|
|
|
|
|
"Maintainer-email" and "Project-URL".
|
|
|
|
|
|
|
|
|
|
Last, this new version also adds `environment markers`.
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
|
|
|
|
Fields
|
|
|
|
|
======
|
|
|
|
|
|
|
|
|
|
This section specifies the names and semantics of each of the
|
|
|
|
|
supported metadata fields.
|
|
|
|
|
|
|
|
|
|
Fields marked with "(Multiple use)" may be specified multiple
|
|
|
|
|
times in a single PKG-INFO file. Other fields may only occur
|
|
|
|
|
once in a PKG-INFO file. Fields marked with "(optional)" are
|
|
|
|
|
not required to appear in a valid PKG-INFO file; all other
|
|
|
|
|
fields must be present.
|
|
|
|
|
|
|
|
|
|
Metadata-Version
|
2009-12-22 19:10:25 -05:00
|
|
|
|
::::::::::::::::
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
2009-12-25 07:27:22 -05:00
|
|
|
|
Version of the file format; "1.2" is the only legal value.
|
2009-12-22 19:10:25 -05:00
|
|
|
|
|
|
|
|
|
Example::
|
|
|
|
|
|
|
|
|
|
Metadata-Version: 1.2
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Name
|
2009-12-22 19:10:25 -05:00
|
|
|
|
::::
|
|
|
|
|
|
2010-01-07 07:13:35 -05:00
|
|
|
|
The name of the distributions.
|
2009-12-22 19:10:25 -05:00
|
|
|
|
|
|
|
|
|
Example::
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
Name: BeagleVote
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Version
|
2009-12-22 19:10:25 -05:00
|
|
|
|
:::::::
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
2010-01-07 07:13:35 -05:00
|
|
|
|
A string containing the distribution's version number. This
|
2016-08-28 17:08:40 -04:00
|
|
|
|
field must be in the format specified in PEP 440.
|
2009-12-22 19:10:25 -05:00
|
|
|
|
|
|
|
|
|
Example::
|
|
|
|
|
|
|
|
|
|
Version: 1.0a2
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Platform (multiple use)
|
2009-12-22 19:10:25 -05:00
|
|
|
|
:::::::::::::::::::::::
|
|
|
|
|
|
2009-12-25 07:27:22 -05:00
|
|
|
|
A Platform specification describing an operating system supported by
|
2010-01-07 07:13:35 -05:00
|
|
|
|
the distribution which is not listed in the "Operating System" Trove classifiers.
|
2009-12-25 07:27:22 -05:00
|
|
|
|
See "Classifier" below.
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
2009-12-25 07:27:22 -05:00
|
|
|
|
Examples::
|
2009-12-22 19:10:25 -05:00
|
|
|
|
|
2009-12-25 07:27:22 -05:00
|
|
|
|
Platform: ObscureUnix
|
|
|
|
|
Platform: RareDOS
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Supported-Platform (multiple use)
|
2009-12-22 19:10:25 -05:00
|
|
|
|
:::::::::::::::::::::::::::::::::
|
|
|
|
|
|
|
|
|
|
Binary distributions containing a PKG-INFO file will use the
|
|
|
|
|
Supported-Platform field in their metadata to specify the OS and
|
2010-01-07 07:13:35 -05:00
|
|
|
|
CPU for which the binary distribution was compiled. The semantics of
|
2009-12-22 19:10:25 -05:00
|
|
|
|
the Supported-Platform field are not specified in this PEP.
|
|
|
|
|
|
|
|
|
|
Example::
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
Supported-Platform: RedHat 7.2
|
|
|
|
|
Supported-Platform: i386-win32-2791
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Summary
|
2009-12-22 19:10:25 -05:00
|
|
|
|
:::::::
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
2010-01-07 07:13:35 -05:00
|
|
|
|
A one-line summary of what the distribution does.
|
2009-12-22 19:10:25 -05:00
|
|
|
|
|
|
|
|
|
Example::
|
|
|
|
|
|
|
|
|
|
Summary: A module for collecting votes from beagles.
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description (optional)
|
2009-12-22 19:10:25 -05:00
|
|
|
|
::::::::::::::::::::::
|
|
|
|
|
|
2010-01-07 07:13:35 -05:00
|
|
|
|
A longer description of the distribution that can run to several
|
2009-12-22 19:10:25 -05:00
|
|
|
|
paragraphs. Software that deals with metadata should not assume
|
|
|
|
|
any maximum size for this field, though people shouldn't include
|
|
|
|
|
their instruction manual as the description.
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
The contents of this field can be written using reStructuredText
|
|
|
|
|
markup [1]_. For programs that work with the metadata, supporting
|
|
|
|
|
markup is optional; programs can also display the contents of the
|
|
|
|
|
field as-is. This means that authors should be conservative in
|
|
|
|
|
the markup they use.
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
2009-12-25 08:29:11 -05:00
|
|
|
|
To support empty lines and lines with indentation with respect to
|
2009-12-29 17:16:50 -05:00
|
|
|
|
the RFC 822 format, any CRLF character has to be suffixed by 7 spaces
|
2009-12-27 19:13:16 -05:00
|
|
|
|
followed by a pipe ("|") char. As a result, the Description field is
|
2009-12-25 08:29:11 -05:00
|
|
|
|
encoded into a folded field that can be interpreted by RFC822
|
|
|
|
|
parser [2]_.
|
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
Example::
|
|
|
|
|
|
2009-12-25 08:29:11 -05:00
|
|
|
|
Description: This project provides powerful math functions
|
|
|
|
|
|For example, you can use `sum()` to sum numbers:
|
|
|
|
|
|
|
|
|
|
|
|Example::
|
|
|
|
|
|
|
|
|
|
|
| >>> sum(1, 2)
|
|
|
|
|
| 3
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-11 11:14:08 -04:00
|
|
|
|
This encoding implies that any occurrences of a CRLF followed by 7 spaces
|
2009-12-29 17:16:50 -05:00
|
|
|
|
and a pipe char have to be replaced by a single CRLF when the field is unfolded
|
|
|
|
|
using a RFC822 reader.
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Keywords (optional)
|
2009-12-22 19:10:25 -05:00
|
|
|
|
:::::::::::::::::::
|
|
|
|
|
|
|
|
|
|
A list of additional keywords to be used to assist searching
|
2010-01-07 07:13:35 -05:00
|
|
|
|
for the distribution in a larger catalog.
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
Example::
|
|
|
|
|
|
|
|
|
|
Keywords: dog puppy voting election
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Home-page (optional)
|
2009-12-22 19:10:25 -05:00
|
|
|
|
::::::::::::::::::::
|
|
|
|
|
|
2010-01-07 07:13:35 -05:00
|
|
|
|
A string containing the URL for the distribution's home page.
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
Example::
|
|
|
|
|
|
|
|
|
|
Home-page: http://www.example.com/~cschultz/bvote/
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Download-URL
|
2009-12-22 19:10:25 -05:00
|
|
|
|
::::::::::::
|
|
|
|
|
|
2010-01-07 07:13:35 -05:00
|
|
|
|
A string containing the URL from which this version of the distribution
|
2009-12-22 19:10:25 -05:00
|
|
|
|
can be downloaded. (This means that the URL can't be something like
|
2010-01-07 07:13:35 -05:00
|
|
|
|
".../BeagleVote-latest.tgz", but instead must be ".../BeagleVote-0.45.tgz".)
|
2009-12-22 19:10:25 -05:00
|
|
|
|
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
|
|
|
|
Author (optional)
|
2009-12-22 19:10:25 -05:00
|
|
|
|
:::::::::::::::::
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
A string containing the author's name at a minimum; additional
|
|
|
|
|
contact information may be provided.
|
|
|
|
|
|
|
|
|
|
Example::
|
|
|
|
|
|
|
|
|
|
Author: C. Schultz, Universal Features Syndicate,
|
|
|
|
|
Los Angeles, CA <cschultz@peanuts.example.com>
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
|
|
|
|
|
2010-02-09 16:27:47 -05:00
|
|
|
|
Author-email (optional)
|
|
|
|
|
:::::::::::::::::::::::
|
2009-12-22 19:10:25 -05:00
|
|
|
|
|
|
|
|
|
A string containing the author's e-mail address. It can contain
|
|
|
|
|
a name and e-mail address in the legal forms for a RFC-822
|
2010-02-09 17:42:53 -05:00
|
|
|
|
``From:`` header.
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
Example::
|
|
|
|
|
|
|
|
|
|
Author-email: "C. Schultz" <cschultz@example.com>
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
|
|
|
|
|
2009-10-20 03:59:46 -04:00
|
|
|
|
Maintainer (optional)
|
2009-12-22 19:10:25 -05:00
|
|
|
|
:::::::::::::::::::::
|
|
|
|
|
|
|
|
|
|
A string containing the maintainer's name at a minimum; additional
|
|
|
|
|
contact information may be provided.
|
|
|
|
|
|
2010-01-07 07:13:35 -05:00
|
|
|
|
Note that this field is intended for use when a project is being
|
2009-12-22 19:10:25 -05:00
|
|
|
|
maintained by someone other than the original author: it should be
|
|
|
|
|
omitted if it is identical to ``Author``.
|
2009-11-24 04:14:32 -05:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
Example::
|
2009-10-20 03:59:46 -04:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
Maintainer: C. Schultz, Universal Features Syndicate,
|
|
|
|
|
Los Angeles, CA <cschultz@peanuts.example.com>
|
2009-10-20 03:59:46 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Maintainer-email (optional)
|
2009-12-22 19:10:25 -05:00
|
|
|
|
:::::::::::::::::::::::::::
|
2009-10-20 03:59:46 -04:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
A string containing the maintainer's e-mail address. It can contain
|
|
|
|
|
a name and e-mail address in the legal forms for a RFC-822
|
|
|
|
|
``From:`` header.
|
2009-10-20 03:59:46 -04:00
|
|
|
|
|
2010-01-07 07:13:35 -05:00
|
|
|
|
Note that this field is intended for use when a project is being
|
2009-12-22 19:10:25 -05:00
|
|
|
|
maintained by someone other than the original author: it should be
|
|
|
|
|
omitted if it is identical to ``Author-email``.
|
|
|
|
|
|
|
|
|
|
Example::
|
|
|
|
|
|
|
|
|
|
Maintainer-email: "C. Schultz" <cschultz@example.com>
|
2009-10-20 03:59:46 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
License (optional)
|
2009-12-22 19:10:25 -05:00
|
|
|
|
::::::::::::::::::
|
|
|
|
|
|
2010-01-07 07:13:35 -05:00
|
|
|
|
Text indicating the license covering the distribution where the license
|
2009-12-22 19:10:25 -05:00
|
|
|
|
is not a selection from the "License" Trove classifiers. See
|
|
|
|
|
"Classifier" below. This field may also be used to specify a
|
|
|
|
|
particular version of a licencse which is named via the ``Classifier``
|
|
|
|
|
field, or to indicate a variation or exception to such a license.
|
|
|
|
|
|
|
|
|
|
Examples::
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
License: This software may only be obtained by sending the
|
|
|
|
|
author a postcard, and then the user promises not
|
|
|
|
|
to redistribute it.
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
License: GPL version 3, excluding DRM provisions
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
2009-10-20 03:59:46 -04:00
|
|
|
|
|
2005-05-22 20:59:54 -04:00
|
|
|
|
Classifier (multiple use)
|
2009-12-22 19:10:25 -05:00
|
|
|
|
:::::::::::::::::::::::::
|
|
|
|
|
|
|
|
|
|
Each entry is a string giving a single classification value
|
2015-02-14 12:49:04 -05:00
|
|
|
|
for the distribution. Classifiers are described in PEP 301 [3]_.
|
2009-12-22 19:10:25 -05:00
|
|
|
|
|
|
|
|
|
Examples::
|
|
|
|
|
|
|
|
|
|
Classifier: Development Status :: 4 - Beta
|
|
|
|
|
Classifier: Environment :: Console (Text Based)
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
|
|
|
|
|
2009-10-20 03:59:46 -04:00
|
|
|
|
Requires-Dist (multiple use)
|
2009-12-22 19:10:25 -05:00
|
|
|
|
::::::::::::::::::::::::::::
|
|
|
|
|
|
|
|
|
|
Each entry contains a string naming some other distutils
|
2010-01-07 07:13:35 -05:00
|
|
|
|
project required by this distribution.
|
2009-10-20 03:59:46 -04:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
The format of a requirement string is identical to that of a
|
|
|
|
|
distutils project name (e.g., as found in the ``Name:`` field.
|
|
|
|
|
optionally followed by a version declaration within parentheses.
|
2009-10-20 03:59:46 -04:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
The distutils project names should correspond to names as found
|
|
|
|
|
on the `Python Package Index`_.
|
2009-10-20 03:59:46 -04:00
|
|
|
|
|
2009-12-27 18:50:39 -05:00
|
|
|
|
Version declarations must follow the rules described in
|
|
|
|
|
`Version Specifiers`_
|
2009-10-20 03:59:46 -04:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
Examples::
|
|
|
|
|
|
|
|
|
|
Requires-Dist: pkginfo
|
|
|
|
|
Requires-Dist: PasteDeploy
|
|
|
|
|
Requires-Dist: zope.interface (>3.5.0)
|
2009-10-20 03:59:46 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Provides-Dist (multiple use)
|
2009-12-22 19:10:25 -05:00
|
|
|
|
::::::::::::::::::::::::::::
|
|
|
|
|
|
2009-12-30 04:02:01 -05:00
|
|
|
|
Each entry contains a string naming a Distutils project which
|
2009-12-22 19:10:25 -05:00
|
|
|
|
is contained within this distribution. This field *must* include
|
2010-05-31 09:45:53 -04:00
|
|
|
|
the project identified in the ``Name`` field, followed by the
|
|
|
|
|
version : Name (Version).
|
2009-12-22 19:10:25 -05:00
|
|
|
|
|
|
|
|
|
A distribution may provide additional names, e.g. to indicate that
|
|
|
|
|
multiple projects have been bundled together. For instance, source
|
|
|
|
|
distributions of the ``ZODB`` project have historically included
|
|
|
|
|
the ``transaction`` project, which is now available as a separate
|
|
|
|
|
distribution. Installing such a source distribution satisfies
|
|
|
|
|
requirements for both ``ZODB`` and ``transaction``.
|
|
|
|
|
|
|
|
|
|
A distribution may also provide a "virtual" project name, which does
|
|
|
|
|
not correspond to any separately-distributed project: such a name
|
|
|
|
|
might be used to indicate an abstract capability which could be supplied
|
|
|
|
|
by one of multiple projects. E.g., multiple projects might supply
|
|
|
|
|
RDBMS bindings for use by a given ORM: each project might declare
|
|
|
|
|
that it provides ``ORM-bindings``, allowing other projects to depend
|
|
|
|
|
only on having at most one of them installed.
|
|
|
|
|
|
2009-12-27 18:50:39 -05:00
|
|
|
|
A version declaration may be supplied and must follow the rules described
|
|
|
|
|
in `Version Specifiers`_. The distribution's version number will be implied
|
|
|
|
|
if none is specified.
|
2009-12-22 19:10:25 -05:00
|
|
|
|
|
|
|
|
|
Examples::
|
|
|
|
|
|
2010-01-07 07:13:35 -05:00
|
|
|
|
Provides-Dist: OtherProject
|
|
|
|
|
Provides-Dist: AnotherProject (3.4)
|
2009-12-22 19:10:25 -05:00
|
|
|
|
Provides-Dist: virtual_package
|
|
|
|
|
|
2009-10-20 03:59:46 -04:00
|
|
|
|
|
|
|
|
|
Obsoletes-Dist (multiple use)
|
2009-12-22 19:10:25 -05:00
|
|
|
|
:::::::::::::::::::::::::::::
|
|
|
|
|
|
2010-01-07 07:13:35 -05:00
|
|
|
|
Each entry contains a string describing a distutils project's distribution
|
|
|
|
|
which this distribution renders obsolete, meaning that the two projects
|
2009-12-22 19:10:25 -05:00
|
|
|
|
should not be installed at the same time.
|
2009-11-24 04:14:32 -05:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
Version declarations can be supplied. Version numbers must be in the
|
2009-12-27 18:50:39 -05:00
|
|
|
|
format specified in `Version Specifiers`_.
|
2009-10-20 03:59:46 -04:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
The most common use of this field will be in case a project name
|
|
|
|
|
changes, e.g. Gorgon 2.3 gets subsumed into Torqued Python 1.0.
|
|
|
|
|
When you install Torqued Python, the Gorgon distribution should be
|
|
|
|
|
removed.
|
2009-10-20 03:59:46 -04:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
Examples::
|
|
|
|
|
|
|
|
|
|
Obsoletes-Dist: Gorgon
|
2010-01-07 07:13:35 -05:00
|
|
|
|
Obsoletes-Dist: OtherProject (<3.0)
|
2009-10-20 03:59:46 -04:00
|
|
|
|
|
|
|
|
|
|
2005-05-22 20:59:54 -04:00
|
|
|
|
Requires-Python
|
2009-12-22 19:10:25 -05:00
|
|
|
|
:::::::::::::::
|
|
|
|
|
|
2010-01-07 07:13:35 -05:00
|
|
|
|
This field specifies the Python version(s) that the distribution is
|
2009-12-27 18:50:39 -05:00
|
|
|
|
guaranteed to be compatible with.
|
2009-12-22 19:10:25 -05:00
|
|
|
|
|
2009-12-27 18:50:39 -05:00
|
|
|
|
Version numbers must be in the format specified in `Version Specifiers`_.
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
Examples::
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
2009-12-27 18:50:39 -05:00
|
|
|
|
Requires-Python: 2.5
|
2009-12-22 19:10:25 -05:00
|
|
|
|
Requires-Python: >2.1
|
|
|
|
|
Requires-Python: >=2.3.4
|
2009-12-27 20:07:29 -05:00
|
|
|
|
Requires-Python: >=2.5,<2.7
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Requires-External (multiple use)
|
2009-12-22 19:10:25 -05:00
|
|
|
|
::::::::::::::::::::::::::::::::
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
Each entry contains a string describing some dependency in the
|
2010-01-07 07:13:35 -05:00
|
|
|
|
system that the distribution is to be used. This field is intended to
|
|
|
|
|
serve as a hint to downstream project maintainers, and has no
|
|
|
|
|
semantics which are meaningful to the ``distutils`` distribution.
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
The format of a requirement string is a name of an external
|
|
|
|
|
dependency, optionally followed by a version declaration within
|
|
|
|
|
parentheses.
|
2009-11-17 17:58:35 -05:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
Because they refer to non-Python software releases, version numbers
|
|
|
|
|
for this field are **not** required to conform to the format
|
2016-08-28 17:08:40 -04:00
|
|
|
|
specified in PEP 440: they should correspond to the
|
2009-12-22 19:10:25 -05:00
|
|
|
|
version scheme used by the external dependency.
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
Notice that there's is no particular rule on the strings to be used.
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
Examples::
|
|
|
|
|
|
|
|
|
|
Requires-External: C
|
|
|
|
|
Requires-External: libpng (>=1.5)
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
Project-URL (multiple-use)
|
|
|
|
|
::::::::::::::::::::::::::
|
2009-11-24 04:14:32 -05:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
A string containing a browsable URL for the project and a label for it,
|
|
|
|
|
separated by a comma.
|
2009-11-24 04:14:32 -05:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
Example::
|
2009-11-24 04:14:32 -05:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
Bug Tracker, http://bitbucket.org/tarek/distribute/issues/
|
2009-11-24 04:14:32 -05:00
|
|
|
|
|
2009-12-22 19:10:25 -05:00
|
|
|
|
The label is a free text limited to 32 signs.
|
2009-11-24 04:14:32 -05:00
|
|
|
|
|
|
|
|
|
|
2009-10-20 03:59:46 -04:00
|
|
|
|
Version Specifiers
|
|
|
|
|
==================
|
|
|
|
|
|
2009-12-27 18:50:39 -05:00
|
|
|
|
Version specifiers are a series of conditional operators and
|
|
|
|
|
version numbers, separated by commas. Conditional operators
|
2010-02-13 15:16:20 -05:00
|
|
|
|
must be one of "<", ">", "<=", ">=", "==" and "!=".
|
2009-12-27 18:50:39 -05:00
|
|
|
|
|
|
|
|
|
Any number of conditional operators can be specified, e.g.
|
2009-12-27 19:13:16 -05:00
|
|
|
|
the string ">1.0, !=1.3.4, <2.0" is a legal version declaration.
|
2009-12-27 20:07:29 -05:00
|
|
|
|
The comma (",") is equivalent to the **and** operator.
|
2009-12-27 18:50:39 -05:00
|
|
|
|
|
2016-08-28 17:08:40 -04:00
|
|
|
|
Each version number must be in the format specified in PEP 440.
|
2009-12-27 18:50:39 -05:00
|
|
|
|
|
2009-12-30 04:02:01 -05:00
|
|
|
|
When a version is provided, it always includes all versions that
|
2016-07-11 11:14:08 -04:00
|
|
|
|
starts with the same value. For example, the "2.5" version of Python
|
2009-12-30 04:02:01 -05:00
|
|
|
|
will include versions like "2.5.2" or "2.5.3". Pre and post releases
|
|
|
|
|
in that case are excluded. So in our example, versions like "2.5a1" are
|
|
|
|
|
not included when "2.5" is used. If the first version of the range is
|
|
|
|
|
required, it has to be explicitly given. In our example, it will be
|
|
|
|
|
"2.5.0".
|
|
|
|
|
|
|
|
|
|
Notice that some projects might omit the ".0" prefix for the first release
|
|
|
|
|
of the "2.5.x" series:
|
|
|
|
|
|
|
|
|
|
- 2.5
|
|
|
|
|
- 2.5.1
|
|
|
|
|
- 2.5.2
|
|
|
|
|
- etc.
|
|
|
|
|
|
|
|
|
|
In that case, "2.5.0" will have to be explicitly used to avoid any confusion
|
|
|
|
|
between the "2.5" notation that represents the full range. It is a recommended
|
|
|
|
|
practice to use schemes of the same length for a series to completely avoid
|
|
|
|
|
this problem.
|
|
|
|
|
|
|
|
|
|
Some Examples:
|
|
|
|
|
|
|
|
|
|
- ``Requires-Dist: zope.interface (3.1)``: any version that starts with 3.1,
|
|
|
|
|
excluding post or pre-releases.
|
|
|
|
|
- ``Requires-Dist: zope.interface (3.1.0)``: any version that starts with
|
|
|
|
|
3.1.0, excluding post or pre-releases. Since that particular project doesn't
|
|
|
|
|
use more than 3 digits, it also means "only the 3.1.0 release".
|
2016-08-28 14:13:53 -04:00
|
|
|
|
- ``Requires-Python: 3``: Any Python 3 version, no matter which one, excluding
|
2009-12-30 04:02:01 -05:00
|
|
|
|
post or pre-releases.
|
|
|
|
|
- ``Requires-Python: >=2.6,<3``: Any version of Python 2.6 or 2.7, including
|
|
|
|
|
post releases of 2.6, pre and post releases of 2.7. It excludes pre releases
|
|
|
|
|
of Python 3.
|
|
|
|
|
- ``Requires-Python: 2.6.2``: Equivalent to ">=2.6.2,<2.6.3". So this includes
|
|
|
|
|
only Python 2.6.2. Of course, if Python was numbered with 4 digits, it would
|
|
|
|
|
have include all versions of the 2.6.2 series.
|
|
|
|
|
- ``Requires-Python: 2.5.0``: Equivalent to ">=2.5.0,<2.5.1".
|
|
|
|
|
- ``Requires-Dist: zope.interface (3.1,!=3.1.3)``: any version that starts with
|
|
|
|
|
3.1, excluding post or pre-releases of 3.1 *and* excluding any version that
|
|
|
|
|
starts with "3.1.3". For this particular project, this means: "any version
|
|
|
|
|
of the 3.1 series but not 3.1.3". This is equivalent to:
|
|
|
|
|
">=3.1,!=3.1.3,<3.2".
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
2009-11-14 18:55:17 -05:00
|
|
|
|
Environment markers
|
|
|
|
|
===================
|
|
|
|
|
|
|
|
|
|
An **environment marker** is a marker that can be added at the end of a
|
2009-12-27 19:13:16 -05:00
|
|
|
|
field after a semi-colon (";"), to add a condition about the execution
|
2009-11-14 18:55:17 -05:00
|
|
|
|
environment.
|
|
|
|
|
|
|
|
|
|
Here are some example of fields using such markers::
|
|
|
|
|
|
2009-12-30 04:02:01 -05:00
|
|
|
|
Requires-Dist: pywin32 (>1.0); sys.platform == 'win32'
|
2009-11-14 18:55:17 -05:00
|
|
|
|
Obsoletes-Dist: pywin31; sys.platform == 'win32'
|
2010-01-06 04:14:44 -05:00
|
|
|
|
Requires-Dist: foo (1,!=1.3); platform.machine == 'i386'
|
2009-11-14 18:55:17 -05:00
|
|
|
|
Requires-Dist: bar; python_version == '2.4' or python_version == '2.5'
|
|
|
|
|
Requires-External: libxslt; 'linux' in sys.platform
|
|
|
|
|
|
|
|
|
|
The micro-language behind this is the simplest possible: it compares only
|
|
|
|
|
strings, with the ``==`` and ``in`` operators (and their opposites), and
|
|
|
|
|
with the ability to combine expressions. It makes it also easy to understand
|
|
|
|
|
to non-pythoneers.
|
|
|
|
|
|
|
|
|
|
The pseudo-grammar is ::
|
|
|
|
|
|
|
|
|
|
EXPR [in|==|!=|not in] EXPR [or|and] ...
|
|
|
|
|
|
|
|
|
|
where ``EXPR`` belongs to any of those:
|
|
|
|
|
|
|
|
|
|
- python_version = '%s.%s' % (sys.version_info[0], sys.version_info[1])
|
2009-11-17 17:53:57 -05:00
|
|
|
|
- python_full_version = sys.version.split()[0]
|
2009-11-14 18:55:17 -05:00
|
|
|
|
- os.name = os.name
|
|
|
|
|
- sys.platform = sys.platform
|
|
|
|
|
- platform.version = platform.version()
|
|
|
|
|
- platform.machine = platform.machine()
|
2011-05-01 10:51:51 -04:00
|
|
|
|
- platform.python_implementation = platform.python_implementation()
|
2010-01-06 04:14:44 -05:00
|
|
|
|
- a free string, like ``'2.4'``, or ``'win32'``
|
2009-11-14 18:55:17 -05:00
|
|
|
|
|
|
|
|
|
Notice that ``in`` is restricted to strings, meaning that it is not possible
|
|
|
|
|
to use other sequences like tuples or lists on the right side.
|
|
|
|
|
|
|
|
|
|
The fields that benefit from this marker are:
|
|
|
|
|
|
|
|
|
|
- Requires-Python
|
|
|
|
|
- Requires-External
|
|
|
|
|
- Requires-Dist
|
|
|
|
|
- Provides-Dist
|
|
|
|
|
- Obsoletes-Dist
|
|
|
|
|
- Classifier
|
|
|
|
|
|
2009-10-20 03:59:46 -04:00
|
|
|
|
Summary of Differences From PEP 314
|
|
|
|
|
===================================
|
|
|
|
|
|
|
|
|
|
* Metadata-Version is now 1.2.
|
|
|
|
|
|
2009-11-14 18:55:17 -05:00
|
|
|
|
* Added the environment markers.
|
|
|
|
|
|
2009-12-25 07:29:16 -05:00
|
|
|
|
* Changed fields:
|
|
|
|
|
|
2010-02-09 16:41:26 -05:00
|
|
|
|
- Platform
|
|
|
|
|
- Author
|
2009-12-25 07:29:16 -05:00
|
|
|
|
|
2009-10-20 03:59:46 -04:00
|
|
|
|
* Added fields:
|
|
|
|
|
|
|
|
|
|
- Maintainer
|
|
|
|
|
- Maintainer-email
|
|
|
|
|
- Requires-Python
|
|
|
|
|
- Requires-External
|
|
|
|
|
- Requires-Dist
|
|
|
|
|
- Provides-Dist
|
|
|
|
|
- Obsoletes-Dist
|
2009-12-21 05:43:39 -05:00
|
|
|
|
- Project-URL
|
2009-10-20 03:59:46 -04:00
|
|
|
|
|
|
|
|
|
* Deprecated fields:
|
|
|
|
|
|
|
|
|
|
- Requires (in favor of Requires-Dist)
|
|
|
|
|
- Provides (in favor of Provides-Dist)
|
|
|
|
|
- Obsoletes (in favor of Obsoletes-Dist)
|
|
|
|
|
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
|
|
|
|
References
|
|
|
|
|
==========
|
|
|
|
|
|
|
|
|
|
This document specifies version 1.2 of the metadata format.
|
|
|
|
|
Version 1.0 is specified in PEP 241.
|
|
|
|
|
Version 1.1 is specified in PEP 314.
|
|
|
|
|
|
|
|
|
|
.. [1] reStructuredText markup:
|
|
|
|
|
http://docutils.sourceforge.net/
|
|
|
|
|
|
2009-10-20 03:59:46 -04:00
|
|
|
|
.. _`Python Package Index`: http://pypi.python.org/pypi/
|
|
|
|
|
|
2009-12-25 08:29:11 -05:00
|
|
|
|
.. [2] RFC 822 Long Header Fields:
|
|
|
|
|
http://www.freesoft.org/CIE/RFC/822/7.htm
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
2015-02-14 12:49:04 -05:00
|
|
|
|
.. [3] PEP 301, Package Index and Metadata for Distutils:
|
|
|
|
|
http://www.python.org/dev/peps/pep-0301/
|
|
|
|
|
|
2005-05-22 20:59:54 -04:00
|
|
|
|
Copyright
|
|
|
|
|
=========
|
|
|
|
|
|
|
|
|
|
This document has been placed in the public domain.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Acknowledgements
|
|
|
|
|
================
|
|
|
|
|
|
|
|
|
|
Fred Drake, Anthony Baxter and Matthias Klose have all contributed to
|
|
|
|
|
the ideas presented in this PEP.
|
|
|
|
|
|
2010-02-04 11:56:45 -05:00
|
|
|
|
Tres Seaver, Jim Fulton, Marc-André Lemburg, Martin von Löwis, Tarek Ziadé,
|
|
|
|
|
David Lyon and other people at the Distutils-SIG have contributed to the
|
|
|
|
|
new updated version.
|
2009-11-14 18:55:17 -05:00
|
|
|
|
|
2005-05-22 20:59:54 -04:00
|
|
|
|
|
|
|
|
|
..
|
|
|
|
|
Local Variables:
|
|
|
|
|
mode: indented-text
|
|
|
|
|
indent-tabs-mode: nil
|
|
|
|
|
sentence-end-double-space: t
|
|
|
|
|
fill-column: 70
|
|
|
|
|
End:
|