public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/uv] epel10: Improved patch for dirhash tests
@ 2026-09-04  6:17 Benjamin A. Beasley
  0 siblings, 0 replies; only message in thread
From: Benjamin A. Beasley @ 2026-09-04  6:17 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/uv
Branch : epel10
Commit : 260caad5b272f5103dcbe17e8532fee11e3d3f47
Author : Benjamin A. Beasley <code@musicinmybrain.net>
Date   : 2026-09-04T07:17:12+01:00
Stats  : +81/-37 in 3 file(s)
URL    : https://src.fedoraproject.org/rpms/uv/c/260caad5b272f5103dcbe17e8532fee11e3d3f47?branch=epel10

Log:
Improved patch for dirhash tests

---
diff --git a/21433.patch b/21433.patch
deleted file mode 100644
index 8d08429..0000000
--- a/21433.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 37b12e28bfa28593e477444467a571bda0656741 Mon Sep 17 00:00:00 2001
-From: "Benjamin A. Beasley" <code@musicinmybrain.net>
-Date: Thu, 3 Sep 2026 06:28:52 +0100
-Subject: [PATCH] Gate dirhash::tests::test_vectors_json on test-pypi feature
-
----
- crates/uv-extract/Cargo.toml     | 1 +
- crates/uv-extract/src/dirhash.rs | 1 +
- 2 files changed, 2 insertions(+)
-
-diff --git a/crates/uv-extract/Cargo.toml b/crates/uv-extract/Cargo.toml
-index abd7bbb9895..7df1a21412f 100644
---- a/crates/uv-extract/Cargo.toml
-+++ b/crates/uv-extract/Cargo.toml
-@@ -53,6 +53,7 @@ serde_json = { workspace = true }
- 
- [features]
- default = []
-+test-pypi = []
- 
- [package.metadata.cargo-shear]
- # NOTE: `async-compression` owns the actual Deflate codec, but we need to
-diff --git a/crates/uv-extract/src/dirhash.rs b/crates/uv-extract/src/dirhash.rs
-index 76a0300ca51..ad0ce9b78f2 100644
---- a/crates/uv-extract/src/dirhash.rs
-+++ b/crates/uv-extract/src/dirhash.rs
-@@ -804,6 +804,7 @@ mod tests {
-         dirhash: String,
-     }
- 
-+    #[cfg(feature = "test-pypi")]
-     // `../test_vectors/test_vectors.json` contains a series of input trees and hashes, which is
-     // generated by `cargo dev generate-dirhash-test-vectors`. This tests both `dirhash_path` and
-     // `DirhashTree` from this file, and also the `dirhash.py` Python implementation, so we're

diff --git a/21434.patch b/21434.patch
new file mode 100644
index 0000000..8a43884
--- /dev/null
+++ b/21434.patch
@@ -0,0 +1,78 @@
+From 9ded1ff23cb5d9c78c615ab0bb026942fac5d128 Mon Sep 17 00:00:00 2001
+From: Charlie Marsh <charlie.r.marsh@gmail.com>
+Date: Thu, 3 Sep 2026 07:24:08 -0400
+Subject: [PATCH] Remove Python invocation from dirhash tests
+
+---
+ crates/uv-extract/src/dirhash.rs          | 27 +++--------------------
+ crates/uv-extract/test_vectors/dirhash.py |  5 +----
+ 2 files changed, 4 insertions(+), 28 deletions(-)
+
+diff --git a/crates/uv-extract/src/dirhash.rs b/crates/uv-extract/src/dirhash.rs
+index 76a0300ca51..943e13bd1fb 100644
+--- a/crates/uv-extract/src/dirhash.rs
++++ b/crates/uv-extract/src/dirhash.rs
+@@ -519,7 +519,6 @@ mod tests {
+ 
+     use super::*;
+     use std::cmp;
+-    use std::process::Command;
+     use std::task::{Context, Poll};
+ 
+     #[test]
+@@ -806,10 +805,9 @@ mod tests {
+ 
+     // `../test_vectors/test_vectors.json` contains a series of input trees and hashes, which is
+     // generated by `cargo dev generate-dirhash-test-vectors`. This tests both `dirhash_path` and
+-    // `DirhashTree` from this file, and also the `dirhash.py` Python implementation, so we're
+-    // testing that three different implementations agree.
+-    #[tokio::test]
+-    async fn test_vectors_json() -> anyhow::Result<()> {
++    // `DirhashTree` against the committed hashes.
++    #[test]
++    fn test_vectors_json() -> anyhow::Result<()> {
+         let test_vectors: Vec<JsonTestVector> =
+             serde_json::from_str(include_str!("../test_vectors/test_vectors.json"))?;
+         for JsonTestVector { input, dirhash } in &test_vectors {
+@@ -828,25 +826,6 @@ mod tests {
+                 dirhash.as_str(),
+                 dirhash_path(tempdir.path())?.to_hex().as_str(),
+             );
+-
+-            // Check the Python implementation, which also reads the FS.
+-            let python_script = Path::new(env!("CARGO_MANIFEST_DIR"))
+-                .join("test_vectors")
+-                .join("dirhash.py");
+-            let output = Command::new("uv")
+-                .args(["run", "--locked", "--script"])
+-                .arg(python_script)
+-                .arg(tempdir.path())
+-                .output()?;
+-            assert!(output.status.success());
+-            // This script's output is formatted like `md5sum` or `b3sum`, with each line including
+-            // a hash, a couple spaces, and a path. With only one path arg, there will be only one
+-            // line.
+-            let python_dirhash = std::str::from_utf8(&output.stdout)?
+-                .split_whitespace()
+-                .next()
+-                .unwrap();
+-            assert_eq!(dirhash.as_str(), python_dirhash);
+         }
+         Ok(())
+     }
+diff --git a/crates/uv-extract/test_vectors/dirhash.py b/crates/uv-extract/test_vectors/dirhash.py
+index fde1339670e..73ef480ca8a 100755
+--- a/crates/uv-extract/test_vectors/dirhash.py
++++ b/crates/uv-extract/test_vectors/dirhash.py
+@@ -10,10 +10,7 @@
+ # exclude-newer = "P7D"
+ # ///
+ 
+-"""Independent Python implementation of ``uv_extract::dirhash``.
+-
+-The Rust ``test_vectors_json`` test case exercises this implementation in CI.
+-"""
++"""Independent Python implementation of ``uv_extract::dirhash``."""
+ 
+ import sys
+ from pathlib import Path

diff --git a/uv.spec b/uv.spec
index 8ca2e5a..4d1e30d 100644
--- a/uv.spec
+++ b/uv.spec
@@ -160,9 +160,9 @@ Patch:          uv-0.12.1-revert-blake2-beta.patch
 # Add license texts for new contents of test/ecosystem/ from PR#20068
 # https://github.com/astral-sh/uv/pull/20174
 Patch:          %{url}/pull/20174.patch
-# Gate dirhash::tests::test_vectors_json on test-pypi feature
-# https://github.com/astral-sh/uv/pull/21433
-Patch:          %{url}/pull/21433.patch
+# Remove Python invocation from dirhash tests
+# https://github.com/astral-sh/uv/pull/21434
+Patch:          %{url}/pull/21434.patch
 
 # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
 ExcludeArch:    %{ix86}

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-04  6:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-04  6:17 [rpms/uv] epel10: Improved patch for dirhash tests Benjamin A. Beasley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox