PEP 345 – Metadata for Python Software Packages 1.2 | peps.python.org
PEP 345 – Metadata for Python Software Packages 1.2 PEP 345 – Metadata for Python Software Packages 1.2 Author : Richard Jones <richard at python.org> Discussions-To : Distutils-SIG list Status : Superseded Type : Standards Track Topic : Packaging Created : 28-Apr-2005 Python-Version : 2.7 Post-History : 22-Dec-2009 Replaces : 314 Superseded-By : 566 Resolution : Python-Dev thread Table of Contents Abstract Fields Metadata-Version Name Version Platform (multiple use) Supported-Platform (multiple use) Summary Description (optional) Keywords (optional) Home-page (optional) Download-URL Author (optional) Author-email (optional) Maintainer (optional) Maintainer-email (optional) License (optional) Classifier (multiple use) Requires-Dist (multiple use) Provides-Dist (multiple use) Obsoletes-Dist (multiple use) Requires-Python Requires-External (multiple use) Project-URL (multiple-use) Version Specifiers Environment markers Summary of Differences From PEP 314 References Copyright Acknowledgements Important This PEP is a historical document.
The up-to-date, canonical spec, Core metadata specifications , is maintained on the PyPA specs page . × See the PyPA specification update process for how to propose changes. Abstract This PEP describes a mechanism for adding metadata to Python distributions. 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. These fields are “Requires-Python”, “Requires-External”, “Requires-Dist”, “Provides-Dist”, and “Obsoletes-Dist”. This version also changes the “Platform” field. Three new fields were also added: “Maintainer”, “Maintainer-email” and “Project-URL”.
Last, this new version also adds environment markers . 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 Version of the file format; “1.2” is the only legal value. Example: Metadata - Version : 1.2 Name The name of the distributions. Example: Name : BeagleVote Version A string containing the distribution’s version number. This field must be in the format specified in PEP 440 . Example: Version : 1.0 a2 Platform (multiple use) A Platform specification describing an operating system supported by the distribution which is not listed in the “Operating System” Trove classifiers.
See “Classifier” below. Examples: Platform : ObscureUnix Platform : RareDOS Supported-Platform (multiple use) 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 distribution was compiled. The semantics of the Supported-Platform field are not specified in this PEP. Example: Supported - Platform : RedHat 7.2 Supported - Platform : i386 - win32 - 2791 Summary A one-line summary of what the distribution does.
Example: Summary : A module for collecting votes from beagles. Description (optional) A longer description of the distribution 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. 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. To support empty lines and lines with indentation with respect to the RFC 822 format, any CRLF character has to be suffixed by 7 spaces followed by a pipe (“|”) char. As a result, the Description field is encoded into a folded field that can be interpreted by RFC 822 Section 3.1.1 parser. Example: Description: This project provides powerful math functions |For example, you can use ``sum()`` to sum numbers: | |Example:: | | >>> sum(1, 2) | 3 | This encoding implies that any occurrences of a CRLF followed by 7 spaces and a pipe char have to be replaced by a single CRLF when the field is unfolded using a RFC 822 reader.
Keywords (optional) A list of additional keywords to be used to assist searching for the distribution in a larger catalog. Example: Keywords : dog puppy voting election Home-page (optional) A string containing the URL for the distribution’s home page. Example: Home - page : http : // www . example . com /~ cschultz / bvote / Download-URL A string containing the URL from which this version of the distribution can be downloaded. (This means that the URL can’t be something like “…/BeagleVote-latest.tgz”, but instead must be “…/BeagleVote-0.45.tgz”.) Author (optional) 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 > Author-email (optional) 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 From: header. Example: Author - email : "C. Schultz" < cschultz @example . com > Maintainer (optional) A string containing the maintainer’s name at a minimum; additional contact information may be provided.
Note that this field is intended for use when a project is being maintained by someone other than the original author: it should be omitted if it is identical to Author . Example: Maintainer : C . Schultz , Universal Features Syndicate , Los Angeles , CA < cschultz @peanuts . example . com > Maintainer-email (optional) 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.
Note that this field is intended for use when a project is being 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 > License (optional) Text indicating the license covering the distribution where the license 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 license which is named via the Classifier field, or to indicate a variation or exception to such a license. Examples: License : This software may only be obtained by sending the author a postcard , and then the user promises not to redistribute it . License : GPL version 3 , excluding DRM provisions Classifier (multiple use) Each entry is a string giving a single classification value for the distribution.
Classifiers are described in PEP 301 . Examples: Classifier : Development Status :: 4 - Beta Classifier : Environment :: Console ( Text Based ) Requires-Dist (multiple use) Each entry contains a string naming some other distutils project required by this distribution. 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.
The distutils project names should correspond to names as found on the Python Package Index . Version declarations must follow the rules described in Version Specifiers Examples: Requires - Dist : pkginfo Requires - Dist : PasteDeploy Requires - Dist : zope . interface ( > 3.5.0 ) Provides-Dist (multiple use) Each entry contains a string naming a Distutils project which is contained within thi
The rest of this page is on the live site.