mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Merge pull request #3352 from nonylene/patch-1
Fix `--site-packages` flag is not recognized
This commit is contained in:
@@ -0,0 +1 @@
|
||||
Fix a bug that ``--site-packages`` flag is not recognized.
|
||||
@@ -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,
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user