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 index_indicators condition #2631

Closed
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pipenv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1844,7 +1844,7 @@ def do_install(
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):
if any(arg == s for arg in line.split() 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()
Expand Down
12 changes: 12 additions & 0 deletions tests/integration/test_install_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,18 @@ def test_editable_no_args(PipenvInstance):
assert "Please provide path to editable package" in c.err


@pytest.mark.editable
@pytest.mark.install
def test_editable_with_dash_i_will_not_identify_as_index(PipenvInstance):
with PipenvInstance(chdir=True) as p:
os.mkdir('packages')
os.mkdir('packages/haha-internal')
with open('packages/haha-internal/setup.py', 'w') as f:
f.write('from setuptools import setup; setup(name="haha-internal")')
c = p.pipenv('install -e packages/haha-internal')
assert c.return_code == 0


@pytest.mark.install
@pytest.mark.virtualenv
def test_install_venv_project_directory(PipenvInstance, pypi):
Expand Down