diff options
author | Anthony Baxter <anthonybaxter@gmail.com> | 2004-03-22 22:22:05 (GMT) |
---|---|---|
committer | Anthony Baxter <anthonybaxter@gmail.com> | 2004-03-22 22:22:05 (GMT) |
commit | 05f842bae280914ce37a7ce2774bcc25cfaf4814 (patch) | |
tree | 2961957d5b80ab197c7b15268d73f1ff7300cfd7 /Lib/distutils/core.py | |
parent | a3837a0d6394f9299e9cf5b4c67fcc705ec548ed (diff) | |
download | cpython-05f842bae280914ce37a7ce2774bcc25cfaf4814.zip cpython-05f842bae280914ce37a7ce2774bcc25cfaf4814.tar.gz cpython-05f842bae280914ce37a7ce2774bcc25cfaf4814.tar.bz2 |
Basic dependency checking. setup() has two new optional arguments
requires and provides. requires is a sequence of strings, of the
form 'packagename-version'. The dependency checking so far merely
does an '__import__(packagename)' and checks for packagename.__version__
You can also leave off the version, and any version of the package
will be installed.
There's a special case for the package 'python' - sys.version_info
is used, so
requires= ( 'python-2.3', )
just works.
Provides is of the same format as requires - but if it's not supplied,
a provides is generated by adding the version to each entry in packages,
or modules if packages isn't there.
Provides is currently only used in the PKG-INFO file. Shortly, PyPI
will grow the ability to accept these lines, and register will be
updated to send them.
There's a new command 'checkdep' command that runs these checks.
For this version, only greater-than-or-equal checking is done. We'll
add the ability to specify an optional operator later.
Diffstat (limited to 'Lib/distutils/core.py')
-rw-r--r-- | Lib/distutils/core.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/distutils/core.py b/Lib/distutils/core.py index eb41972..fba463c 100644 --- a/Lib/distutils/core.py +++ b/Lib/distutils/core.py @@ -47,7 +47,8 @@ setup_keywords = ('distclass', 'script_name', 'script_args', 'options', 'name', 'version', 'author', 'author_email', 'maintainer', 'maintainer_email', 'url', 'license', 'description', 'long_description', 'keywords', - 'platforms', 'classifiers', 'download_url') + 'platforms', 'classifiers', 'download_url', + 'provides', 'requires', ) # Legal keyword arguments for the Extension constructor extension_keywords = ('name', 'sources', 'include_dirs', |