dev-python/uv: Bump to 0.8.22

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2025-09-24 04:33:04 +02:00
parent 965f1a4f80
commit baa34740d9
2 changed files with 185 additions and 0 deletions

View File

@@ -14,5 +14,7 @@ DIST uv-0.8.18.gh.tar.gz 4693782 BLAKE2B 636f45447de3ed21bde705c900b0299b34f106c
DIST uv-0.8.19.gh.tar.gz 4700498 BLAKE2B 60d0b2b0fc406b9b91502942c71d51d70ad97e33f11aa4787f4c9caccbeddc1d97c3948a57017516918260dfb3904372285aaf2809b376d75d56c1d34f1042a4 SHA512 565825f348422d2247d9bb32d30fc22e00240ac63b271ebb77a67cf7d5ba84de768819b03274194085ff941c742a76e4cc27129922b3db6ea63e58b694e97b59
DIST uv-0.8.20-crates.tar.xz 45310716 BLAKE2B 4fe01bda1fe2c879742433bfedbc459fb9e4387324449722648344f5b17178bf70848b92df9129327ea7fd010c7ae59a222be96b19f5617b871c1f22fe229cf2 SHA512 baa62bd819aaf8499647e1bd65d233cedb29af2cc81154f89983c167158f4fdfed3b74b79a429c773fafba3b54eddffd38e61254e09b3a57149b3fa1419cdf5f
DIST uv-0.8.20.gh.tar.gz 4702175 BLAKE2B ffb1898d1acd59fe9befd2ae2842d133619b9d9ec2e114b5332848b0155ebc065589951363df167f1b2e8dc48fe103fd97da8542a5e1a551d6938635fcb628c5 SHA512 80e6566b8152b5f2eff8f1f8991ed4f62465670aa5a179dc055fa8395968581369ebd9289000b934c28e395b39185ea18d705066016ea969abbbe42985064668
DIST uv-0.8.22-crates.tar.xz 45793452 BLAKE2B ff9678899b1fd3a3d5cc34599ea1631dddd64485cb65506d066db7c960798b1e5bf36ef007fc54ba262d4496f4c87301a51cfc70a854ab3d00b20dbcb68ff1c2 SHA512 6e144acea42db2fd8e3922bb23d42be4fb82706a44a6da66c7bb47d360a53ea90f0b073f23893095a3893a0ca61ea053eee6d878b87bf3664abd601e38c1ec2c
DIST uv-0.8.22.gh.tar.gz 4707422 BLAKE2B f205c01e46f2e638c125f2ce3e97fdcb761e9fdc9993b8cddcb41dc1ccda1785d013c6c30992760f1a0929d1a0bfe30711325e55f9051fb3eb731c284ecfb693 SHA512 625d5bf4a824ed785f819fded89f980e50d7a393a537b8ac4f75f3c1985d51e57e8e982960441029e526ffa09a63781262567c336615444309ffef300d90e1dd
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

View File

@@ -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;d8efd77673c9a90792da9da31b6c0da7ea8a324b;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;d8efd77673c9a90792da9da31b6c0da7ea8a324b;pubgrub-%commit%/version-ranges'
)
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
"
# 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
}