1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Allowing empty requirements.txt to be specified as valid dependency list by stopping to raise an InstallationError if the requirements set is empty. Closes #345.

This commit is contained in:
Craig Kerstiens 2011-08-25 12:08:17 -07:00 committed by Jannis Leidel
parent 2a5e21b41f
commit b99427d94e

View file

@ -200,14 +200,17 @@ class InstallCommand(Command):
for filename in options.requirements:
for req in parse_requirements(filename, finder=finder, options=options):
requirement_set.add_requirement(req)
if not requirement_set.has_requirements:
opts = {'name': self.name}
if options.find_links:
raise InstallationError('You must give at least one '
'requirement to %s (maybe you meant "pip install %s"?)'
% (self.name, " ".join(options.find_links)))
raise InstallationError('You must give at least one requirement '
'to %(name)s (see "pip help %(name)s")' % dict(name=self.name))
msg = ('You must give at least one requirement to %(name)s '
'(maybe you meant "pip %(name)s %(links)s"?)' %
dict(opts, links=' '.join(options.find_links)))
else:
msg = ('You must give at least one requirement '
'to %(name)s (see "pip help %(name)s")' % opts)
logger.warn(msg)
return
if (options.use_user_site and
sys.version_info < (2, 6)):