GeezerVison is showing github.com — Fix pylock_no_binary to check settings even with --no-config · SocketDev/socket-patch@cecfabd
File treeExpand file treeCollapse file tree Open diff view settings crates/socket-patch-core/src
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: crates/socket-patch-core/src/patch/redirect/mod.rs +4-5Lines changed: 4 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -26365,6 +26365,8 @@ mod python_lock_warning_tests { | 26365 | 26365 | ), | 26366 | 26366 | // `:none:` clears only the values before it. | 26367 | 26367 | (" --no-binary :none: --no-binary six", &[]), | | 26368 | + // `uv pip compile --no-config` skips settings, but sync still applies them. | | 26369 | + (" --no-config", &[("uv.toml", "no-binary = true\n")]), | 26368 | 26370 | ]; | 26369 | 26371 | for (flags, extra) in refusals { | 26370 | 26372 | let result = run(flags, extra); | @@ -26393,10 +26395,8 @@ mod python_lock_warning_tests { | 26393 | 26395 | warning.detail | 26394 | 26396 | ); | 26395 | 26397 | } | 26396 | | - // Another package's flag or setting, no-build, a list turned off by | 26397 | | - // no-binary = false, a uv.toml replacing pyproject's settings, and | 26398 | | - // settings `uv pip compile --no-config` never read leave the wheel | 26399 | | - // installable. | | 26398 | + // Another package's flag or setting, no-build, or a list turned off by | | 26399 | + // no-binary = false leave the wheel installable. | 26400 | 26400 | let wired: &[(&str, &[(&str, &str)])] = &[ | 26401 | 26401 | ("", &[]), | 26402 | 26402 | (" --no-binary idna", &[]), | @@ -26419,7 +26419,6 @@ mod python_lock_warning_tests { | 26419 | 26419 | ), | 26420 | 26420 | ], | 26421 | 26421 | ), | 26422 | | - (" --no-config", &[("uv.toml", "no-binary = true\n")]), | 26423 | 26422 | (" --no-binary :all: --no-binary :none:", &[]), | 26424 | 26423 | // The root's own settings stop the lookup above it. | 26425 | 26424 | ( | |
Collapse file Copy file name to clipboardExpand all lines: crates/socket-patch-core/src/patch/redirect/upstream/uv.rs -3Lines changed: 0 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -737,9 +737,6 @@ pub(crate) fn pylock_no_binary( | 737 | 737 | "the lock's `uv pip compile --no-binary` covers {name}, {consequence}" | 738 | 738 | )); | 739 | 739 | } | 740 | | - if command.contains(&"--no-config") { | 741 | | - return None; | 742 | | - } | 743 | 740 | } | 744 | 741 | let (path, key) = settings_no_binary(settings, &name)?; | 745 | 742 | Some(format!( | |
Collapse file Copy file name to clipboardExpand all lines: crates/socket-patch-core/src/vendor/pypi_lock.rs +4-5Lines changed: 4 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1789,6 +1789,8 @@ mod tests { | 1789 | 1789 | pyproject("[tool.uv]\nno-binary-package = [\"two\"]\n"), | 1790 | 1790 | )), | 1791 | 1791 | ), | | 1792 | + // `uv pip compile --no-config` skips settings, but sync still applies them. | | 1793 | + (" --no-config", Some(("uv.toml", "no-binary = true\n"))), | 1792 | 1794 | ] { | 1793 | 1795 | let Err(error) = load(pylock(flags), config).await else { | 1794 | 1796 | panic!("{flags:?} with {config:?} must refuse"); | @@ -1797,10 +1799,8 @@ mod tests { | 1797 | 1799 | assert!(error.1.starts_with("pylock.toml: "), "{}", error.1); | 1798 | 1800 | assert!(error.1.contains("only from an sdist"), "{}", error.1); | 1799 | 1801 | } | 1800 | | - // Another package's flag or setting, no-build, a list turned off by | 1801 | | - // no-binary = false, a uv.toml that replaces pyproject's settings, | 1802 | | - // and settings `uv pip compile --no-config` never read leave the | 1803 | | - // wheel installable. | | 1802 | + // Another package's flag or setting, no-build, or a list turned off by | | 1803 | + // no-binary = false leave the wheel installable. | 1804 | 1804 | for (flags, config) in [ | 1805 | 1805 | ("", None), | 1806 | 1806 | (" --no-binary six", None), | @@ -1813,7 +1813,6 @@ mod tests { | 1813 | 1813 | "no-binary = false\nno-binary-package = [\"two\"]\n", | 1814 | 1814 | )), | 1815 | 1815 | ), | 1816 | | - (" --no-config", Some(("uv.toml", "no-binary = true\n"))), | 1817 | 1816 | (" --no-binary :all: --no-binary :none:", None), | 1818 | 1817 | ] { | 1819 | 1818 | if let Err(error) = load(pylock(flags), config).await { | |
|