summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2026-09-22 10:13:26 +0000
committerCoprDistGit <infra@openeuler.org>2026-09-22 10:13:26 +0000
commitc28acbadc04671bcc8fa2836cf8fcf9a3a8c9f67 (patch)
treefe5713b77dbf9381586b4e0ea069df6289b85929
parente1413a3a5816da71e0b198731ccbab79165a7575 (diff)
automatic import of python-uv-buildopeneuler24.03_LTS_SP3
-rw-r--r--.gitignore2
-rw-r--r--sources2
-rw-r--r--uv-build.spec156
3 files changed, 160 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..2e46fb5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/python-uv-build-0.8.13.tar.gz
+/python-uv-build-vendor.tar.gz
diff --git a/sources b/sources
new file mode 100644
index 0000000..4f6d0ba
--- /dev/null
+++ b/sources
@@ -0,0 +1,2 @@
+be315127d77a1f9929e88f22a579c5f3 python-uv-build-0.8.13.tar.gz
+15478b5598af216bb1676f40eb017c4f python-uv-build-vendor.tar.gz
diff --git a/uv-build.spec b/uv-build.spec
new file mode 100644
index 0000000..52db8ca
--- /dev/null
+++ b/uv-build.spec
@@ -0,0 +1,156 @@
+# uv-build -- the PEP 517 build backend of the uv project.
+#
+# Upstream publishes it as the standalone `uv-build` PyPI package built from
+# crates/uv-build: a small Rust binary plus the pure-Python `uv_build` module
+# that build frontends import and that dispatches to the binary.
+#
+# Source tarball top level directory: %{name}-%{version}
+
+%global pypi_name uv-build
+%global crate uv-build
+
+# The release profile upstream uses carries no DWARF, so the debug info
+# extracted by find-debuginfo is empty and rpmbuild aborts with
+# "Empty %files file debugfiles.list".
+%global debug_package %{nil}
+
+Name: python-%{pypi_name}
+Version: 0.8.13
+Release: 1%{?dist}
+Summary: The uv build backend
+
+License: MIT OR Apache-2.0
+URL: https://github.com/astral-sh/uv
+
+Source0: https://github.com/astral-sh/uv/archive/refs/tags/%{version}/uv-%{version}.tar.gz#/%{name}-%{version}.tar.gz
+Source1: %{name}-vendor.tar.gz
+
+BuildRequires: rust >= 1.86
+BuildRequires: cargo
+BuildRequires: gcc
+BuildRequires: python3-devel
+
+%description
+uv-build is uv's native build backend for pure Python projects. It implements
+the PEP 517 and PEP 660 hooks (build_wheel, build_sdist, build_editable,
+prepare_metadata_for_build_wheel, ...) and is considerably faster than the
+generic pure-Python backends, at the cost of only supporting pure Python code.
+
+The hooks live in a small Rust binary; the uv_build module is a thin Python
+shim that dispatches to it.
+
+
+%package -n python3-%{pypi_name}
+Summary: The uv build backend
+Provides: python3dist(%{pypi_name}) = %{version}
+
+%description -n python3-%{pypi_name}
+uv-build is uv's native build backend for pure Python projects. It implements
+the PEP 517 and PEP 660 hooks (build_wheel, build_sdist, build_editable,
+prepare_metadata_for_build_wheel, ...) and is considerably faster than the
+generic pure-Python backends, at the cost of only supporting pure Python code.
+
+The hooks live in a small Rust binary; the uv_build module is a thin Python
+shim that dispatches to it.
+
+
+%prep
+%autosetup -n %{name}-%{version}
+
+# Unpack the vendored crates: the COPR builders have no network access, so the
+# build has to run against a local replacement of the crate sources.
+# The replacement map was produced by `cargo vendor` on the upstream tree.
+tar -xf %{SOURCE1}
+mkdir -p .cargo
+cat > .cargo/config.toml << 'EOF'
+[source.crates-io]
+replace-with = "vendored-sources"
+
+[source."git+https://github.com/astral-sh/pubgrub?rev=06ec5a5f59ffaeb6cf5079c6cb184467da06c9db"]
+git = "https://github.com/astral-sh/pubgrub"
+rev = "06ec5a5f59ffaeb6cf5079c6cb184467da06c9db"
+replace-with = "vendored-sources"
+
+[source."git+https://github.com/astral-sh/reqwest-middleware?rev=ad8b9d332d1773fde8b4cd008486de5973e0a3f8"]
+git = "https://github.com/astral-sh/reqwest-middleware"
+rev = "ad8b9d332d1773fde8b4cd008486de5973e0a3f8"
+replace-with = "vendored-sources"
+
+[source."git+https://github.com/astral-sh/rs-async-zip?rev=285e48742b74ab109887d62e1ae79e7c15fd4878"]
+git = "https://github.com/astral-sh/rs-async-zip"
+rev = "285e48742b74ab109887d62e1ae79e7c15fd4878"
+replace-with = "vendored-sources"
+
+[source."git+https://github.com/astral-sh/tl.git?rev=6e25b2ee2513d75385101a8ff9f591ef51f314ec"]
+git = "https://github.com/astral-sh/tl.git"
+rev = "6e25b2ee2513d75385101a8ff9f591ef51f314ec"
+replace-with = "vendored-sources"
+
+[source.vendored-sources]
+directory = "vendor/"
+EOF
+
+
+%build
+cargo build --release --offline --locked -p %{crate}
+
+
+%check
+# The upstream Rust test-suite needs network access and test fixtures that are
+# not part of the vendored sources, so it cannot run here. Smoke-test the
+# backend binary instead: `uv-build --help` is upstream's own smoke test.
+%{buildroot}%{_bindir}/%{crate} --help
+
+
+%install
+install -Dpm0755 target/release/%{crate} %{buildroot}%{_bindir}/%{crate}
+
+# uv_build is the pure-Python shim, shipped from crates/%{crate}/python.
+mkdir -p %{buildroot}%{python3_sitelib}/uv_build
+install -pm0644 crates/%{crate}/python/uv_build/__init__.py \
+ crates/%{crate}/python/uv_build/__main__.py \
+ crates/%{crate}/python/uv_build/py.typed \
+ %{buildroot}%{python3_sitelib}/uv_build/
+
+# Upstream builds this project with maturin, which is what normally emits the
+# dist-info directory. Building with cargo directly means emitting that
+# metadata here; it is what makes the distribution visible to
+# importlib.metadata and to the RPM python3dist() dependency generator.
+distinfo=%{buildroot}%{python3_sitelib}/uv_build-%{version}.dist-info
+mkdir -p "$distinfo"
+cat > "$distinfo/METADATA" <<EOF
+Metadata-Version: 2.1
+Name: %{pypi_name}
+Version: %{version}
+Summary: The uv build backend
+License: MIT OR Apache-2.0
+Requires-Python: >=3.8
+EOF
+cat > "$distinfo/WHEEL" <<EOF
+Wheel-Version: 1.0
+Generator: uv-build RPM
+Root-Is-Purelib: false
+EOF
+echo uv_build > "$distinfo/top_level.txt"
+cat > "$distinfo/RECORD" <<EOF
+uv_build/__init__.py,,
+uv_build/__main__.py,,
+uv_build/py.typed,,
+uv_build-%{version}.dist-info/METADATA,,
+uv_build-%{version}.dist-info/WHEEL,,
+uv_build-%{version}.dist-info/top_level.txt,,
+uv_build-%{version}.dist-info/RECORD,,
+EOF
+
+
+%files -n python3-%{pypi_name}
+%license LICENSE-MIT LICENSE-APACHE
+%doc crates/%{crate}/README.md
+%{_bindir}/%{crate}
+%{python3_sitelib}/uv_build/
+%{python3_sitelib}/uv_build-%{version}.dist-info/
+
+
+%changelog
+* Tue Sep 22 2026 Python_Bot <Python_Bot@openeuler.org> - 0.8.13-1
+- Initial package