Skip to content

Commit

Permalink
Merge branch 'maxk-fix-empty-requires'
Browse files Browse the repository at this point in the history
  • Loading branch information
techalchemy committed Jun 22, 2018
2 parents 2a9bb81 + c76b95d commit beb6aef
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions news/2388.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Massive internal improvements to requirements parsing codebase, resolver, and error messaging.
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
10 changes: 10 additions & 0 deletions tests/integration/test_install_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,3 +299,13 @@ def test_install_does_not_extrapolate_environ(PipenvInstance, pypi):
assert c.return_code == 0
assert p.pipfile['source'][0]['url'] == '${PYPI_URL}/simple'
assert p.lockfile['_meta']['sources'][0]['url'] == '${PYPI_URL}/simple'


@pytest.mark.editable
@pytest.mark.badparameter
@pytest.mark.install
def test_editable_no_args(PipenvInstance):
with PipenvInstance() as p:
c = p.pipenv('install -e')
assert c.return_code != 0
assert 'Please provide path to editable package' in c.err

0 comments on commit beb6aef

Please sign in to comment.