%bcond check 1 Name: uv Version: 0.2.32 Release: %autorelease Summary: An extremely fast Python package installer and resolver, written in Rust # The license of the uv project is (MIT OR Apache-2.0), except: # # - crates/pep440-rs/ is vendored and forked from crate(pep440_rs) and is # (Apache-2.0 OR BSD-2-Clause). # - crates/pep508-rs/ is vendored and forked from crate(pep508_rs) and is # (Apache-2.0 OR BSD-2-Clause). # - crates/uv-extract/src/vendor/cloneable_seekable_reader.rs is vendored and # forked from crate(ripunzip) and is (Apache-2.0 OR MIT) # - The function wheel_metadata_from_remote_zip in # crates/uv-client/src/remote_metadata.rs is vendored and forked from the # function lazy_read_wheel_metadata in src/index/lazy_metadata.rs in # crate(rattler_installs_packages) and is BSD-3-Clause AND (Apache-2.0 OR # MIT): the original routine is BSD-3-CLause, and subsequent modifications # are explicitly (Apache-2.0 OR MIT). # - crates/uv-python/packaging/ is vendored and forked from # python3dist(packaging) and is (Apache-2.0 OR BSD-2-Clause). # - crates/uv-virtualenv/src/activator/ is vendored and forked from # python3dist(virtualenv) and is MIT. # Additionally, the following are believed not to contribute to the licenses of # the binary RPMs: # - crates/uv-python/fetch-download-metadata.py is derived from # https://github.com/mitsuhiko/rye/tree/f9822267a7f00332d15be8551f89a212e7bc9017 # which was MIT. # # 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: # - async_zip, Source100, is MIT. # - pubgrub, Source200, is MPL-2.0. # - reqwest-middleware/reqwest-retry, Source300, is (MIT OR Apache-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 ISC OR MIT # Apache-2.0 OR MIT # Apache-2.0 WITH LLVM-exception # Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT # BSD-3-Clause # ISC # ISC AND MIT AND OpenSSL # LGPL-3.0-or-later OR MPL-2.0 # MIT # MIT OR Apache-2.0 # MIT OR Apache-2.0 OR Zlib # MIT OR LGPL-3.0-or-later # MIT OR Zlib OR Apache-2.0 # MIT-0 OR Apache-2.0 # MPL-2.0 # Unlicense OR MIT # Zlib OR Apache-2.0 OR MIT License: %{shrink: 0BSD AND (0BSD OR Apache-2.0 OR MIT) AND Apache-2.0 AND (Apache-2.0 OR BSD-2-Clause) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR ISC OR MIT) AND (Apache-2.0 OR MIT) AND (Apache-2.0 OR MIT OR Zlib) AND (Apache-2.0 OR MIT-0) AND (Apache-2.0 WITH LLVM-exception) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-3-Clause AND ISC AND (LGPL-3.0-or-later OR MIT) AND (LGPL-3.0-or-later OR MPL-2.0) AND MIT AND (MIT OR Unlicense) AND MPL-2.0 AND OpenSSL AND Unicode-DFS-2016 } # LICENSE.dependencies contains a full license breakdown URL: https://github.com/astral-sh/uv Source0: %{url}/archive/%{version}/uv-%{version}.tar.gz # Currently, uv must use a fork of async_zip, as explained in: # Restore central directory buffering # https://github.com/charliermarsh/rs-async-zip/pull/2 # and further discussed in # Please consider supporting the current release of async_zip # https://github.com/prefix-dev/async_http_range_reader/issues/14 # We therefore bundle the fork as prescribed in # https://docs.fedoraproject.org/en-US/packaging-guidelines/Rust/#_replacing_git_dependencies %global async_zip_git https://github.com/charliermarsh/rs-async-zip %global async_zip_rev 011b24604fa7bc223daaad7712c0694bac8f0a87 %global async_zip_baseversion 0.0.17 %global async_zip_snapdate 20240729 Source100: %{async_zip_git}/archive/%{async_zip_rev}/rs-async-zip-%{async_zip_rev}.tar.gz # For the foreseeable future, uv must use a fork of pubgrub, 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 %global pubgrub_git https://github.com/astral-sh/pubgrub %global pubgrub_rev 3f0ba760951ab0deeac874b98bb18fc90103fcf7 %global pubgrub_baseversion 0.2.1 %global pubgrub_snapdate 20240715 Source200: %{pubgrub_git}/archive/%{pubgrub_rev}/pubgrub-%{pubgrub_rev}.tar.gz # Similarly, uv now forks reqwest-middleware/reqwest-retry with an incompatible # change, as described in # https://github.com/astral-sh/uv/commit/4b193194858707795b5b64dd479f65ef22fed312 # See branch: # https://github.com/astral-sh/reqwest-middleware/tree/konsti/add-retries-to-error # The path to no longer bundling these crates is: # Add retries to error message # https://github.com/TrueLayer/reqwest-middleware/pull/159 # See also: https://github.com/astral-sh/uv/issues/5588#issuecomment-2257474183 # For now, we must bundle the fork as prescribed in # https://docs.fedoraproject.org/en-US/packaging-guidelines/Rust/#_replacing_git_dependencies %global reqwest_middleware_git https://github.com/astral-sh/reqwest-middleware %global reqwest_middleware_rev 21ceec9a5fd2e8d6f71c3ea2999078fecbd13cbe %global reqwest_middleware_baseversion 0.3.2 %global reqwest_middleware_snapdate 20240701 %global reqwest_retry_baseversion 0.7.0 Source300: %{reqwest_middleware_git}/archive/%{reqwest_middleware_rev}/reqwest-middleware-%{reqwest_middleware_rev}.tar.gz # Downstream-only: do not override the default allocator # # In https://github.com/astral-sh/uv/pull/399, it was reasonably claimed that # using tikv-jemallocator improved benchmarks by 10%. However, this would # require packaging at least the tikv-jemalloc-sys, tikv-jemalloc-ctl, and # tikv-jemallocator crates, and this is expected to be not quite trivial. # Instead of blocking uv packaging on tikv-jemallocator packaging, we use the # default allocator for now, and reserve tikv-jemallocaator packaging as # optional future work. Patch: 0001-Downstream-only-do-not-override-the-default-allocato.patch # Downstream-only: Always find the system-wide uv executable # See discussion in # Should uv.find_uv_bin() be able to find /usr/bin/uv? # https://github.com/astral-sh/uv/issues/4451 Patch: 0001-Downstream-patch-always-find-the-system-wide-uv-exec.patch # This patch is for the forked, bundled pubsub 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 # This patch is for the forked, bundled reqwest-middleware crate. # # Downstream-only: do not attempt to run doctests from README.md # # This patch is copied from the rust-reqwest-middleware package. It is # justified there as avoiding a circular dependency on rust-reqwest-retry, but # it turns out that running doctests would also require the reqwest-tracing # crate, which we do not bundle (and is, as of this writing, not separately # packaged), so the patch is needed here as well. Patch300: 0001-Downstream-only-do-not-attempt-to-run-doctests-from-.patch # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} BuildRequires: cargo-rpm-macros >= 24 BuildRequires: rust2rpm-helper BuildRequires: tomcli BuildRequires: python3-devel # This is a fork of async_zip; see the notes about Source100. %global async_zip_snapinfo %{async_zip_snapdate}git%{sub %{async_zip_rev} 1 7} %global async_zip_version %{async_zip_baseversion}^%{async_zip_snapinfo} Provides: bundled(crate(async_zip)) = %{async_zip_version} # This is a fork of pubgrub; see the notes about Source200. %global pubgrub_snapinfo %{pubgrub_snapdate}git%{sub %{pubgrub_rev} 1 7} %global pubgrub_version %{pubgrub_baseversion}^%{pubgrub_snapinfo} Provides: bundled(crate(pubgrub)) = %{pubgrub_version} # This is a fork of reqwest-middleware/reqwest-retry; see the notes about # Source300. %global reqwest_middleware_snapinfo %{reqwest_middleware_snapdate}git%{sub %{reqwest_middleware_rev} 1 7} %global reqwest_middleware_version %{reqwest_middleware_baseversion}^%{reqwest_middleware_snapinfo} %global reqwest_retry_version %{reqwest_retry_baseversion}^%{reqwest_middleware_snapinfo} Provides: bundled(crate(reqwest-middleware)) = %{reqwest_middleware_version} Provides: bundled(crate(reqwest-retry)) = %{reqwest_retry_version} # Paths to using published versions of vendored, forked crates? # https://github.com/astral-sh/uv/issues/5588 # 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/pep440-rs/ # Version number from Cargo.toml: Provides: bundled(crate(pep440_rs)) = 0.6.0 # crates/pep508-rs/ # Version number from Cargo.toml: Provides: bundled(crate(pep508_rs)) = 0.6.0 # crates/uv-virtualenv/ # As a whole, this crate is derived from https://github.com/konstin/gourgeist # 0.0.4, which was published as https://crates.io/crates/gourgeist. It looks # looks like the project was subsumed into `uv`, and the link to `uv` at # https://konstin.github.io/gourgeist/ seems to support this, so we consider # this not to be a real case of bundling, and we do not add: # Provides: bundled(crate(gourgeist)) = 0.0.4 # crates/uv-extract/src/vendor/cloneable_seekable_reader.rs # Version number is an educated guess based on comparison of file contents, # cross-checked with timing: the file was first introduced to uv as # crates/puffin-installer/src/vendor/cloneable_seekable_reader.rs in # https://github.com/astral-sh/uv/commit/2a846e76b7725633776fd08e04ce8b827bb0580f # on 2023-10-08, and 0.4.0 was the current release of ripunzip at that time. Provides: bundled(crate(ripunzip)) = 0.4.0 # wheel_metadata_from_remote_zip only, in # crates/uv-client/src/remote_metadata.rs # Version number is, at the time of this writing, the only release of # https://github.com/prefix-dev/rip containing the corresponding function # lazy_read_wheel_metadata in # (crates/rattler_installs_packages/)src/index/lazy_metadata.rs. Provides: bundled(crate(rattler_installs_packages)) = 0.9.0 # The contents of crates/uv-virtualenv/src/activator/ are a bundled and # slightly forked copy of a subset of https://pypi.org/project/virtualenv; see # https://github.com/pypa/virtualenv/tree/main/src/virtualenv/activation. # # The same justification for not attempting to unbundle downstream applies as # for the bundling from python3dist(packaging), below; additionally, some of # the scripts have been forked. See also: # https://github.com/astral-sh/uv/issues/5588#issuecomment-2257474140 # # The scripts were last updated from virtualenv upstream in # https://github.com/astral-sh/uv/pull/3376 on 2024-05-04; the latest # virtualenv release at that time was 20.26.0. Provides: bundled(python3dist(virtualenv)) = 20.26 # The contents of crates/uv-python/python/packaging/ are a bundled copy of a # subset of https://pypi.org/project/packaging. # # This was added in # https://github.com/astral-sh/uv/commit/7964bfbb2bed50a5c7b0650a7b6799a66503a33a, # the commit message of which helps explain the rationale. In part: # # The architecture of uv does not necessarily match that of the python # interpreter. In cross compiling/testing scenarios the operating system can # also mismatch. To solve this, we move arch and os detection to python, # vendoring the relevant pypa/packaging code, preventing mismatches between # what the python interpreter was compiled for and what uv was compiled for. # # We cannot use the system package directly because these Python sources are # compiled into the uv executable, and the binary package does not even depend # on the system Python interpreter. Patching uv to read the sources from the # system package at runtime would be much too extreme for a downstream change. # Copying sources from the system package into the build tree is feasible, but # – especially considering that the sources are not necessarily executed with # the system Python interpreter – the risks of deviating from upstream’s tested # sources would seem to greatly outweigh any possible benefits of such # “build-time unbundling.” We therefore consider this instance of bundling # technically necessary. See also: # https://github.com/astral-sh/uv/issues/5588#issuecomment-2257474140 # # README.md has the bundled commit hash, __init__.py has the version number, # and https://github.com/pypa/packaging/tree/${commit} is the source of the # snapshot date. Provides: bundled(python3dist(packaging)) = 24.1~dev0^20240310gitcc938f9 %global common_description %{expand: An extremely fast Python package installer and resolver, written in Rust. Designed as a drop-in replacement for common pip and pip-tools workflows. Highlights: • ⚖️ Drop-in replacement for common pip, pip-tools, and virtualenv commands. • ⚡️ 10-100x faster than pip and pip-tools (pip-compile and pip-sync). • 💾 Disk-space efficient, with a global cache for dependency deduplication. • 🐍 Installable via curl, pip, pipx, etc. uv is a static binary that can be installed without Rust or Python. • 🧪 Tested at-scale against the top 10,000 PyPI packages. • 🖥️ Support for macOS, Linux, and Windows. • 🧰 Advanced features such as dependency version overrides and alternative resolution strategies. • ⁉️ Best-in-class error messages with a conflict-tracking resolver. • 🤝 Support for a wide range of advanced pip features, including editable installs, Git dependencies, direct URL dependencies, local dependencies, constraints, source distributions, HTML and JSON indexes, and more.} %description %{common_description} %package -n python3-uv Summary: Importable Python module for uv BuildArch: noarch Requires: uv = %{version}-%{release} %description -n python3-uv %{common_description} This package provides an importable Python module for uv. %prep %autosetup -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 Source100: %setup -q -T -D -b 100 -n uv-%{version} # Adding the crate to the workspace (in this case implicitly, by linking it # under crates/) means %%cargo_generate_buildrequires can handle it correctly. ln -s '../../rs-async-zip-%{async_zip_rev}' crates/async_zip git2path workspace.dependencies.async_zip crates/async_zip pushd crates/async_zip %autopatch -p1 -m100 -M199 popd install -t LICENSE.bundled/async_zip -D -p -m 0644 crates/async_zip/LICENSE # Drop dev-dependencies that are only required for compiling the # actix-multipart example, and remove it. Note that while “futures” is in this # section of Cargo.toml, it is in fact also used in a test. tomcli set crates/async_zip/Cargo.toml del dev-dependencies.actix-multipart mv crates/async_zip/examples/actix_multipart.rs{,.disabled} tomcli set crates/async_zip/Cargo.toml del dev-dependencies.actix-web tomcli set crates/async_zip/Cargo.toml del dev-dependencies.derive_more tomcli set crates/async_zip/Cargo.toml del dev-dependencies.uuid # See comments above Source200: %setup -q -T -D -b 200 -n uv-%{version} ln -s '../../pubgrub-%{pubgrub_rev}' crates/pubgrub git2path workspace.dependencies.pubgrub crates/pubgrub pushd crates/pubgrub %autopatch -p1 -m200 -M299 popd install -t LICENSE.bundled/pubgrub -D -p -m 0644 crates/pubgrub/LICENSE # Drop a benchmark-only dev-dependency. tomcli set crates/pubgrub/Cargo.toml del dev-dependencies.criterion # Omit tests requiring varisat; it is not packaged and has significant # dependencies of its own. tomcli set crates/pubgrub/Cargo.toml del dev-dependencies.varisat mv crates/pubgrub/tests/proptest.rs{,.disabled} mv crates/pubgrub/tests/sat_dependency_provider.rs{,.disabled} # See comments above Source300: %setup -q -T -D -b 300 -n uv-%{version} ln -s '../../reqwest-middleware-%{reqwest_middleware_rev}/reqwest-middleware' \ crates/reqwest-middleware pushd crates/reqwest-middleware %autopatch -p1 -m300 -M399 popd install -t LICENSE.bundled/reqwest-middleware -D -p -m 0644 \ crates/reqwest-middleware/LICENSE-* git2path workspace.dependencies.reqwest-middleware crates/reqwest-middleware git2path patch.crates-io.reqwest-middleware crates/reqwest-middleware # These dev-dependencies are not really needed, are not packaged, and do not # appear in the published crates. We remove the unpacked reqwest-tracing source # to demonstrate we are not bundling it. tomcli set crates/reqwest-middleware/Cargo.toml del \ dev-dependencies.reqwest-tracing rm -r '../reqwest-middleware-%{reqwest_middleware_rev}/reqwest-tracing' tomcli set crates/reqwest-middleware/Cargo.toml del dev-dependencies.wiremock ln -s '../../reqwest-middleware-%{reqwest_middleware_rev}/reqwest-retry' \ crates/reqwest-retry install -t LICENSE.bundled/reqwest-retry -D -p -m 0644 \ crates/reqwest-retry/LICENSE-* git2path workspace.dependencies.reqwest-retry crates/reqwest-retry # * It is not practical to run the tests: # * - wiremock is unpackaged, and requires many other unpackaged crates tomcli set crates/reqwest-retry/Cargo.toml del dev-dependencies.wiremock mv crates/reqwest-retry/tests/all/main.rs{,.disabled} # Collect license files of vendored dependencies in the main source archive install -t LICENSE.bundled/packaging -D -p -m 0644 \ crates/uv-python/python/packaging/LICENSE.* install -t LICENSE.bundled/pep440_rs -D -p -m 0644 crates/pep440-rs/License-* install -t LICENSE.bundled/pep508_rs -D -p -m 0644 crates/pep508-rs/License-* install -t LICENSE.bundled/ripunzip -D -p -m 0644 \ crates/uv-extract/src/vendor/LICENSE # The original license text from rattler_installs_packages is present in a # comment, but we want it in a separate file so we can ensure it is present in # the binary RPM. install -d LICENSE.bundled/rattler_installs_packages awk '$2 == "BSD" { out=1 }; $2 == "```" { out=0 }; out' \ crates/uv-client/src/remote_metadata.rs | sed -r 's@^///( |$)@@' | tee LICENSE.bundled/rattler_installs_packages/LICENSE # Similarly for virtualenv. All files in # crates/uv-virtualenv/src/activator/activate/ have the same license text. install -d LICENSE.bundled/virtualenv awk '$1 == "#" { out=1 }; $1 != "#" { out=0; exit }; out' \ crates/uv-virtualenv/src/activator/activate | sed -r 's@^#( |$)@@' | tee LICENSE.bundled/virtualenv/LICENSE # Patch out foreign (e.g. Windows-only) dependencies. Follow symbolic links so # that we also patch the bundled crates we just finished setting up. find -L . -type f -name Cargo.toml -print \ -execdir rust2rpm-helper strip-foreign -o '{}' '{}' ';' # Do not strip the compiled Python module; 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 # Exclude the bench crate from the workspace. We don’t need to build and run # benchmarks, and it brings in unwanted additional dev dependencies. tomcli set Cargo.toml append workspace.exclude crates/bench # The uv-dev crate provides “development utilities for uv,” which should not be # needed here, and it also brings in extra dependencies that we would prefer to # do without. tomcli set Cargo.toml append workspace.exclude crates/uv-dev # Do not enable the brotli feature in the reqwest crate dependency. See: # Is the brotli feature of the reqwest crate actually used/useful in uv? # https://github.com/astral-sh/uv/issues/5283 # and the discussion in: # https://src.fedoraproject.org/rpms/rust-reqwest/pull-request/3 tomcli set Cargo.toml lists delitem --first \ workspace.dependencies.reqwest.features 'brotli' # Do not request static linking of liblzma. tomcli set crates/uv-extract/Cargo.toml lists delitem \ dependencies.xz2.features 'static' # The pypi feature, described as “Introduces a dependency on PyPI,” in practice # controls whether we build and run tests that want to talk to PyPI. In an # offline build, we definitely don’t want that, so we remove it from the # default features. tomcli set crates/uv/Cargo.toml lists delitem features.default 'pypi' # Omit some tests that are not gated with the pypi feature, but require # multiple specific Python interpreter versions (down to patch release number), # which upstream normally downloads, precompiled, into the build area. In many # cases, these tests also require network access. mv crates/uv-client/tests/remote_metadata.rs{,.disabled} mv crates/uv/tests/branching_urls.rs{,.disabled} mv crates/uv/tests/pip_check.rs{,.disabled} mv crates/uv/tests/pip_list.rs{,.disabled} mv crates/uv/tests/pip_show.rs{,.disabled} mv crates/uv/tests/pip_tree.rs{,.disabled} mv crates/uv/tests/pip_uninstall.rs{,.disabled} mv crates/uv/tests/python_dir.rs{,.disabled} mv crates/uv/tests/venv.rs{,.disabled} mv crates/uv/tests/workspace.rs{,.disabled} # Omit tests requiring wiremock; its dependency tree is too large and complex # to consider packaging it right now. The conditional #[cfg(any())] is always # false. sed -r -i 's/^#\[cfg\(test\)\]/#[cfg(any())]\r&/' \ crates/uv-auth/src/middleware.rs tomcli set crates/uv-auth/Cargo.toml del dev-dependencies.wiremock # For unclear reasons, maturin checks for the presence of optional crate # dependencies that correspond to features we have not enabled. We need to # patch out those that are not packaged, an unfortunate but straightforward # hack. See further commentary in %%generate_buildrequires. tomcli set crates/uv/Cargo.toml del dependencies.axoupdater tomcli set crates/uv/Cargo.toml del features.self-update tomcli set crates/uv/Cargo.toml del dependencies.tracing-durations-export # Loosen some version bounds that were aggressively updated upstream by the # renovate bot. We retain this comment and the following example even when # there are currently no dependencies that need to be adjusted. # # # foocrate # # wanted: 0.2.0 # # currently packaged: 0.1.2 # # https://bugzilla.redhat.com/show_bug.cgi?id=1234567 # tomcli set crates/uv/Cargo.toml str dev-dependencies.foocrate.version 0.1.2 # mailparse # wanted: 0.15.0 # currently packaged: 0.14.0 # https://bugzilla.redhat.com/show_bug.cgi?id=2258714 tomcli set Cargo.toml str \ workspace.dependencies.mailparse.version '>=0.14,<0.16' # tracing-tree # wanted: 0.4.0 # currently packaged: 0.3.1 # https://bugzilla.redhat.com/show_bug.cgi?id=2297915 tomcli set Cargo.toml str \ workspace.dependencies.tracing-tree.version '>=0.3.1,<0.5.0' %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. # # Furthermore, if we do not supply -a to %%cargo_generate_buildrequires, then # maturin will fail looking for crates like pyo3 (and will still look for # optional crate dependencies). # # 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 # TODO: Since the --help output interacts well with help2man, use it to # generate man pages: ideally, a man page for each (sub)command # cross-referenced appropriately. (There are many subcommands, and this would # be tedious to do manually.) This should be feasible with the --include option # to help2man and a bit of scripting, but we choose to ship the initial package # without man pages and defer this to a later effort. %install %pyproject_install %pyproject_save_files uv if [ '%{python3_sitearch}' != '%{python3_sitelib}' ] then # Maturin is really designed to build compiled Python extensions, but (when # the uv executable is not bundled in the Python package) the uv Python # library is actually pure-Python, and the python3-uv subpackage can be # noarch. We can’t tell maturin to install to the appropriate site-packages # directory, but we can fix the installation path manually. install -d %{buildroot}%{python3_sitelib} mv %{buildroot}%{python3_sitearch}/uv* %{buildroot}%{python3_sitelib} sed -r -i 's@%{python3_sitearch}@%{python3_sitelib}@' %{pyproject_files} fi # generate and install shell completions target/rpm/uv --generate-shell-completion bash > uv.bash target/rpm/uv --generate-shell-completion fish > uv.fish target/rpm/uv --generate-shell-completion zsh > _uv install -Dpm 0644 uv.bash -t %{buildroot}/%{bash_completions_dir} install -Dpm 0644 uv.fish -t %{buildroot}/%{fish_completions_dir} install -Dpm 0644 _uv -t %{buildroot}/%{zsh_completions_dir} %check %if %{with check} # These tests rely on debug assertions, and fail when tests are compiled in # release mode: # # cargo test -p uv-auth --lib: skip="${skip-} --skip keyring::test::fetch_url_no_host" skip="${skip-} --skip keyring::test::fetch_url_with_no_username" skip="${skip-} --skip keyring::test::fetch_url_with_password" %cargo_test -- -- --exact ${skip-} %endif %pyproject_check_import %files %license LICENSE-APACHE LICENSE-MIT LICENSE.dependencies LICENSE.bundled/ %doc CHANGELOG.md %doc README.md %doc PIP_COMPATIBILITY.md %doc PREVIEW-CHANGELOG.md %{_bindir}/uv # Equivalent to “uv tool run”: %{_bindir}/uvx %{bash_completions_dir}/uv.bash %{fish_completions_dir}/uv.fish %{zsh_completions_dir}/_uv %files -n python3-uv -f %{pyproject_files} %changelog %autochangelog