Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing -e directory multiple times attempts to install -e as a package #2279

Closed
ncoghlan opened this issue May 30, 2018 · 4 comments · Fixed by #2814
Closed

Passing -e directory multiple times attempts to install -e as a package #2279

ncoghlan opened this issue May 30, 2018 · 4 comments · Fixed by #2814
Labels
Type: Bug 🐛 This issue is a bug.

Comments

@ncoghlan
Copy link
Member

pipenv install -e local/subdir1 -e local/subdir2 fails with an assertion traceback.

Version: 2018.05.18


Expected result

That pipenv install -e local/subdir1 -e local/subdir2 would add both directories to Pipfile as editable installs, similar to the effect of pip install -e local/subdir1 -e local/subdir2.

Actual result

The second -e gets interpreted as a package to try to install, which then fails:

[snip successfully setting up the first editable install]
Installing -e…
Traceback (most recent call last):
  File "/home/ncoghlan/.local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/home/ncoghlan/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/ncoghlan/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/ncoghlan/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ncoghlan/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ncoghlan/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/ncoghlan/.local/lib/python3.5/site-packages/pipenv/cli.py", line 402, in install
    selective_upgrade=selective_upgrade,
  File "/home/ncoghlan/.local/lib/python3.5/site-packages/pipenv/core.py", line 1978, in do_install
    extra_indexes=extra_indexes,
  File "/home/ncoghlan/.local/lib/python3.5/site-packages/pipenv/core.py", line 1420, in pip_install
    package_name.split('--hash')[0].split('--trusted-host')[0]
  File "/home/ncoghlan/.local/lib/python3.5/site-packages/pipenv/utils.py", line 142, in get_requirement
    req = [r for r in requirements.parse(dep)][0]
  File "/home/ncoghlan/.local/lib/python3.5/site-packages/pipenv/utils.py", line 142, in <listcomp>
    req = [r for r in requirements.parse(dep)][0]
  File "/home/ncoghlan/.local/lib/python3.5/site-packages/pipenv/vendor/requirements/parser.py", line 50, in parse
    yield Requirement.parse(line)
  File "/home/ncoghlan/.local/lib/python3.5/site-packages/pipenv/vendor/requirements/requirement.py", line 218, in parse
    re.sub(r'^(-e|--editable=?)\s*', '', line))
  File "/home/ncoghlan/.local/lib/python3.5/site-packages/pipenv/vendor/requirements/requirement.py", line 123, in parse_editable
    assert local_match is not None, 'This should match everything'
AssertionError: This should match everything
Steps to replicate
  1. Have two local directories that support being installed with pip -e local/subdir
  2. Attempt to install them both as editable in a single command, rather than as separate commands
@techalchemy techalchemy added the Type: Bug 🐛 This issue is a bug. label May 30, 2018
@techalchemy
Copy link
Member

This makes me wonder why we are parsing this all manually instead of just using a command line flag. I’ve written so much custom handling around this by now it’s actually ridiculous. If it were a command line flag tied to install we could consume as many as we want

@uranusjr
Copy link
Member

uranusjr commented May 30, 2018

IIRC I asked this a while ago, and the answer is the option flag can’t do some things we need. I don’t remember what exactly it is though. Probably need to ask Kenneth. I am certainly +1 for using an click.option instead if there’s no technical difficulty.

@techalchemy
Copy link
Member

I feel like I said that and I feel like I was wrong

@uranusjr
Copy link
Member

Let’s do it then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐛 This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants