diff options
author | Fred Drake <fdrake@acm.org> | 2005-03-20 22:19:47 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2005-03-20 22:19:47 (GMT) |
commit | db7b0027dcebca13d193db09d7f266d871fe67b9 (patch) | |
tree | f129701cb790d19559b49ddfb4a58e2c60217a82 /Doc | |
parent | 54398d6afb680bde217cc9529b2cd88485bec3d8 (diff) | |
download | cpython-db7b0027dcebca13d193db09d7f266d871fe67b9.zip cpython-db7b0027dcebca13d193db09d7f266d871fe67b9.tar.gz cpython-db7b0027dcebca13d193db09d7f266d871fe67b9.tar.bz2 |
PEP 314 implementation (client side):
added support for the provides, requires, and obsoletes metadata fields
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/dist/dist.tex | 76 | ||||
-rw-r--r-- | Doc/whatsnew/whatsnew25.tex | 8 |
2 files changed, 84 insertions, 0 deletions
diff --git a/Doc/dist/dist.tex b/Doc/dist/dist.tex index 93cc59cf..bcff1a6 100644 --- a/Doc/dist/dist.tex +++ b/Doc/dist/dist.tex @@ -631,7 +631,83 @@ is not needed when building compiled extensions: Distutils will automatically add \code{initmodule} to the list of exported symbols. +\section{Relationships between Distributions and Packages} + +A distribution may relate to packages in three specific ways: + +\begin{enumerate} + \item It can require packages or modules. + + \item It can provide packages or modules. + + \item It can obsolete packages or modules. +\end{enumerate} + +These relationships can be specified using keyword arguments to the +\function{distutils.core.setup()} function. + +Dependencies on other Python modules and packages can be specified by +supplying the \var{requires} keyword argument to \function{setup()}. +The value must be a list of strings. Each string specifies a package +that is required, and optionally what versions are sufficient. + +To specify that any version of a module or package is required, the +string should consist entirely of the module or package name. +Examples include \code{'mymodule'} and \code{'xml.parsers.expat'}. + +If specific versions are required, a sequence of qualifiers can be +supplied in parentheses. Each qualifier may consist of a comparison +operator and a version number. The accepted comparison operators are: + +\begin{verbatim} +< > == +<= >= != +\end{verbatim} + +These can be combined by using multiple qualifiers separated by commas +(and optional whitespace). In this case, all of the qualifiers must +be matched; a logical AND is used to combine the evaluations. + +Let's look at a bunch of examples: + +\begin{tableii}{l|l}{code}{Requires Expression}{Explanation} + \lineii{==1.0} {Only version \code{1.0} is compatible} + \lineii{>1.0, !=1.5.1, <2.0} {Any version after \code{1.0} and before + \code{2.0} is compatible, except + \code{1.5.1}} +\end{tableii} + +Now that we can specify dependencies, we also need to be able to +specify what we provide that other distributions can require. This is +done using the \var{provides} keyword argument to \function{setup()}. +The value for this keyword is a list of strings, each of which names a +Python module or package, and optionally identifies the version. If +the version is not specified, it is assumed to match that of the +distribution. + +Some examples: + +\begin{tableii}{l|l}{code}{Provides Expression}{Explanation} + \lineii{mypkg} {Provide \code{mypkg}, using the distribution version} + \lineii{mypkg (1.1} {Provide \code{mypkg} version 1.1, regardless of the + distribution version} +\end{tableii} + +A package can declare that it obsoletes other packages using the +\var{obsoletes} keyword argument. The value for this is similar to +that of the \var{requires} keyword: a list of strings giving module or +package specifiers. Each specifier consists of a module or package +name optionally followed by one or more version qualifiers. Version +qualifiers are given in parentheses after the module or package name. + +The versions identified by the qualifiers are those that are obsoleted +by the distribution being described. If no qualifiers are given, all +versions of the named module or package are understood to be +obsoleted. + + \section{Installing Scripts} + So far we have been dealing with pure and non-pure Python modules, which are usually not run by themselves but imported by scripts. diff --git a/Doc/whatsnew/whatsnew25.tex b/Doc/whatsnew/whatsnew25.tex index 869eb58..113fa32 100644 --- a/Doc/whatsnew/whatsnew25.tex +++ b/Doc/whatsnew/whatsnew25.tex @@ -53,6 +53,14 @@ Raymond Hettinger.} %====================================================================== +\section{PEP 314: Metadata for Python Software Packages v1.1} + +XXX describe this PEP. + distutils \function{setup()} now supports the \var{provides}, + \var{requires}, \var{obsoletes} keywords. + + +%====================================================================== \section{Other Language Changes} Here are all of the changes that Python 2.5 makes to the core Python |