diff options
author | Anthony Baxter <anthonybaxter@gmail.com> | 2004-10-13 12:35:28 (GMT) |
---|---|---|
committer | Anthony Baxter <anthonybaxter@gmail.com> | 2004-10-13 12:35:28 (GMT) |
commit | f2113f0c6e7efb788c6aa3bbf666fda223bce188 (patch) | |
tree | 6d18eed9fc79fcffa8364a7d5de4e4e9ccea68a5 /Lib/distutils/command | |
parent | 9e29fc584c28111a8727d9c02082c53aae8c4121 (diff) | |
download | cpython-f2113f0c6e7efb788c6aa3bbf666fda223bce188.zip cpython-f2113f0c6e7efb788c6aa3bbf666fda223bce188.tar.gz cpython-f2113f0c6e7efb788c6aa3bbf666fda223bce188.tar.bz2 |
Backing out the basic dependency checking (from pycon sprint).
This support was only a first cut, and doesn't deserve to be in
a released version (where we have to support it in an ongoing
manner)
Diffstat (limited to 'Lib/distutils/command')
-rw-r--r-- | Lib/distutils/command/__init__.py | 1 | ||||
-rw-r--r-- | Lib/distutils/command/checkdep.py | 70 | ||||
-rw-r--r-- | Lib/distutils/command/install.py | 13 |
3 files changed, 1 insertions, 83 deletions
diff --git a/Lib/distutils/command/__init__.py b/Lib/distutils/command/__init__.py index 3a9a53e..870005d 100644 --- a/Lib/distutils/command/__init__.py +++ b/Lib/distutils/command/__init__.py @@ -24,7 +24,6 @@ __all__ = ['build', 'bdist_dumb', 'bdist_rpm', 'bdist_wininst', - 'checkdep', # These two are reserved for future use: #'bdist_sdux', #'bdist_pkgtool', diff --git a/Lib/distutils/command/checkdep.py b/Lib/distutils/command/checkdep.py deleted file mode 100644 index 729002c..0000000 --- a/Lib/distutils/command/checkdep.py +++ /dev/null @@ -1,70 +0,0 @@ -"""distutils.command.x - -Implements the Distutils 'x' command. -""" - -# created 2000/mm/dd, John Doe - -__revision__ = "$Id$" - -from distutils.core import Command - -class DependencyFailure(Exception): pass - -class VersionTooOld(DependencyFailure): pass - -class VersionNotKnown(DependencyFailure): pass - -class checkdep (Command): - - # Brief (40-50 characters) description of the command - description = "check package dependencies" - - # List of option tuples: long name, short name (None if no short - # name), and help string. - # Later on, we might have auto-fetch and the like here. Feel free. - user_options = [] - - def initialize_options (self): - self.debug = None - - # initialize_options() - - - def finalize_options (self): - pass - # finalize_options() - - - def run (self): - from distutils.version import LooseVersion - failed = [] - for pkg, ver in self.distribution.metadata.requires: - if pkg == 'python': - if ver is not None: - # Special case the 'python' package - import sys - thisver = LooseVersion('%d.%d.%d'%sys.version_info[:3]) - if thisver < ver: - failed.append(((pkg,ver), VersionTooOld(thisver))) - continue - # Kinda hacky - we should do more here - try: - mod = __import__(pkg) - except Exception, e: - failed.append(((pkg,ver), e)) - continue - if ver is not None: - if hasattr(mod, '__version__'): - thisver = LooseVersion(mod.__version__) - if thisver < ver: - failed.append(((pkg,ver), VersionTooOld(thisver))) - else: - failed.append(((pkg,ver), VersionNotKnown())) - - if failed: - raise DependencyFailure, failed - - # run() - -# class x diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py index 175f785..2aaf010 100644 --- a/Lib/distutils/command/install.py +++ b/Lib/distutils/command/install.py @@ -126,8 +126,6 @@ class install (Command): "force installation (overwrite any existing files)"), ('skip-build', None, "skip rebuilding everything (for testing/debugging)"), - ('skip-checkdep', None, - "skip checking dependencies (use at own risk)"), # Where to install documentation (eventually!) #('doc-format=', None, "format of documentation to generate"), @@ -185,15 +183,12 @@ class install (Command): # 'force' forces installation, even if target files are not # out-of-date. 'skip_build' skips running the "build" command, - # handy if you know it's not necessary. 'skip_checkdep' skips - # the 'checkdep' command, if you are sure you can work around the - # dependency failure in another way. 'warn_dir' (which is *not* + # handy if you know it's not necessary. 'warn_dir' (which is *not* # a user option, it's just there so the bdist_* commands can turn # it off) determines whether we warn about installing to a # directory not in sys.path. self.force = 0 self.skip_build = 0 - self.skip_checkdep = 0 self.warn_dir = 1 # These are only here as a conduit from the 'build' command to the @@ -505,12 +500,6 @@ class install (Command): if not self.skip_build: self.run_command('build') - # We check dependencies before we install - # For now, this is disabled. Before 2.4 is released, this will - # be turned on. - #if not self.skip_checkdep: - # self.run_command('checkdep') - # Run all sub-commands (at least those that need to be run) for cmd_name in self.get_sub_commands(): self.run_command(cmd_name) |