Skip to content

Commit a96e766

Browse files
authored
Retain credentials for direct URLs in uv export (#13809)
Reverts unintended breaking change from #13560 Test case from #13808
1 parent 63ba5e9 commit a96e766

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

crates/uv-resolver/src/lock/export/requirements_txt.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,14 @@ impl std::fmt::Display for RequirementsTxtExport<'_> {
108108
subdirectory: direct.subdirectory.clone(),
109109
ext: DistExtension::Source(SourceDistExtension::TarGz),
110110
});
111-
write!(f, "{} @ {}", package.id.name, url)?;
111+
write!(
112+
f,
113+
"{} @ {}",
114+
package.id.name,
115+
// TODO(zanieb): We should probably omit passwords here by default, but we
116+
// should change it in a breaking release and allow opt-in to include them.
117+
url.displayable_with_credentials()
118+
)?;
112119
}
113120
Source::Path(path) | Source::Directory(path) => {
114121
if path.is_absolute() {

crates/uv/tests/it/export.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,6 @@ fn requirements_txt_https_git_credentials() -> Result<()> {
11741174
Ok(())
11751175
}
11761176

1177-
#[cfg(feature = "git")]
11781177
#[test]
11791178
fn requirements_txt_https_credentials() -> Result<()> {
11801179
let context = TestContext::new("3.12");
@@ -1197,7 +1196,7 @@ fn requirements_txt_https_credentials() -> Result<()> {
11971196
----- stdout -----
11981197
# This file was autogenerated by uv via the following command:
11991198
# uv export --cache-dir [CACHE_DIR]
1200-
iniconfig @ https://public:****@pypi-proxy.fly.dev/basic-auth/files/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl \
1199+
iniconfig @ https://public:heron@pypi-proxy.fly.dev/basic-auth/files/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl \
12011200
--hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374
12021201
# via project
12031202

0 commit comments

Comments
 (0)