summaryrefslogtreecommitdiff
path: root/dev-python/uv
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/uv')
-rw-r--r--dev-python/uv/Manifest2
-rw-r--r--dev-python/uv/uv-0.13.1.ebuild151
2 files changed, 153 insertions, 0 deletions
diff --git a/dev-python/uv/Manifest b/dev-python/uv/Manifest
index 845dfe14e41a..758a573de0ef 100644
--- a/dev-python/uv/Manifest
+++ b/dev-python/uv/Manifest
@@ -12,3 +12,5 @@ DIST uv-0.12.7-crates.tar.xz 44143088 BLAKE2B 075113e8cbafd99a1c70c4ce53678f2ceb
DIST uv-0.12.7.gh.tar.gz 8659716 BLAKE2B ab7d74e16821dbbefeb247cf80926ae23f75b5f309a8864070b3a01344044a966f772685cb864470b4c30877f8e03715ec675b658862bd04906e740866ebffd1 SHA512 7f9bd1aef6c285aedd3fe588a5f70e0458f85f6db14f0368ea24c5524fd66990510e0d5624a7faf48091a3dc73ff66ac52ab9a6ed571a10cca272b9588fb1aff
DIST uv-0.12.9-crates.tar.xz 44161200 BLAKE2B ef5f654005a5c074a2c251471bfe91db9e172b5733ede5e9b5f48a3464194f50e288aeb8afdbd2f0923106380812490bb800506c3c10dca916e994c2c6548a6c SHA512 26676348002e1c3ddfdc772ce6a429ab0d69fe7641a539dba2694a0e946c2f23789e5c8d6ceeaef407efbd20ec4b0fe889463d94c498514462bc19f0d85fff7d
DIST uv-0.12.9.gh.tar.gz 8688302 BLAKE2B 0ec1ded90f77ad7b9eb0e0a5c8001b26e10b7485ffa6e709638130173ded90d92969a54f10a455e8a0c032d5872881a3f527a6d4b612d378f283349dea816cab SHA512 18d35675a3e15531a9542c951b265866da4b762e0f2ba91f66dcc8b55ba5352ec97638ee2dc7fd3a908639201b27a442112a75c67053f9d861840c041e0b5290
+DIST uv-0.13.1-crates.tar.xz 44234800 BLAKE2B 78e734286467404e4289cff568565e1ef16bf7b97eef5b01180dabca62bc8fd21bbd39b24f0fa40213b97c8a1e2a2733801c382bb271f8377f4688102c623da9 SHA512 a736dc50e05b52fed9379570415d1a18e32a3a1f23c8630af625677df73b7916ecf2f66d8b7c9d9281d1c37264e442bc16c382e0c5ea21b8be68f33a9d26e3f2
+DIST uv-0.13.1.gh.tar.gz 8877918 BLAKE2B 43c1726bf6b277b57d154a0bba917cd6762c5dd3e4fbc5293c49372725e12b6980ef34fc44013c68a0956fa9bde368d3a6f45c4e658f27fe98506f22c987a7f2 SHA512 de0bf17d6ddc081e2b3904ed04aeb6ab7e9745880dd2cf78fd9f70e01241d28701246bb2db2b524c76549a0a53af899ad291dec7e957c6a96a344c285c1c4e29
diff --git a/dev-python/uv/uv-0.13.1.ebuild b/dev-python/uv/uv-0.13.1.ebuild
new file mode 100644
index 000000000000..a8418c9a55d5
--- /dev/null
+++ b/dev-python/uv/uv-0.13.1.ebuild
@@ -0,0 +1,151 @@
+# Copyright 2024-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+CRATES="
+"
+RUST_MIN_VER="1.97.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+="
+ Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD-2 BSD CC0-1.0
+ CDLA-Permissive-2.0 ISC MIT MIT-0 MPL-2.0 Unicode-3.0
+ Unicode-DFS-2016 ZLIB
+"
+# 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 tikv-jemalloc-sys?
+
+ # remove unbundled sources, just in case
+ find "${ECARGO_VENDOR}"/zstd-sys-*/ -name '*.c' -delete || die
+}
+
+src_configure() {
+ local myfeatures=(
+ test-git
+ test-pypi
+ test-python
+ )
+
+ cargo_src_configure --no-default-features
+ # otherwise, rustc/llvm runs out of address space
+ use arm && export RUSTFLAGS="${RUSTFLAGS} -Copt-level=0"
+}
+
+src_compile() {
+ cd crates/uv || die
+ cargo_src_compile
+}
+
+src_test() {
+ cd crates/uv || die
+ cargo_src_test --no-fail-fast
+}
+
+src_install() {
+ dobin "$(cargo_target_dir)"/{uv,uvx}
+
+ 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
+}