Pipenv: "pipenv run" intercepts its command-line options when specified after command

Created on 17 Oct 2017  路  7Comments  路  Source: pypa/pipenv

hobbes:backend cdunklau$ pipenv run pip --help
Usage: pipenv run [OPTIONS] COMMAND [ARGS]...

  Spawns a command installed into the virtualenv.

Options:
  --three / --two  Use Python 3/2 when creating virtualenv.
  --python TEXT    Specify which version of Python virtualenv should use.
  -h, --help       Show this message and exit.

...that should have been the help for pip, but I got pipenv run's help.

Looks like this comes down to how click handles things. The workaround is simply to use --. Both pipenv run -- pip --help and pipenv run pip -- --help give me pip's help output. This also appears to happen for the other pipenv run options: --two, --three, and --python.

I'd expect at least a mention in the pipenv run help output about this, if preventing click's normal behavior isn't feasible.

Type

Most helpful comment

The click docs point this feature out. I'm 95% sure this thing is what's needed, unfortunately I don't have enough time to investigate the effects WRT pipenv. There's a nice example there though.

All 7 comments

I believe this to be a bug in the way click has been implemented. Marking it for fixing.

The click docs point this feature out. I'm 95% sure this thing is what's needed, unfortunately I don't have enough time to investigate the effects WRT pipenv. There's a nice example there though.

Thanks for the help @cdunklau!

This should be fixed in the next release. It needs a better fix...I'm a bit of a noob when it comes to Click so if anyone else has a better solution please submit a PR!

Could we get another release please? 馃槃

@jacebrowning We've been in the process of getting final pieces in for the minor release. I'm not sure they'll be ready soon though, so I can look at cutting 8.3.0 at lunch.

@jacebrowning, 8.3.0 is now released.

Was this page helpful?
0 / 5 - 0 ratings