Merge pull request #3352 from nonylene/patch-1

Fix `--site-packages` flag is not recognized
This commit is contained in:
Dan Ryan
2018-12-08 17:16:16 -05:00
committed by GitHub
3 changed files with 16 additions and 2 deletions
+1
View File
@@ -0,0 +1 @@
Fix a bug that ``--site-packages`` flag is not recognized.
+1 -2
View File
@@ -70,7 +70,6 @@ def cli(
python=False,
help=False,
py=False,
site_packages=False,
envs=False,
man=False,
completion=False,
@@ -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,
+14
View File
@@ -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: