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

Fix pipenv crashes #2388

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pipenv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1889,13 +1889,19 @@ def do_install(
# Capture -e argument and assign it to following package_name.
more_packages = list(more_packages)
if package_name == '-e':
if not more_packages:
raise click.BadArgumentUsage('Please provide path to editable package')
package_name = ' '.join([package_name, more_packages.pop(0)])
# capture indexes and extra indexes
line = [package_name] + more_packages
line = ' '.join(str(s) for s in line).strip()
index_indicators = ['-i', '--index', '--extra-index-url']
index, extra_indexes = None, None
if more_packages and any(more_packages[0].startswith(s) for s in index_indicators):
line, index = split_argument(' '.join(line), short='i', long_='index', num=1)
if any(line.endswith(s) for s in index_indicators):
# check if cli option is not end of command
raise click.BadArgumentUsage('Please provide index value')
if any(s in line for s in index_indicators):
line, index = split_argument(line, short='i', long_='index', num=1)
line, extra_indexes = split_argument(line, long_='extra-index-url')
package_names = line.split()
package_name = package_names[0]
Expand Down