commit: ba8635df588af97ecac7faf48e13ba9f651d8f03 Author: Michał Górny <mgorny <AT> gentoo <DOT> org> AuthorDate: Sat Sep 20 05:08:18 2025 +0000 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> CommitDate: Sat Sep 20 06:02:09 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba8635df
dev-python/uv: Bump to 0.8.19 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> dev-python/uv/Manifest | 1 + dev-python/uv/uv-0.8.19.ebuild | 183 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 184 insertions(+) diff --git a/dev-python/uv/Manifest b/dev-python/uv/Manifest index f32eabbbda14..9ba3c3597421 100644 --- a/dev-python/uv/Manifest +++ b/dev-python/uv/Manifest @@ -10,5 +10,6 @@ DIST uv-0.8.16.gh.tar.gz 4441379 BLAKE2B b7c914a03e8a14fe08de8cdeaaf073efca0a15c DIST uv-0.8.17.gh.tar.gz 4443731 BLAKE2B 747eceb88ef5e2eecbb5a3c827ff11646c6589c33026adc91a07199726cc0be2002c849380c5ce0ea67faea144c41a84c3f74db04d00f274b4c0301309d06d95 SHA512 f8d331fa717fca1ecea0907ac5da483ab1f6ec4a1cdf149549dbbc765353b0e28f47ab472270a52581042260e58c03f8cfead6a315969852d057b030d9b9075e DIST uv-0.8.18-crates.tar.xz 45354832 BLAKE2B 48c0f06f699015f9206fd916027e1346996479ec4665b43ac7b60cb1ca281b0706021b6ef1688e4df6cdb601a3d8e8ada882937e24bde659c4cc51c81ee11b0b SHA512 d2583a283bcb29ab4781fa201677ec7cade1fc3ac2c47b224f3fc23eff31e1ee140cbc5f763bdca5fac983eb25fb74f4d466869023bb49dc9ab423ffadd768af DIST uv-0.8.18.gh.tar.gz 4693782 BLAKE2B 636f45447de3ed21bde705c900b0299b34f106c7b2740478cfe2cdeee1c9fece1250912a908e05e378320918deb809656a61987507fc9741d68f0d2a7c82a929 SHA512 a21e001cc241050c0fa19b1d5629a347e61f1fd3f0854fa855b5a78c2dcd68fcaf1336ce3f769e50430dd279418c644c473002d175ccebc934ee9c0cb4a38c65 +DIST uv-0.8.19.gh.tar.gz 4700498 BLAKE2B 60d0b2b0fc406b9b91502942c71d51d70ad97e33f11aa4787f4c9caccbeddc1d97c3948a57017516918260dfb3904372285aaf2809b376d75d56c1d34f1042a4 SHA512 565825f348422d2247d9bb32d30fc22e00240ac63b271ebb77a67cf7d5ba84de768819b03274194085ff941c742a76e4cc27129922b3db6ea63e58b694e97b59 DIST uv-0.8.6-crates.tar.xz 46208952 BLAKE2B f9557a45fbfaa9d6006f935629130960b5d414cd185d7fbdb1415e7f3875568d07ade946a0b606712e9e2e06e7964bb0fb8318e02e78609899a852ed073b87a6 SHA512 c79fa70a6a670dc2d80efbf0b51942806b2b16ab7b4c63983ab634453ab32142322302bd68ab80f5bcfee08138bca8d04a7d152c76ca5d94bfc40255cab8477b DIST uv-0.8.6.gh.tar.gz 4255911 BLAKE2B 198ed83cb487f25a35957959bca32f98b8f5343712a7a9bbf3f817f189f1ec9c7903fa2e64ec65c9b3e18a469506c942ebb0ca50b39a353dc7e82228386fb69c SHA512 d164488e967364d254bab989933a5faf27c52c91da1bdeb6f3419fce335dfac5d4ea6cd717cac6b05fee9f85605cf21930c3d37119c49a98cb13c53d51ea996d diff --git a/dev-python/uv/uv-0.8.19.ebuild b/dev-python/uv/uv-0.8.19.ebuild new file mode 100644 index 000000000000..1289e88d0271 --- /dev/null +++ b/dev-python/uv/uv-0.8.19.ebuild @@ -0,0 +1,183 @@ +# Copyright 2024-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +CRATES=" +" +RUST_MIN_VER="1.88.0" + +declare -A GIT_CRATES=( + [async_zip]='https://github.com/astral-sh/rs-async-zip;285e48742b74ab109887d62e1ae79e7c15fd4878;rs-async-zip-%commit%' + [pubgrub]='https://github.com/astral-sh/pubgrub;06ec5a5f59ffaeb6cf5079c6cb184467da06c9db;pubgrub-%commit%' + [reqwest-middleware]='https://github.com/astral-sh/reqwest-middleware;7650ed76215a962a96d94a79be71c27bffde7ab2;reqwest-middleware-%commit%/reqwest-middleware' + [reqwest-retry]='https://github.com/astral-sh/reqwest-middleware;7650ed76215a962a96d94a79be71c27bffde7ab2;reqwest-middleware-%commit%/reqwest-retry' + [tl]='https://github.com/astral-sh/tl;6e25b2ee2513d75385101a8ff9f591ef51f314ec;tl-%commit%' + [version-ranges]='https://github.com/astral-sh/pubgrub;06ec5a5f59ffaeb6cf5079c6cb184467da06c9db;pubgrub-%commit%/version-ranges' +) + +inherit cargo check-reqs + +CRATE_PV=0.8.18 +DESCRIPTION="A Python package installer and resolver, written in Rust" +HOMEPAGE=" + https://github.com/astral-sh/uv/ + https://pypi.org/project/uv/ +" +# pypi sdist misses scripts/, needed for tests +SRC_URI=" + https://github.com/astral-sh/uv/archive/${PV}.tar.gz + -> ${P}.gh.tar.gz + ${CARGO_CRATE_URIS} +" +if [[ ${PKGBUMPING} != ${PVR} ]]; then + SRC_URI+=" + https://github.com/gentoo-crate-dist/uv/releases/download/${CRATE_PV}/uv-${CRATE_PV}-crates.tar.xz + " +fi + +# most of the code +LICENSE="|| ( Apache-2.0 MIT )" +# crates/pep508-rs is || ( Apache-2.0 BSD-2 ) which is covered below +# Dependent crate licenses +LICENSE+=" + 0BSD Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD-2 BSD + CDLA-Permissive-2.0 ISC MIT MPL-2.0 Unicode-3.0 Unicode-DFS-2016 + ZLIB +" +# ring crate +LICENSE+=" openssl" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86" +IUSE="test" +RESTRICT="test" +PROPERTIES="test_network" + +DEPEND=" + app-arch/bzip2:= + app-arch/xz-utils:= + app-arch/zstd:= +" +RDEPEND=" + ${DEPEND} +" +BDEPEND=" + test? ( + dev-lang/python:3.9 + dev-lang/python:3.10 + dev-lang/python:3.11 + dev-lang/python:3.12 + dev-lang/python:3.13 + !!~dev-python/uv-0.5.0 + ) +" + +QA_FLAGS_IGNORED="usr/bin/.*" + +check_space() { + local CHECKREQS_DISK_BUILD=3G + use debug && CHECKREQS_DISK_BUILD=9G + check-reqs_pkg_setup +} + +pkg_pretend() { + check_space +} + +pkg_setup() { + check_space + rust_pkg_setup +} + +src_prepare() { + default + + # replace upstream crate substitution with our crate substitution, sigh + local pkg + for pkg in reqwest-middleware reqwest-retry; do + local dep=$(grep "^${pkg}" "${ECARGO_HOME}"/config.toml || die) + sed -i -e "/\[patch\.crates-io\]/,\$s;^${pkg}.*$;${dep};" Cargo.toml || die + done + + # force thin lto, makes build much faster and less memory hungry + # (i.e. makes it possible to actually build uv on 32-bit PPC) + sed -i -e '/lto/s:fat:thin:' Cargo.toml || die + + # enable system libraries where supported + export ZSTD_SYS_USE_PKG_CONFIG=1 + # TODO: unbundle libz-ng-sys, tikv-jemalloc-sys? + + # remove unbundled sources, just in case + find "${ECARGO_VENDOR}"/{bzip2,lzma,zstd}-sys-*/ -name '*.c' -delete || die + + # bzip2-sys requires a pkg-config file + # https://github.com/alexcrichton/bzip2-rs/issues/104 + mkdir "${T}/pkg-config" || die + export PKG_CONFIG_PATH=${T}/pkg-config${PKG_CONFIG_PATH+:${PKG_CONFIG_PATH}} + cat >> "${T}/pkg-config/bzip2.pc" <<-EOF || die + Name: bzip2 + Version: 9999 + Description: + Libs: -lbz2 + EOF +} + +src_configure() { + local myfeatures=( + git + pypi + python + ) + + cargo_src_configure --no-default-features +} + +src_compile() { + cd crates/uv || die + cargo_src_compile +} + +src_test() { + # work around https://github.com/astral-sh/uv/issues/4376 + local -x PATH=${BROOT}/usr/lib/python-exec/python3.12:${PATH} + local -x COLUMNS=100 + local -x PYTHONDONTWRITEBYTECODE= + # fix tests failing because of our config + local -x XDG_CONFIG_DIRS=${T} + + cd crates/uv || die + cargo_src_test --no-fail-fast +} + +src_install() { + cd crates/uv || die + cargo_src_install + + insinto /etc/xdg/uv + newins - uv.toml <<-EOF || die + # These defaults match Fedora, see: + # https://src.fedoraproject.org/rpms/uv/pull-request/18 + + # By default ("automatic"), uv downloads missing Python versions + # automatically and keeps them in the user's home directory. + # Disable that to make downloading opt-in, and especially + # to avoid unnecessarily fetching custom Python when the distro + # package would be preferable. Python builds can still be + # downloaded manually via "uv python install". + # + # https://docs.astral.sh/uv/reference/settings/#python-downloads + python-downloads = "manual" + + # By default ("managed"), uv always prefers self-installed + # Python versions over the system Python, independently + # of versions. Since we generally expect users to use that + # to install old Python versions not in ::gentoo anymore, + # this effectively means that uv would end up preferring very + # old Python versions over the newer ones that are provided + # by the system. Default to using the system versions to avoid + # this counter-intuitive behavior. + # + # https://docs.astral.sh/uv/reference/settings/#python-preference + python-preference = "system" + EOF +}
