From 01c8e273239cab403f0727abc78188323cb58006 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Wed, 30 Oct 2024 07:57:08 -0400 Subject: [PATCH 1/4] Try fixing the --system without --deploy flag bug --- pipenv/routines/install.py | 25 +++++++++++++------------ tests/integration/test_install_basic.py | 16 ++++++++++++++++ 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/pipenv/routines/install.py b/pipenv/routines/install.py index 88595856f..50c18405b 100644 --- a/pipenv/routines/install.py +++ b/pipenv/routines/install.py @@ -158,18 +158,19 @@ def handle_lockfile( style="red", ) raise exceptions.DeployException - handle_outdated_lockfile( - project, - packages, - old_hash=old_hash, - new_hash=new_hash, - system=system, - allow_global=allow_global, - skip_lock=skip_lock, - pre=pre, - pypi_mirror=pypi_mirror, - categories=categories, - ) + elif not system: + handle_outdated_lockfile( + project, + packages, + old_hash=old_hash, + new_hash=new_hash, + system=system, + allow_global=allow_global, + skip_lock=skip_lock, + pre=pre, + pypi_mirror=pypi_mirror, + categories=categories, + ) elif not project.lockfile_exists and not skip_lock: handle_missing_lockfile(project, system, allow_global, pre, pypi_mirror) diff --git a/tests/integration/test_install_basic.py b/tests/integration/test_install_basic.py index 9522b6ae1..814088017 100644 --- a/tests/integration/test_install_basic.py +++ b/tests/integration/test_install_basic.py @@ -376,6 +376,22 @@ def test_system_and_deploy_work(pipenv_instance_private_pypi): assert c.returncode == 0 + +@pytest.mark.cli +@pytest.mark.deploy +@pytest.mark.system +def test_system_works(pipenv_instance_pypi): + with pipenv_instance_pypi() as p: + c = p.pipenv("install urllib3") + assert c.returncode == 0 + c = p.pipenv("--rm") + assert c.returncode == 0 + c = subprocess_run(["virtualenv", ".venv"]) + assert c.returncode == 0 + c = p.pipenv("install --system --deploy") + assert c.returncode == 0 + + @pytest.mark.basic @pytest.mark.install def test_install_creates_pipfile(pipenv_instance_pypi): From 8e2d9217491de1c604e09f82119560696620f266 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Wed, 30 Oct 2024 07:59:40 -0400 Subject: [PATCH 2/4] Try fixing the --system without --deploy flag bug --- pipenv/routines/install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipenv/routines/install.py b/pipenv/routines/install.py index 50c18405b..a040a2dd5 100644 --- a/pipenv/routines/install.py +++ b/pipenv/routines/install.py @@ -306,7 +306,7 @@ def do_install( categories=pipfile_categories, skip_lock=skip_lock, ) - if not deploy: + if not (deploy or system): new_packages, _ = handle_new_packages( project, packages, From ff4fd43df49c8a80965f883bf580475fe23f9c1a Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Wed, 30 Oct 2024 08:00:56 -0400 Subject: [PATCH 3/4] Try fixing the --system without --deploy flag bug --- tests/integration/test_install_basic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/test_install_basic.py b/tests/integration/test_install_basic.py index 814088017..cd3437dcd 100644 --- a/tests/integration/test_install_basic.py +++ b/tests/integration/test_install_basic.py @@ -388,7 +388,7 @@ def test_system_works(pipenv_instance_pypi): assert c.returncode == 0 c = subprocess_run(["virtualenv", ".venv"]) assert c.returncode == 0 - c = p.pipenv("install --system --deploy") + c = p.pipenv("install --system") assert c.returncode == 0 From 5cf9dbf7bcd415e91dd4acf5d5b03915cf047c91 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Wed, 30 Oct 2024 08:09:32 -0400 Subject: [PATCH 4/4] add news fragment --- news/6295.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/6295.bugfix.rst diff --git a/news/6295.bugfix.rst b/news/6295.bugfix.rst new file mode 100644 index 000000000..9ea02d770 --- /dev/null +++ b/news/6295.bugfix.rst @@ -0,0 +1 @@ +Fix regression of ``2024.3.0`` when using the ``--system`` flag without ``--deploy`` flag.