From 2f44bcd39257095676061cbc03693ce9088d2cdb Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Tue, 31 Aug 2010 03:01:03 +0200 Subject: Fixed issue #151 -- When running the install command, bail early if no requirement is given. --- pip/commands/install.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'pip/commands') diff --git a/pip/commands/install.py b/pip/commands/install.py index a2efff3f0..efb8483b9 100644 --- a/pip/commands/install.py +++ b/pip/commands/install.py @@ -200,11 +200,18 @@ class InstallCommand(Command): for req in parse_requirements(filename, finder=finder, options=options): requirement_set.add_requirement(req) + if not requirement_set.has_requirements: + 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 %s (see "pip help install")' % self.name) + if (options.use_user_site and sys.version_info < (2, 6)): - raise InstallationError('--user is only supported in Python version 2.6 and newer') - + import setuptools if (options.use_user_site and requirement_set.has_editables and -- cgit v1.2.1