@@ -224,6 +224,52 @@ def test_install_report_local_path_with_extras(
224
224
assert "requested_extras" not in simple_report
225
225
226
226
227
+ @pytest .mark .network
228
+ def test_install_report_editable_local_path_with_extras (
229
+ script : PipTestEnvironment , tmp_path : Path , shared_data : TestData
230
+ ) -> None :
231
+ """Test report remote editable."""
232
+ project_path = tmp_path / "pkga"
233
+ project_path .mkdir ()
234
+ project_path .joinpath ("pyproject.toml" ).write_text (
235
+ textwrap .dedent (
236
+ """\
237
+ [project]
238
+ name = "pkga"
239
+ version = "1.0"
240
+
241
+ [project.optional-dependencies]
242
+ test = ["simple"]
243
+ """
244
+ )
245
+ )
246
+ report_path = tmp_path / "report.json"
247
+ script .pip (
248
+ "install" ,
249
+ "--dry-run" ,
250
+ "--no-build-isolation" ,
251
+ "--no-index" ,
252
+ "--find-links" ,
253
+ str (shared_data .root / "packages/" ),
254
+ "--report" ,
255
+ str (report_path ),
256
+ "--editable" ,
257
+ str (project_path ) + "[test]" ,
258
+ )
259
+ report = json .loads (report_path .read_text ())
260
+ assert len (report ["install" ]) == 2
261
+ pkga_report = report ["install" ][0 ]
262
+ assert pkga_report ["metadata" ]["name" ] == "pkga"
263
+ assert pkga_report ["is_direct" ] is True
264
+ assert pkga_report ["requested" ] is True
265
+ assert pkga_report ["requested_extras" ] == ["test" ]
266
+ simple_report = report ["install" ][1 ]
267
+ assert simple_report ["metadata" ]["name" ] == "simple"
268
+ assert simple_report ["is_direct" ] is False
269
+ assert simple_report ["requested" ] is False
270
+ assert "requested_extras" not in simple_report
271
+
272
+
227
273
def test_install_report_to_stdout (
228
274
script : PipTestEnvironment , shared_data : TestData
229
275
) -> None :
0 commit comments