dev-python/uv: Bump to 0.11.5

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2026-04-09 06:08:20 +02:00
parent 42a3e58896
commit fac04e8f52
2 changed files with 166 additions and 0 deletions

View File

@@ -8,3 +8,5 @@ DIST uv-0.11.2-crates.tar.xz 46998940 BLAKE2B d3447d8f11e14a01abb7531249a3c5806e
DIST uv-0.11.2.gh.tar.gz 5135705 BLAKE2B abcedb5bbf0ef2c6585580818a7b11046a1555559254c2255a929050a61d3906fe176007ca8d39d0b4a2fc8582ce70376a73b7b6c4856af796056099750ecea1 SHA512 5db8253e1403a21a82c172429f8a2ee336d19a7b1e640942bd8b6a523defa8308f60b035c8ffae40d1de9292a598a5619f36debf5bf7bb3663b1f630e311cfd4
DIST uv-0.11.3-crates.tar.xz 46981748 BLAKE2B be42ea0a2997d23ddbd1e2772c4ad1e7a2ab8866624fa3e8eee31638e65293a5241ae0a3b3c2cecab64250b8e166f548c041145ed840a91e8c90d4d1d79ffcb8 SHA512 99686a97e1f630c396b6e7b282e85b37642b3fefb05233ec0276f4fc8fc297738c600c2348c5f15c5744242dfe121412f0bf2d4339f59b254b02ab9f4612d614
DIST uv-0.11.3.gh.tar.gz 5161685 BLAKE2B 901bb7292d0febd3970ff84913143bc3d31252f6e2bad08ef67bdb3638eb00760b0eea5717f5b5e40e2fd862c065fafe1ac23b57b186434fe5f0899835795c44 SHA512 5694bbb75136052b929356d8a7c66d16af515709a5f68c8d5d0a8353fa51a724677bab16c6288a53d128e95614898444f6ee3cc686bb34817ff15796d4dc46f9
DIST uv-0.11.5-crates.tar.xz 46830584 BLAKE2B 6fbf2c9aa231588833e5cce30da2a9238af8bd22fd849cf45c3ffab52b405bcd6c5b488a9cc6975e09781ce379405c6323d7cb3c330243ae5a7b53efb775d06e SHA512 243e69e5512d09a48d47c76f100dae390e2ea9de51eb4671a9bc84a8fcbbdafe96832b6afc7222185f09f1c11c5aa6a32be9185f723b7dc67e13a94205f759d2
DIST uv-0.11.5.gh.tar.gz 5200922 BLAKE2B 67631c35da46465c324bb3417312be7f5e9f50cafaf7f32b679b282ab4e5997c7ddc3a6a0cba3af138d95c4890475e3055cd6dc0dacf0e42bfa63761b839d766 SHA512 ade88d151b3da1a73dbd43b6b9c27722822f61e7088a53dfc1a073436350705468b37ebd301eaa5ddb2fdcd39978096b2c95180c735bc49c4a07391ca3bd4c09

View File

@@ -0,0 +1,164 @@
# Copyright 2024-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
CRATES="
"
RUST_MIN_VER="1.92.0"
inherit cargo check-reqs
CRATE_PV=${PV}
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 CC0-1.0
CDLA-Permissive-2.0 ISC MIT MPL-2.0 Unicode-3.0 Unicode-DFS-2016
ZLIB BZIP2
"
# ring crate
LICENSE+=" openssl"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~x86"
IUSE="test"
RESTRICT="test"
PROPERTIES="test_network"
DEPEND="
app-arch/bzip2:=
app-arch/xz-utils:=
app-arch/zstd:=
"
RDEPEND="
${DEPEND}
"
BDEPEND="
virtual/pkgconfig
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
# 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
# uv is now forcing bundled liblzma, sigh
sed -i -e '/xz/s:"static"::' Cargo.toml || die
}
src_configure() {
local myfeatures=(
test-git
test-pypi
test-python
)
cargo_src_configure --no-default-features
}
src_compile() {
cd crates/uv || die
cargo_src_compile
}
src_test() {
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
}