commit:     e0aafe5863ec074213133b0c43a179482e519285
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Oct  8 04:44:39 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Oct  8 06:25:42 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e0aafe58

dev-python/uv: Bump to 0.9.0

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/uv/Manifest        |   1 +
 dev-python/uv/uv-0.9.0.ebuild | 183 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 184 insertions(+)

diff --git a/dev-python/uv/Manifest b/dev-python/uv/Manifest
index 3eaa510e6f07..01d1f327badb 100644
--- a/dev-python/uv/Manifest
+++ b/dev-python/uv/Manifest
@@ -21,3 +21,4 @@ DIST uv-0.8.23.gh.tar.gz 4713451 BLAKE2B 
0315ebd13331e1b48a469e6bb0e470db75c0d9d
 DIST uv-0.8.24.gh.tar.gz 4711600 BLAKE2B 
9939b7aff063e5e1e473b162e23e521d73d67d06fa4f2f7d85a267a322f7dcd71c75d08e594a45cb9713d79167e5fa9d4f2d0e64e02085d455c59e4dbc7fe5e6
 SHA512 
202e44296eb16fe9aa0f3f8470b5fa5af3489355462fa1de3544309d81ad3b97ddf8eb76a0f00db15aa07586f4279210a7ed1fe6fc868aa9fcf6f131f425dc99
 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
+DIST uv-0.9.0.gh.tar.gz 4724344 BLAKE2B 
43a8c9d46cb374aa2c6b3f021c2b8f7c38bbadde870eacb0a609a7541d0480ef53d0e73cfd4f54dda902f0a19792211315dc96bd5eb99ccfb687e1440ad6cd95
 SHA512 
f9815a8f79cf8fdb1d892b4407cfe164cd191f78ef17550481e97b6e42626b92a9a06e791205a2448e07a77f0d959ba8933060bddc22a80700f5544c0ad15820

diff --git a/dev-python/uv/uv-0.9.0.ebuild b/dev-python/uv/uv-0.9.0.ebuild
new file mode 100644
index 000000000000..ec686a3659cd
--- /dev/null
+++ b/dev-python/uv/uv-0.9.0.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;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=0.8.23
+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
+}

Reply via email to