public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-uv-build] epel10: Initial package (close RHBZ#2357473)
@ 2026-08-16  7:54 Benjamin A. Beasley
  0 siblings, 0 replies; only message in thread
From: Benjamin A. Beasley @ 2026-08-16  7:54 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/python-uv-build
Branch : epel10
Commit : 6c4e89505024dcaf2ab2d09cf568e1a3e2b761f1
Author : Benjamin A. Beasley <code@musicinmybrain.net>
Date   : 2025-04-04T15:51:43-04:00
Stats  : +336/-0 in 5 file(s)
URL    : https://src.fedoraproject.org/rpms/python-uv-build/c/6c4e89505024dcaf2ab2d09cf568e1a3e2b761f1?branch=epel10

Log:
Initial package (close RHBZ#2357473)

---
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..31e75bd
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/pubgrub-b70cf707aa43f21b32f3a61b8a0889b15032d5c4.tar.gz
+/uv_build-0.6.12.tar.gz

diff --git a/0001-Downstream-only-Revert-feat-ensure-successful-round-.patch b/0001-Downstream-only-Revert-feat-ensure-successful-round-.patch
new file mode 100644
index 0000000..dfd8c23
--- /dev/null
+++ b/0001-Downstream-only-Revert-feat-ensure-successful-round-.patch
@@ -0,0 +1,85 @@
+From 2dafc904c3578d6f822cf4106b0e09d3086eac27 Mon Sep 17 00:00:00 2001
+From: "Benjamin A. Beasley" <code@musicinmybrain.net>
+Date: Thu, 23 May 2024 14:45:49 -0400
+Subject: [PATCH] Downstream-only: Revert "feat: ensure successful round-trip
+ of RON (#193)"
+
+This reverts commit 21c6a215432fea9a75b7d15d9a9936af9ccc17cb.
+
+We will not be packaging an alpha version of rust-ron.
+---
+ Cargo.lock                |  5 ++---
+ Cargo.toml                |  2 +-
+ version-ranges/Cargo.toml |  2 +-
+ version-ranges/src/lib.rs | 10 ----------
+ 4 files changed, 4 insertions(+), 15 deletions(-)
+
+diff --git a/Cargo.lock b/Cargo.lock
+index b3d912a..a6c2eae 100644
+--- a/Cargo.lock
++++ b/Cargo.lock
+@@ -730,15 +730,14 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
+ 
+ [[package]]
+ name = "ron"
+-version = "0.9.0-alpha.1"
++version = "0.8.1"
+ source = "registry+https://github.com/rust-lang/crates.io-index"
+-checksum = "7644a2a539ff7fa991c8f4652373cd722d387e39229415103243914249730836"
++checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94"
+ dependencies = [
+  "base64",
+  "bitflags",
+  "serde",
+  "serde_derive",
+- "unicode-ident",
+ ]
+ 
+ [[package]]
+diff --git a/Cargo.toml b/Cargo.toml
+index 2424d96..3705919 100644
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -36,7 +36,7 @@ version-ranges = { version = "0.1.0", path = "version-ranges" }
+ criterion = { version = "2.7.2", package = "codspeed-criterion-compat" }
+ env_logger = "0.11.6"
+ proptest = "1.6.0"
+-ron = "=0.9.0-alpha.1"
++ron = "=0.8.1"
+ varisat = "0.2.2"
+ version-ranges = { version = "0.1.0", path = "version-ranges", features = ["proptest"] }
+ 
+diff --git a/version-ranges/Cargo.toml b/version-ranges/Cargo.toml
+index ffe68d1..7cf5e26 100644
+--- a/version-ranges/Cargo.toml
++++ b/version-ranges/Cargo.toml
+@@ -18,4 +18,4 @@ serde = ["dep:serde", "smallvec/serde"]
+ 
+ [dev-dependencies]
+ proptest = "1.6.0"
+-ron = "=0.9.0-alpha.1"
++ron = "0.8.1"
+diff --git a/version-ranges/src/lib.rs b/version-ranges/src/lib.rs
+index aac7c94..d28984a 100644
+--- a/version-ranges/src/lib.rs
++++ b/version-ranges/src/lib.rs
+@@ -1210,16 +1210,6 @@ pub mod tests {
+ 
+     proptest! {
+ 
+-        // Testing serde ----------------------------------
+-
+-        #[cfg(feature = "serde")]
+-        #[test]
+-        fn serde_round_trip(range in proptest_strategy()) {
+-            let s = ron::ser::to_string(&range).unwrap();
+-            let r = ron::de::from_str(&s).unwrap();
+-            assert_eq!(range, r);
+-        }
+-
+         // Testing negate ----------------------------------
+ 
+         #[test]
+-- 
+2.48.1
+

diff --git a/python-uv-build.rpmlintrc b/python-uv-build.rpmlintrc
new file mode 100644
index 0000000..f2a1050
--- /dev/null
+++ b/python-uv-build.rpmlintrc
@@ -0,0 +1,8 @@
+# Output of uv-build --help:
+#   uv_build contains only the PEP 517 build backend for uv and can't be used
+#   on the CLI. Use `uv build` or another build frontend instead.
+# Therefore, it does not make sense to package a man page.
+addFilter(r" no-manual-page-for-binary uv-build$")
+# Some licenses in LICENSE.bundled have the same text. It is not straighforward
+# to hardlink them, and the amount of wasted space is small.
+addFilter(r" files-duplicate( \S+/LICENSE\.bundled/\S+)+$")

diff --git a/python-uv-build.spec b/python-uv-build.spec
new file mode 100644
index 0000000..140e050
--- /dev/null
+++ b/python-uv-build.spec
@@ -0,0 +1,239 @@
+%bcond check 1
+
+Name:           python-uv-build
+Version:        0.6.12
+Release:        %autorelease
+Summary:        The uv build backend
+
+# The license of the uv project is (MIT OR Apache-2.0), except:
+#
+# Apache-2.0 OR BSD-2-Clause:
+#   - crates/uv-pep440/ is vendored and forked from crate(pep440_rs)
+#   - crates/uv-pep508/ is vendored and forked from crate(pep508_rs)
+#
+# Rust crates compiled into the executable contribute additional license terms.
+# To obtain the following list of licenses, build the package and note the
+# output of %%{cargo_license_summary}. This should automatically include the
+# licenses of the following bundled forks:
+#   - pubgrub/version-ranges, Source200, is MPL-2.0.
+#
+# (Apache-2.0 OR MIT) AND BSD-3-Clause
+# (MIT OR Apache-2.0) AND Unicode-DFS-2016
+# 0BSD
+# 0BSD OR MIT OR Apache-2.0
+# Apache-2.0
+# Apache-2.0 OR BSD-2-Clause
+# Apache-2.0 OR BSL-1.0
+# Apache-2.0 OR MIT
+# Apache-2.0 OR MIT OR Zlib
+# Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT
+# BSL-1.0
+# MIT
+# MIT OR Apache-2.0
+# MIT OR Apache-2.0 OR Zlib
+# MIT OR Zlib OR Apache-2.0
+# MIT-0 OR Apache-2.0
+# MPL-2.0
+# Unlicense OR MIT
+# Zlib
+# Zlib OR Apache-2.0 OR MIT
+License:        %{shrink:
+                (Apache-2.0 OR MIT) AND
+                (Apache-2.0 OR BSD-2-Clause) AND
+                MPL-2.0
+                }
+%global extra_crate_licenses %{shrink:
+                0BSD AND
+                (0BSD OR MIT OR Apache-2.0) AND
+                Apache-2.0 AND
+                (Apache-2.0 OR BSL-1.0) AND
+                (Apache-2.0 OR MIT OR Zlib) AND
+                (Apache-2.0 OR MIT-0)
+                (Apache-2.0 OR Apache-2.0 WITH LLVM-exception OR MIT) AND
+                BSD-3-Clause AND
+                BSL-1.0 AND
+                MIT AND
+                (MIT OR Unlicense) AND
+                Unicode-DFS-2016 AND
+                Zlib
+                }
+URL:            https://pypi.org/project/uv-build
+Source:         %{pypi_source uv_build}
+
+# This package is ultimately built from the same source tree as uv, i.e.
+# https://github.com/astral-sh/uv, and belongs to the same cargo workspace.
+#
+# The PyPI sdist includes a small subset of the same workspace crates as uv.
+# (Note that these are not published on crates.io, and are neither intended for
+# separate distribution nor suitable for separate packaging.)
+#
+# We choose not to build uv-build from the uv source package because this spec
+# file can be much simpler than the one for uv, because the separation helps to
+# keep track of which patches, licenses, additional sources, etc. apply to
+# uv-build, and because – while it normally makes sense to synchronize updates
+# of this package with uv updates – there will likely be times when we want to
+# keep updating uv (primarily a developer tool) while holding uv-build
+# (primarily used for building packages) at an older version for compatibility.
+
+# For the foreseeable future, uv must use a fork of pubgrub (and the
+# version-ranges crate, which belongs to the same project), as explained in:
+#   Plans for eventually using published pubgrub?
+#   https://github.com/astral-sh/uv/issues/3794
+# We therefore bundle the fork as prescribed in
+#   https://docs.fedoraproject.org/en-US/packaging-guidelines/Rust/#_replacing_git_dependencies
+# Note that uv-build currently only uses version-ranges, not pubgrub.
+%global pubgrub_git https://github.com/astral-sh/pubgrub
+%global pubgrub_rev b70cf707aa43f21b32f3a61b8a0889b15032d5c4
+%global pubgrub_snapdate 20250202
+%global version_ranges_baseversion 0.1.1
+Source200:      %{pubgrub_git}/archive/%{pubgrub_rev}/pubgrub-%{pubgrub_rev}.tar.gz
+
+# This patch is for the forked, bundled pubgrub crate.
+#
+# Downstream-only: Revert "feat: ensure successful round-trip of RON (#193)"
+#   This reverts commit 21c6a215432fea9a75b7d15d9a9936af9ccc17cb.
+# We will not be packaging an alpha version of rust-ron. We can adjust this
+# after ron 0.9.x is released.
+Patch200:       0001-Downstream-only-Revert-feat-ensure-successful-round-.patch
+
+# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
+# Also, there are a couple of test failures on 32-bit platforms.
+ExcludeArch:   %{ix86}
+
+BuildRequires:  python3-devel
+BuildRequires:  tomcli
+BuildRequires:  cargo-rpm-macros >= 24
+BuildRequires:  rust2rpm-helper
+
+%global common_description %{expand:
+This package is a slimmed down version of uv containing only the build
+backend.}
+
+%description
+%{common_description}
+
+
+%package -n     python3-uv-build
+Summary:        %{summary}
+License:        %{license} AND %{extra_crate_licenses}
+# LICENSE.dependencies contains a full license breakdown
+
+# This is a fork of pubgrub/version-ranges; see the notes about Source200.
+%global pubgrub_snapinfo %{pubgrub_snapdate}git%{sub %{pubgrub_rev} 1 7}
+%global version_ranges_version %{version_ranges_baseversion}^%{pubgrub_snapinfo}
+Provides:       bundled(crate(version-ranges)) = %{version_ranges_version}
+
+# In https://github.com/astral-sh/uv/issues/5588#issuecomment-2257823242,
+# upstream writes “These have diverged significantly and the upstream versions
+# are only passively maintained, uv requires these custom versions and can't
+# use a system copy.”
+#
+# crates/uv-pep440/
+# Version number from Cargo.toml:
+Provides:       bundled(crate(pep440_rs)) = 0.7.0
+# crates/uv-pep508/
+# Cargo.toml has 0.6.0, but Changelog.md shows 0.7.0, and the source reflects
+# the changes for 0.7.0:
+Provides:       bundled(crate(pep508_rs)) = 0.7.0
+
+%description -n python3-uv-build
+%{common_description}
+
+
+%prep
+%autosetup -n uv_build-%{version} -N
+%autopatch -p1 -M99
+
+# Usage: git2path SELECTOR PATH
+# Replace a git dependency with a path dependency in Cargo.toml
+git2path() {
+  tomcli set Cargo.toml del "${1}.git"
+  tomcli set Cargo.toml del "${1}.rev"
+  tomcli set Cargo.toml str "${1}.path" "${2}"
+}
+
+# See comments above Source200:
+%setup -q -T -D -b 200 -n uv_build-%{version}
+pushd '../pubgrub-%{pubgrub_rev}/'
+%autopatch -p1 -m200 -M299
+popd
+ln -s '../../pubgrub-%{pubgrub_rev}/version-ranges' crates/version-ranges
+# Convert the symlinked LICENSE in version-ranges to a regular file, since we
+# will be removing top-level files from pubgrub.
+rm -v crates/version-ranges/LICENSE
+cp -p '../pubgrub-%{pubgrub_rev}/LICENSE' crates/version-ranges/
+# Prove that we do not use the pubgrub crate by removing everything except the
+# version-ranges subdirectory.
+find '../pubgrub-%{pubgrub_rev}/' -mindepth 1 -maxdepth 1 \
+    ! -name 'version-ranges' -execdir rm -rv '{}' '+'
+# Note that install does always dereference symlinks, which is what we want:
+install -t LICENSE.bundled/version-ranges -D -p -m 0644 \
+    crates/version-ranges/LICENSE
+git2path workspace.dependencies.version-ranges crates/version-ranges
+
+# Collect license files of vendored dependencies in the main source archive
+install -t LICENSE.bundled/pep440_rs -D -p -m 0644 crates/uv-pep440/License-*
+install -t LICENSE.bundled/pep508_rs -D -p -m 0644 crates/uv-pep508/License-*
+
+# Patch out foreign (e.g. Windows-only) dependencies.
+find . -type f -name Cargo.toml -print \
+    -execdir rust2rpm-helper strip-foreign -o '{}' '{}' ';'
+
+# Do not strip the compiled executable; we need useful debuginfo. Upstream set
+# this intentionally, so this change makes sense to keep downstream-only.
+tomcli set pyproject.toml false tool.maturin.strip
+tomcli set Cargo.toml false profile.release.strip
+
+%cargo_prep
+
+
+%generate_buildrequires
+# For unclear reasons, maturin checks for all crate dependencies when it is
+# invoked as part of %%pyproject_buildrequires – including those corresponding
+# to optional features.
+#
+# Since maturin always checks for dev-dependencies, we need -t so that they are
+# generated even when the “check” bcond is disabled.
+%cargo_generate_buildrequires -a -t
+%pyproject_buildrequires
+
+
+%build
+%pyproject_wheel
+
+%cargo_license_summary
+%{cargo_license} > LICENSE.dependencies
+
+
+%install
+%pyproject_install
+%pyproject_save_files -l uv_build
+
+
+%check
+%pyproject_check_import
+%if %{with check}
+# These tests require files from scripts/packages/built-by-uv/, which are not
+# included in the sdist.
+skip="${skip-} --skip tests::built_by_uv_building"
+skip="${skip-} --skip wheel::test::test_prepare_metadata"
+
+%cargo_test -- -- --exact ${skip-}
+%endif
+
+
+%files -n python3-uv-build -f %{pyproject_files}
+# The main license files, LICENSE-APACHE and LICENSE-MIT, are already in the
+# .dist-info directory. However, we still need to include these manually:
+%license LICENSE.dependencies LICENSE.bundled/
+%doc README.md
+
+%{_bindir}/uv-build
+# Output of uv-build --help:
+#   uv_build contains only the PEP 517 build backend for uv and can't be used
+#   on the CLI. Use `uv build` or another build frontend instead.
+# Therefore, it does not make sense to package a man page.
+
+
+%changelog
+%autochangelog

diff --git a/sources b/sources
new file mode 100644
index 0000000..7967bff
--- /dev/null
+++ b/sources
@@ -0,0 +1,2 @@
+SHA512 (pubgrub-b70cf707aa43f21b32f3a61b8a0889b15032d5c4.tar.gz) = 401ea5ca16e978d5407a1400e4e27cec9fcac11332067ee1ed8a3bc511901e08fc421ce875ebbb0990593ed549a4a5f4620914a71ae3490c7b8ae0f7b26b5937
+SHA512 (uv_build-0.6.12.tar.gz) = 8e12d65fee9e57d307864e475443f07d04492b400d36d80867644e25facc4fbb54b13ea6045bbd4dc2d74309281a299e265511c54c747174df08e0e23c1969db

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

only message in thread, other threads:[~2026-08-16  7:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-16  7:54 [rpms/python-uv-build] epel10: Initial package (close RHBZ#2357473) 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