2003-04-12 16:16:20 -04:00
|
|
|
PEP: 314
|
|
|
|
Title: Metadata for Python Software Packages v1.1
|
2003-04-12 15:45:01 -04:00
|
|
|
Version: $Revision$
|
2003-04-29 13:02:46 -04:00
|
|
|
Last-Modified: $Date$
|
2007-04-14 22:08:39 -04:00
|
|
|
Author: A.M. Kuchling, Richard Jones
|
2006-05-01 07:18:18 -04:00
|
|
|
Status: Final
|
2003-04-12 15:45:01 -04:00
|
|
|
Type: Standards Track
|
2022-06-14 17:22:20 -04:00
|
|
|
Topic: Packaging
|
2017-02-24 19:07:48 -05:00
|
|
|
Content-Type: text/x-rst
|
2003-04-12 16:16:20 -04:00
|
|
|
Created: 12-Apr-2003
|
2005-04-09 18:57:29 -04:00
|
|
|
Python-Version: 2.5
|
2003-04-29 13:37:08 -04:00
|
|
|
Post-History: 29-Apr-2003
|
2003-05-14 13:12:55 -04:00
|
|
|
Replaces: 241
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
|
2003-04-12 15:45:01 -04:00
|
|
|
Introduction
|
2017-02-24 19:07:48 -05:00
|
|
|
============
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
This PEP describes a mechanism for adding metadata to Python
|
|
|
|
packages. It includes specifics of the field names, and their
|
|
|
|
semantics and usage.
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
This document specifies version 1.1 of the metadata format.
|
2022-01-21 06:03:51 -05:00
|
|
|
Version 1.0 is specified in :pep:`241`.
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2003-04-29 13:31:16 -04:00
|
|
|
|
2003-04-12 15:45:01 -04:00
|
|
|
Including Metadata in Packages
|
2017-02-24 19:07:48 -05:00
|
|
|
==============================
|
|
|
|
|
|
|
|
The Distutils ``sdist`` command will extract the metadata fields
|
|
|
|
from the arguments and write them to a file in the generated
|
|
|
|
zipfile or tarball. This file will be named PKG-INFO and will be
|
|
|
|
placed in the top directory of the source distribution (where the
|
|
|
|
README, INSTALL, and other files usually go).
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Developers may not provide their own PKG-INFO file. The ``sdist``
|
|
|
|
command will, if it detects an existing PKG-INFO file, terminate
|
|
|
|
with an appropriate error message. This should prevent confusion
|
|
|
|
caused by the PKG-INFO and setup.py files being out of sync.
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2022-01-21 06:03:51 -05:00
|
|
|
The PKG-INFO file format is a single set of :rfc:`822` headers
|
2017-02-24 19:07:48 -05:00
|
|
|
parseable by the rfc822.py module. The field names listed in the
|
|
|
|
following section are used as the header names.
|
2003-04-12 15:45:01 -04:00
|
|
|
|
|
|
|
|
|
|
|
Fields
|
2017-02-24 19:07:48 -05:00
|
|
|
======
|
|
|
|
|
|
|
|
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
|
|
|
|
----------------
|
|
|
|
|
|
|
|
Version of the file format; currently "1.0" and "1.1" are the
|
|
|
|
only legal values here.
|
|
|
|
|
|
|
|
Example::
|
|
|
|
|
|
|
|
Metadata-Version: 1.1
|
|
|
|
|
|
|
|
Name
|
|
|
|
----
|
|
|
|
|
|
|
|
The name of the package.
|
|
|
|
|
|
|
|
Example::
|
|
|
|
|
|
|
|
Name: BeagleVote
|
|
|
|
|
|
|
|
Version
|
|
|
|
-------
|
|
|
|
|
|
|
|
A string containing the package's version number. This
|
|
|
|
field should be parseable by one of the Version classes
|
|
|
|
(StrictVersion or LooseVersion) in the distutils.version
|
|
|
|
module.
|
|
|
|
|
|
|
|
Example::
|
|
|
|
|
|
|
|
Version: 1.0a2
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Platform (multiple use)
|
|
|
|
-----------------------
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
A comma-separated list of platform specifications, summarizing
|
|
|
|
the operating systems supported by the package which are not
|
|
|
|
listed in the "Operating System" Trove classifiers. See
|
|
|
|
"Classifier" below.
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Example::
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Platform: ObscureUnix, RareDOS
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Supported-Platform (multiple use)
|
|
|
|
---------------------------------
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Binary distributions containing a PKG-INFO file will use the
|
|
|
|
Supported-Platform field in their metadata to specify the OS and
|
|
|
|
CPU for which the binary package was compiled. The semantics of
|
|
|
|
the Supported-Platform field are not specified in this PEP.
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Example::
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Supported-Platform: RedHat 7.2
|
|
|
|
Supported-Platform: i386-win32-2791
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Summary
|
|
|
|
-------
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
A one-line summary of what the package does.
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Example::
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Summary: A module for collecting votes from beagles.
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Description (optional)
|
|
|
|
----------------------
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
A longer description of the package that can run to several
|
|
|
|
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.
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -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.
|
2003-05-07 10:50:49 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Example::
|
2003-05-07 12:34:52 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Description: This module collects votes from beagles
|
|
|
|
in order to determine their electoral wishes.
|
|
|
|
Do *not* try to use this module with basset hounds;
|
|
|
|
it makes them grumpy.
|
2003-05-07 12:34:52 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Keywords (optional)
|
|
|
|
-------------------
|
2003-05-07 12:34:52 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
A list of additional keywords to be used to assist searching
|
|
|
|
for the package in a larger catalog.
|
2003-05-07 12:34:52 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Example::
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Keywords: dog puppy voting election
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Home-page (optional)
|
|
|
|
--------------------
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
A string containing the URL for the package's home page.
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Example::
|
2003-05-07 12:53:28 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Home-page: http://www.example.com/~cschultz/bvote/
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Download-URL
|
|
|
|
------------
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
A string containing the URL from which this version of the package
|
|
|
|
can be downloaded. (This means that the URL can't be something like
|
|
|
|
".../package-latest.tgz", but instead must be "../package-0.45.tgz".)
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Author (optional)
|
|
|
|
-----------------
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
A string containing the author's name at a minimum; additional
|
|
|
|
contact information may be provided.
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Example::
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Author: C. Schultz, Universal Features Syndicate,
|
|
|
|
Los Angeles, CA <cschultz@peanuts.example.com>
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Author-email
|
|
|
|
------------
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
A string containing the author's e-mail address. It can contain
|
2022-01-21 06:03:51 -05:00
|
|
|
a name and e-mail address in the legal forms for a :rfc:`822`
|
2017-02-24 19:07:48 -05:00
|
|
|
'From:' header. It's not optional because cataloging systems
|
|
|
|
can use the e-mail portion of this field as a unique key
|
|
|
|
representing the author. A catalog might provide authors the
|
|
|
|
ability to store their GPG key, personal home page, and other
|
|
|
|
additional metadata *about the author*, and optionally the
|
|
|
|
ability to associate several e-mail addresses with the same
|
|
|
|
person. Author-related metadata fields are not covered by this
|
|
|
|
PEP.
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Example::
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Author-email: "C. Schultz" <cschultz@example.com>
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
License
|
|
|
|
-------
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Text indicating the license covering the package where the license
|
|
|
|
is not a selection from the "License" Trove classifiers. See
|
|
|
|
"Classifier" below.
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Example::
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
License: This software may only be obtained by sending the
|
|
|
|
author a postcard, and then the user promises not
|
|
|
|
to redistribute it.
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Classifier (multiple use)
|
|
|
|
-------------------------
|
2003-04-29 13:31:16 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Each entry is a string giving a single classification value
|
2022-01-21 06:03:51 -05:00
|
|
|
for the package. Classifiers are described in :pep:`301`.
|
2003-04-29 13:31:16 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Examples::
|
2003-04-29 13:31:16 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Classifier: Development Status :: 4 - Beta
|
|
|
|
Classifier: Environment :: Console (Text Based)
|
2003-04-29 13:31:16 -04:00
|
|
|
|
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Requires (multiple use)
|
|
|
|
-----------------------
|
2003-04-12 16:16:20 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
Each entry contains a string describing some other module or
|
|
|
|
package required by this package.
|
2003-04-12 16:16:20 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
The format of a requirement string is identical to that of a
|
|
|
|
module or package name usable with the 'import' statement,
|
|
|
|
optionally followed by a version declaration within parentheses.
|
2003-04-12 16:16:20 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
A version declaration is a series of conditional operators and
|
|
|
|
version numbers, separated by commas. Conditional operators
|
|
|
|
must be one of "<", ">", "<=", ">=", "==", and "!=". Version
|
|
|
|
numbers must be in the format accepted by the
|
|
|
|
distutils.version.StrictVersion class: two or three
|
|
|
|
dot-separated numeric components, with an optional "pre-release"
|
|
|
|
tag on the end consisting of the letter 'a' or 'b' followed by a
|
|
|
|
number. Example version numbers are "1.0", "2.3a2", "1.3.99",
|
|
|
|
|
|
|
|
Any number of conditional operators can be specified, e.g.
|
|
|
|
the string ">1.0, !=1.3.4, <2.0" is a legal version declaration.
|
|
|
|
|
|
|
|
All of the following are possible requirement strings: "rfc822",
|
|
|
|
"zlib (>=1.1.4)", "zope".
|
|
|
|
|
|
|
|
There's no canonical list of what strings should be used; the
|
|
|
|
Python community is left to choose its own standards.
|
|
|
|
|
|
|
|
Example::
|
|
|
|
|
|
|
|
Requires: re
|
|
|
|
Requires: sys
|
|
|
|
Requires: zlib
|
|
|
|
Requires: xml.parsers.expat (>1.0)
|
|
|
|
Requires: psycopg
|
|
|
|
|
|
|
|
Provides (multiple use)
|
|
|
|
-----------------------
|
|
|
|
|
|
|
|
Each entry contains a string describing a package or module that
|
|
|
|
will be provided by this package once it is installed. These
|
|
|
|
strings should match the ones used in Requirements fields. A
|
|
|
|
version declaration may be supplied (without a comparison
|
|
|
|
operator); the package's version number will be implied if none
|
|
|
|
is specified.
|
|
|
|
|
|
|
|
Example::
|
|
|
|
|
|
|
|
Provides: xml
|
|
|
|
Provides: xml.utils
|
|
|
|
Provides: xml.utils.iso8601
|
|
|
|
Provides: xml.dom
|
|
|
|
Provides: xmltools (1.3)
|
|
|
|
|
|
|
|
Obsoletes (multiple use)
|
|
|
|
------------------------
|
|
|
|
|
|
|
|
Each entry contains a string describing a package or module
|
|
|
|
that this package renders obsolete, meaning that the two packages
|
|
|
|
should not be installed at the same time. Version declarations
|
|
|
|
can be supplied.
|
|
|
|
|
|
|
|
The most common use of this field will be in case a package name
|
|
|
|
changes, e.g. Gorgon 2.3 gets subsumed into Torqued Python 1.0.
|
|
|
|
When you install Torqued Python, the Gorgon package should be
|
|
|
|
removed.
|
|
|
|
|
|
|
|
Example::
|
|
|
|
|
|
|
|
Obsoletes: Gorgon
|
2003-04-12 17:16:50 -04:00
|
|
|
|
|
|
|
|
2003-04-29 13:31:16 -04:00
|
|
|
Summary of Differences From PEP 241
|
2017-02-24 19:07:48 -05:00
|
|
|
===================================
|
2003-04-29 13:31:16 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
* Metadata-Version is now 1.1.
|
2003-04-29 13:31:16 -04:00
|
|
|
|
2022-01-21 06:03:51 -05:00
|
|
|
* Added the Classifiers field from :pep:`301`.
|
2003-04-29 13:31:16 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
* The License and Platform files should now only be used if the
|
|
|
|
platform or license can't be handled by an appropriate Classifier
|
|
|
|
value.
|
2005-02-02 21:30:53 -05:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
* Added fields: Download-URL, Requires, Provides, Obsoletes.
|
2003-04-29 13:31:16 -04:00
|
|
|
|
|
|
|
|
|
|
|
Open issues
|
2017-02-24 19:07:48 -05:00
|
|
|
===========
|
2003-04-29 13:31:16 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
None.
|
2003-04-29 13:31:16 -04:00
|
|
|
|
|
|
|
|
2003-04-12 16:16:20 -04:00
|
|
|
Acknowledgements
|
2017-02-24 19:07:48 -05:00
|
|
|
================
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
None.
|
2003-04-12 15:45:01 -04:00
|
|
|
|
2003-04-12 17:16:50 -04:00
|
|
|
|
2003-04-29 13:31:16 -04:00
|
|
|
References
|
2017-02-24 19:07:48 -05:00
|
|
|
==========
|
2003-04-29 13:31:16 -04:00
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
.. [1] reStructuredText
|
|
|
|
http://docutils.sourceforge.net/
|
2003-05-07 12:53:28 -04:00
|
|
|
|
2003-04-29 13:31:16 -04:00
|
|
|
|
2003-04-12 15:45:01 -04:00
|
|
|
Copyright
|
2017-02-24 19:07:48 -05:00
|
|
|
=========
|
|
|
|
|
|
|
|
This document has been placed in the public domain.
|
2003-04-12 15:45:01 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-24 19:07:48 -05:00
|
|
|
..
|
|
|
|
Local Variables:
|
|
|
|
mode: indented-text
|
|
|
|
indent-tabs-mode: nil
|
|
|
|
End:
|