@@ -5188,26 +5188,54 @@ async fn pep_751_https_credentials() -> Result<()> {
51885188#[ test]
51895189fn pep_751_relative_and_absolute_paths ( ) -> Result < ( ) > {
51905190 let context = uv_test:: test_context!( "3.12" ) ;
5191+ let links = context. workspace_root . join ( "test/links" ) ;
5192+ fs_err:: copy (
5193+ links. join ( "ok-1.0.0-py3-none-any.whl" ) ,
5194+ context. temp_dir . child ( "ok-1.0.0-py3-none-any.whl" ) ,
5195+ ) ?;
5196+
5197+ let sdist = context. temp_dir . child ( "basic-package-src" ) ;
5198+ sdist. child ( "pyproject.toml" ) . write_str ( indoc ! { r#"
5199+ [project]
5200+ name = "basic-package"
5201+ version = "0.1.0"
5202+ requires-python = ">=3.12"
5203+
5204+ [build-system]
5205+ requires = ["uv_build>=0.7,<10000"]
5206+ build-backend = "uv_build"
5207+ "# } ) ?;
5208+ sdist. child ( "src/basic_package/__init__.py" ) . touch ( ) ?;
5209+ context
5210+ . build ( )
5211+ . arg ( "--sdist" )
5212+ . arg ( "--out-dir" )
5213+ . arg ( context. temp_dir . path ( ) )
5214+ . arg ( sdist. path ( ) )
5215+ . assert ( )
5216+ . success ( ) ;
51915217
51925218 let pyproject_toml = context. temp_dir . child ( "pyproject.toml" ) ;
51935219 pyproject_toml. write_str ( & formatdoc ! { r#"
51945220 [project]
51955221 name = "a"
51965222 version = "0.1.0"
51975223 requires-python = ">=3.12"
5198- dependencies = ["b", "c"]
5224+ dependencies = ["b", "c", "ok", "basic-package" ]
51995225
52005226 [tool.uv.sources]
52015227 b = {{ path = "b" }}
52025228 c = {{ path = '{}' }}
5229+ ok = {{ path = "ok-1.0.0-py3-none-any.whl" }}
5230+ basic-package = {{ path = "basic_package-0.1.0.tar.gz" }}
52035231
52045232 [build-system]
52055233 requires = ["uv_build>=0.7,<10000"]
52065234 build-backend = "uv_build"
52075235 "# ,
52085236 context. temp_dir. join( "c" ) . display( )
52095237 } ) ?;
5210- context. temp_dir . child ( "a/__init__.py" ) . touch ( ) ?;
5238+ context. temp_dir . child ( "src/ a/__init__.py" ) . touch ( ) ?;
52115239 context
52125240 . temp_dir
52135241 . child ( "b/pyproject.toml" )
@@ -5223,7 +5251,7 @@ fn pep_751_relative_and_absolute_paths() -> Result<()> {
52235251 requires = ["uv_build>=0.7,<10000"]
52245252 build-backend = "uv_build"
52255253 "# } ) ?;
5226- context. temp_dir . child ( "b/b/__init__.py" ) . touch ( ) ?;
5254+ context. temp_dir . child ( "b/src/ b/__init__.py" ) . touch ( ) ?;
52275255 context
52285256 . temp_dir
52295257 . child ( "c/pyproject.toml" )
@@ -5239,7 +5267,7 @@ fn pep_751_relative_and_absolute_paths() -> Result<()> {
52395267 requires = ["uv_build>=0.7,<10000"]
52405268 build-backend = "uv_build"
52415269 "# } ) ?;
5242- context. temp_dir . child ( "c/c/__init__.py" ) . touch ( ) ?;
5270+ context. temp_dir . child ( "c/src/ c/__init__.py" ) . touch ( ) ?;
52435271
52445272 context. lock ( ) . assert ( ) . success ( ) ;
52455273
@@ -5261,14 +5289,68 @@ fn pep_751_relative_and_absolute_paths() -> Result<()> {
52615289 name = "b"
52625290 directory = { path = "b", editable = false }
52635291
5292+ [[packages]]
5293+ name = "basic-package"
5294+ version = "0.1.0"
5295+ archive = { path = "basic_package-0.1.0.tar.gz", hashes = { sha256 = "0692ad37b19e73fd2f411fbc1590ed9c1f39a1d9f31e132ba07e4e3f945160af" } }
5296+
52645297 [[packages]]
52655298 name = "c"
52665299 directory = { path = "[TEMP_DIR]/c", editable = false }
52675300
5301+ [[packages]]
5302+ name = "ok"
5303+ version = "1.0.0"
5304+ archive = { path = "ok-1.0.0-py3-none-any.whl", hashes = { sha256 = "79f0b33e6ce1e09eaa1784c8eee275dfe84d215d9c65c652f07c18e85fdaac5f" } }
5305+
52685306 ----- stderr -----
5269- Resolved 3 packages in [TIME]
5307+ Resolved 5 packages in [TIME]
52705308 "# ) ;
52715309
5310+ uv_snapshot ! ( context. filters( ) , context. export( ) . arg( "-o" ) . arg( "locks/pylock.toml" ) , @r#"
5311+ success: true
5312+ exit_code: 0
5313+ ----- stdout -----
5314+ # This file was autogenerated by uv via the following command:
5315+ # uv export --cache-dir [CACHE_DIR] -o locks/pylock.toml
5316+ lock-version = "1.0"
5317+ created-by = "uv"
5318+ requires-python = ">=3.12"
5319+
5320+ [[packages]]
5321+ name = "a"
5322+ directory = { path = "../", editable = true }
5323+
5324+ [[packages]]
5325+ name = "b"
5326+ directory = { path = "../b", editable = false }
5327+
5328+ [[packages]]
5329+ name = "basic-package"
5330+ version = "0.1.0"
5331+ archive = { path = "../basic_package-0.1.0.tar.gz", hashes = { sha256 = "0692ad37b19e73fd2f411fbc1590ed9c1f39a1d9f31e132ba07e4e3f945160af" } }
5332+
5333+ [[packages]]
5334+ name = "c"
5335+ directory = { path = "[TEMP_DIR]/c", editable = false }
5336+
5337+ [[packages]]
5338+ name = "ok"
5339+ version = "1.0.0"
5340+ archive = { path = "../ok-1.0.0-py3-none-any.whl", hashes = { sha256 = "79f0b33e6ce1e09eaa1784c8eee275dfe84d215d9c65c652f07c18e85fdaac5f" } }
5341+
5342+ ----- stderr -----
5343+ Resolved 5 packages in [TIME]
5344+ "# ) ;
5345+
5346+ context
5347+ . pip_install ( )
5348+ . arg ( "--preview" )
5349+ . arg ( "-r" )
5350+ . arg ( "locks/pylock.toml" )
5351+ . assert ( )
5352+ . success ( ) ;
5353+
52725354 Ok ( ( ) )
52735355}
52745356
0 commit comments