Skip to content

Commit

Permalink
Merge pull request #3352 from nonylene/patch-1
Browse files Browse the repository at this point in the history
Fix `--site-packages` flag is not recognized
  • Loading branch information
techalchemy committed Dec 8, 2018
2 parents 69f2003 + f81e861 commit 7a2bdfe
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions news/3351.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug that ``--site-packages`` flag is not recognized.
3 changes: 1 addition & 2 deletions pipenv/cli/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ def cli(
python=False,
help=False,
py=False,
site_packages=False,
envs=False,
man=False,
completion=False,
Expand Down Expand Up @@ -198,7 +197,7 @@ def cli(
)
ctx.abort()
# --two / --three was passed…
if (state.python or state.three is not None) or site_packages:
if (state.python or state.three is not None) or state.site_packages:
ensure_project(
three=state.three,
python=state.python,
Expand Down
14 changes: 14 additions & 0 deletions tests/integration/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ def test_pipenv_py(PipenvInstance):
assert os.path.basename(python).startswith('python')


@pytest.mark.cli
def test_pipenv_site_packages(PipenvInstance):
with PipenvInstance() as p:
c = p.pipenv('--python python --site-packages')
assert c.return_code == 0
assert 'Making site-packages available' in c.err

# no-global-site-packages.txt under stdlib dir should not exist.
c = p.pipenv('run python -c "import sysconfig; print(sysconfig.get_path(\'stdlib\'))"')
assert c.return_code == 0
stdlib_path = c.out.strip()
assert not os.path.isfile(os.path.join(stdlib_path, 'no-global-site-packages.txt'))


@pytest.mark.cli
def test_pipenv_support(PipenvInstance):
with PipenvInstance() as p:
Expand Down

0 comments on commit 7a2bdfe

Please sign in to comment.