1. Ronny Pfannschmidt
  2. pip-patches

Commits

Ronny Pfannschmidt  committed c7bf6a2

fix the --user alias, this time it propperly appends the --user install opt

  • Participants
  • Parent commits 780bb1b
  • Branches default

Comments (0)

Files changed (1)

File user-alias

View file
 # HG changeset patch
-# Parent 17250062114b72ef018755f2f307e3598139c54a
+# Parent ee53fb869d62081af93a30f0f0ef869b92296bbe
 add a --user alias for --install-opt=--user
 
 diff --git a/pip/commands/install.py b/pip/commands/install.py
 --- a/pip/commands/install.py
 +++ b/pip/commands/install.py
-@@ -130,6 +130,18 @@ class InstallCommand(Command):
+@@ -130,6 +130,12 @@ class InstallCommand(Command):
              help="Extra global options to be supplied to the setup.py"
              "call before the install command")
  
-+        def add_user_flag_callback(option, opt_str, value, parser):
-+            if not hasattr(parser, 'install_options'):
-+                parser.install_options = []
-+            parser.install_options.append('--user')
-+
 +        self.parser.add_option(
 +            '--user',
-+            action='callback',
-+            nargs=0,
-+            callback=add_user_flag_callback,
++            dest='use_user_site',
++            action='store_true',
 +            help='Install to user-site')
 +
      def _build_package_finder(self, options, index_urls):
          """
          Create a package finder appropriate to this install command.
+@@ -149,6 +155,8 @@ class InstallCommand(Command):
+         options.build_dir = os.path.abspath(options.build_dir)
+         options.src_dir = os.path.abspath(options.src_dir)
+         install_options = options.install_options or []
++        if options.use_user_site:
++            install_options.append('--user')
+         global_options = options.global_options or []
+         index_urls = [options.index_url] + options.extra_index_urls
+         if options.no_index: