@@ -71,3 +71,52 @@ def test_install_vcs_ref_by_commit_hash(pipenv_instance_private_pypi):
71
71
)
72
72
assert "six" in p .pipfile ["packages" ]
73
73
assert "six" in p .lockfile ["default" ]
74
+
75
+
76
+ @pytest .mark .vcs
77
+ @pytest .mark .dev
78
+ @pytest .mark .install
79
+ def test_vcs_dev_package_install (pipenv_instance_pypi ):
80
+ """Ensure VCS packages can be properly installed into dev-packages via --dev flag with existing Pipfile."""
81
+ with pipenv_instance_pypi () as p :
82
+ # Create a Pipfile with some existing packages
83
+ with open (p .pipfile_path , "w" ) as f :
84
+ contents = """
85
+ [[source]]
86
+ url = "https://pypi.org/simple"
87
+ verify_ssl = true
88
+ name = "pypi"
89
+
90
+ [packages]
91
+ six = "*"
92
+
93
+ [dev-packages]
94
+ pytest-xdist = {git = "https://github.com/pytest-dev/pytest-xdist.git", ref = "v3.6.1"}
95
+ """ .strip ()
96
+ f .write (contents )
97
+
98
+ # Install a VCS package with --dev flag
99
+ c = p .pipenv ("install --dev -v" )
100
+ assert c .returncode == 0
101
+
102
+ # Verify package appears in dev-packages in Pipfile
103
+ assert "pytest-xdist" in p .pipfile ["dev-packages" ]
104
+ assert p .pipfile ["dev-packages" ]["pytest-xdist" ]["git" ] == "https://github.com/pytest-dev/pytest-xdist.git"
105
+ assert p .pipfile ["dev-packages" ]["pytest-xdist" ]["ref" ] == "v3.6.1"
106
+
107
+ # Verify package appears in develop section of lockfile
108
+ assert "pytest-xdist" in p .lockfile ["develop" ]
109
+ assert p .lockfile ["develop" ]["pytest-xdist" ]["git" ] == "git+https://github.com/pytest-dev/pytest-xdist.git"
110
+ assert p .lockfile ["develop" ]["pytest-xdist" ]["ref" ] == "4dd2978031eaf7017c84a1cc77667379a2b11c64"
111
+
112
+ # Verify the package is importable
113
+ c = p .pipenv ('run python -c "import xdist"' )
114
+ assert c .returncode == 0
115
+
116
+ # Test that dependencies were also installed correctly
117
+ c = p .pipenv ('run python -c "import execnet"' ) # pytest-xdist depends on execnet
118
+ assert c .returncode == 0
119
+
120
+ # Verify no duplicate entries in default packages
121
+ assert "pytest-xdist" not in p .pipfile .get ("packages" , {})
122
+ assert "pytest-xdist" not in p .lockfile .get ("default" , {})
0 commit comments