Skip to content

Commit f2113f0

Browse files
committed
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)
1 parent 9e29fc5 commit f2113f0

5 files changed

Lines changed: 3 additions & 145 deletions

File tree

Lib/distutils/command/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
'bdist_dumb',
2525
'bdist_rpm',
2626
'bdist_wininst',
27-
'checkdep',
2827
# These two are reserved for future use:
2928
#'bdist_sdux',
3029
#'bdist_pkgtool',

Lib/distutils/command/checkdep.py

Lines changed: 0 additions & 70 deletions
This file was deleted.

Lib/distutils/command/install.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@ class install (Command):
126126
"force installation (overwrite any existing files)"),
127127
('skip-build', None,
128128
"skip rebuilding everything (for testing/debugging)"),
129-
('skip-checkdep', None,
130-
"skip checking dependencies (use at own risk)"),
131129

132130
# Where to install documentation (eventually!)
133131
#('doc-format=', None, "format of documentation to generate"),
@@ -185,15 +183,12 @@ def initialize_options (self):
185183

186184
# 'force' forces installation, even if target files are not
187185
# out-of-date. 'skip_build' skips running the "build" command,
188-
# handy if you know it's not necessary. 'skip_checkdep' skips
189-
# the 'checkdep' command, if you are sure you can work around the
190-
# dependency failure in another way. 'warn_dir' (which is *not*
186+
# handy if you know it's not necessary. 'warn_dir' (which is *not*
191187
# a user option, it's just there so the bdist_* commands can turn
192188
# it off) determines whether we warn about installing to a
193189
# directory not in sys.path.
194190
self.force = 0
195191
self.skip_build = 0
196-
self.skip_checkdep = 0
197192
self.warn_dir = 1
198193

199194
# These are only here as a conduit from the 'build' command to the
@@ -505,12 +500,6 @@ def run (self):
505500
if not self.skip_build:
506501
self.run_command('build')
507502

508-
# We check dependencies before we install
509-
# For now, this is disabled. Before 2.4 is released, this will
510-
# be turned on.
511-
#if not self.skip_checkdep:
512-
# self.run_command('checkdep')
513-
514503
# Run all sub-commands (at least those that need to be run)
515504
for cmd_name in self.get_sub_commands():
516505
self.run_command(cmd_name)

Lib/distutils/core.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ def gen_usage (script_name):
4747
'name', 'version', 'author', 'author_email',
4848
'maintainer', 'maintainer_email', 'url', 'license',
4949
'description', 'long_description', 'keywords',
50-
'platforms', 'classifiers', 'download_url',
51-
'provides', 'requires', )
50+
'platforms', 'classifiers', 'download_url',)
5251

5352
# Legal keyword arguments for the Extension constructor
5453
extension_keywords = ('name', 'sources', 'include_dirs',

Lib/distutils/dist.py

Lines changed: 1 addition & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -223,59 +223,13 @@ def __init__ (self, attrs=None):
223223
else:
224224
sys.stderr.write(msg + "\n")
225225

226-
# Build up the requires sequence
227-
from distutils.version import LooseVersion
228-
requires = attrs.get('requires')
229-
if requires:
230-
if isinstance(requires, type('')):
231-
raise DistutilsOptionError, 'requires should be a sequence'
232-
newreq = []
233-
for req in requires:
234-
if '-' not in req:
235-
# We have a plain package name - any version will do
236-
newreq.append((req,None))
237-
else:
238-
pkg, ver = string.split(req, '-', 1)
239-
newreq.append((pkg, LooseVersion(ver)))
240-
attrs['requires'] = newreq
241-
242-
# Build up the provides object. If the setup() has no
243-
# provides line, we use packages or modules and the version
244-
# to synthesise the provides. If no version is provided (no
245-
# pun intended) we don't have a provides entry at all.
246-
provides = attrs.get('provides')
247-
if provides:
248-
if isinstance(provides, type('')):
249-
raise DistutilsOptionError, 'provides should be a sequence'
250-
newprov = []
251-
for prov in provides:
252-
if '-' not in prov:
253-
# We have a plain package name - any version will do
254-
newprov.append((prov,None))
255-
else:
256-
pkg, ver = string.split(prov, '-', 1)
257-
newprov.append((pkg, LooseVersion(ver)))
258-
attrs['provides'] = newprov
259-
elif attrs.get('version'):
260-
# Build a provides line
261-
prov = []
262-
if attrs.get('packages'):
263-
for pkg in attrs['packages']:
264-
pkg = string.replace(pkg, '/', '.')
265-
prov.append('%s-%s'%(pkg, attrs['version']))
266-
elif attrs.get('modules'):
267-
for mod in attrs['modules']:
268-
prov.append('%s-%s'%(mod, attrs['version']))
269-
attrs['provides'] = prov
270-
271226
# Now work on the rest of the attributes. Any attribute that's
272227
# not already defined is invalid!
273228
for (key,val) in attrs.items():
274229
if hasattr(self.metadata, key):
275230
setattr(self.metadata, key, val)
276231
elif hasattr(self, key):
277232
setattr(self, key, val)
278-
else:
279233
msg = "Unknown distribution option: %s" % repr(key)
280234
if warnings is not None:
281235
warnings.warn(msg)
@@ -1060,7 +1014,7 @@ class DistributionMetadata:
10601014
"license", "description", "long_description",
10611015
"keywords", "platforms", "fullname", "contact",
10621016
"contact_email", "license", "classifiers",
1063-
"download_url", "provides", "requires",)
1017+
"download_url")
10641018

10651019
def __init__ (self):
10661020
self.name = None
@@ -1077,8 +1031,6 @@ def __init__ (self):
10771031
self.platforms = None
10781032
self.classifiers = None
10791033
self.download_url = None
1080-
self.requires = []
1081-
self.provides = []
10821034

10831035
def write_pkg_info (self, base_dir):
10841036
"""Write the PKG-INFO file into the release tree.
@@ -1094,10 +1046,6 @@ def write_pkg_info (self, base_dir):
10941046
pkg_info.write('Author: %s\n' % self.get_contact() )
10951047
pkg_info.write('Author-email: %s\n' % self.get_contact_email() )
10961048
pkg_info.write('License: %s\n' % self.get_license() )
1097-
for req in self.get_requires():
1098-
pkg_info.write('Requires: %s\n' % req )
1099-
for prov in self.get_provides():
1100-
pkg_info.write('Provides: %s\n' % prov )
11011049
if self.download_url:
11021050
pkg_info.write('Download-URL: %s\n' % self.download_url)
11031051

@@ -1176,13 +1124,6 @@ def get_classifiers(self):
11761124
def get_download_url(self):
11771125
return self.download_url or "UNKNOWN"
11781126

1179-
def get_requires(self):
1180-
return [ '%s%s%s'%(x, (y and '-') or '', y or '')
1181-
for x,y in self.requires ]
1182-
1183-
def get_provides(self):
1184-
return self.provides
1185-
11861127
# class DistributionMetadata
11871128

11881129

0 commit comments

Comments
 (0)