Skip to content

Commit bf78c87

Browse files
authored
correct regression in --skip-lock (#6304)
* correct regression in --skip-lock being passed the lockfile categories for the Pipfile categories and not finding anything.
1 parent 9bfeb8f commit bf78c87

File tree

4 files changed

+47
-2
lines changed

4 files changed

+47
-2
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Features & Improvements
133133
Behavior Changes
134134
----------------
135135

136-
- ``pipenv==3000.0.0`` denotes the first major release of our semver strategy.
136+
- ``pipenv==2024.0.0`` denotes the first major release of our semver strategy.
137137
As much requested, the ``install`` no longer does a complete lock operation. Instead ``install`` follows the same code path as pipenv update (which is upgrade + sync).
138138
This is what most new users expect the behavior to be; it is a behavioral change, a necessary one to make the tool more usable.
139139
Remember that complete lock resolution can be invoked with ``pipenv lock`` just as before. `#6098 <https://github.com/pypa/pipenv/issues/6098>`_

news/6304.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix regression where ``--skip-lock --dev`` was incorrectly searching Lockfile categories ("default", "develop") instead of Pipfile categories ("packages", "dev-packages"), causing packages to not be found.

pipenv/routines/install.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def do_install(
323323

324324
try:
325325
if dev: # Install both develop and default package categories from Pipfile.
326-
pipfile_categories = ["default", "develop"]
326+
pipfile_categories = ["packages", "dev-packages"]
327327
do_install_dependencies(
328328
project,
329329
dev=dev,

tests/integration/test_install_twists.py

+44
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import pytest
66

77
from pipenv.utils.shell import temp_environ
8+
from pipenv.vendor.packaging import version
89

910

1011
@pytest.mark.extras
@@ -527,3 +528,46 @@ def test_no_duplicate_source_on_install(pipenv_instance_private_pypi):
527528
assert updated_source_count == source_count, "No new [[source]] sections should be added"
528529
assert "requests" in p.pipfile["packages"]
529530
assert p.pipfile["packages"]["requests"].get("index") is not None
531+
532+
533+
@pytest.mark.basic
534+
@pytest.mark.install
535+
def test_install_dev_with_skip_lock(pipenv_instance_pypi):
536+
"""Test aws-cdk-lib installation and version verification."""
537+
with pipenv_instance_pypi() as p:
538+
# Create the Pipfile with specified contents
539+
with open(p.pipfile_path, "w") as f:
540+
contents = """
541+
[[source]]
542+
url = "https://pypi.org/simple"
543+
verify_ssl = true
544+
name = "pypi"
545+
546+
[packages]
547+
aws-cdk-lib = "==2.164.1"
548+
549+
[dev-packages]
550+
pytest = "*"
551+
""".strip()
552+
f.write(contents)
553+
554+
# Install dependencies with --skip-lock
555+
c = p.pipenv("install --dev --skip-lock")
556+
assert c.returncode == 0
557+
558+
# Check pip freeze output
559+
c = p.pipenv("run pip freeze")
560+
assert c.returncode == 0
561+
freeze_output = c.stdout.strip()
562+
563+
# Find aws-cdk-lib in pip freeze output and verify version
564+
for line in freeze_output.split('\n'):
565+
if line.startswith('aws-cdk-lib=='):
566+
installed_version = line.split('==')[1]
567+
assert version.parse(installed_version) == version.parse("2.164.1"), \
568+
f"aws-cdk-lib version {installed_version} is to be expected 2.164.1"
569+
break
570+
else:
571+
# This will execute if we don't find aws-cdk-lib in the output
572+
raise AssertionError("aws-cdk-lib not found in pip freeze output")
573+

0 commit comments

Comments
 (0)