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.12.8.ebuild151
2 files changed, 153 insertions, 0 deletions
diff --git a/dev-python/uv/Manifest b/dev-python/uv/Manifest
index d2d94375f318..b65547904815 100644
--- a/dev-python/uv/Manifest
+++ b/dev-python/uv/Manifest
@@ -12,3 +12,5 @@ DIST uv-0.12.6-crates.tar.xz 44170700 BLAKE2B 915b68dc4355b944c10c497cd500fce7ce
DIST uv-0.12.6.gh.tar.gz 8667534 BLAKE2B 0987a8ed390e98dadbe854805503b30b3193e88662d311e5d20c849cd1ea7f5c5d37fc87c10c86a8ecbf963808af6586a5d0c044c0ed1e6f220b2dfa75ce880d SHA512 afe6f5788468168f9380122073a8e96b88c14def80df8cd253cd64e4cc28f16da76137d90a73b8bd1e6cd93c0858701002161e53235f55749ac11eaa14b14000
DIST uv-0.12.7-crates.tar.xz 44143088 BLAKE2B 075113e8cbafd99a1c70c4ce53678f2ceb13ce31dc7cafb5773e32ae9dfa14144390380e0149219912a0c4b92e6d3b9d0a0a0016cdd4c69097bf75adf1b8a716 SHA512 f9dbdad7cbddd3238c7cc9fbcbec4e92fc8c8c66bc7247ccc8159bb186223c199e3bd411ad9148750ec1fa258775dcec1e2bb6bc3287fca7aeb6ffa7ba4d6b44
DIST uv-0.12.7.gh.tar.gz 8659716 BLAKE2B ab7d74e16821dbbefeb247cf80926ae23f75b5f309a8864070b3a01344044a966f772685cb864470b4c30877f8e03715ec675b658862bd04906e740866ebffd1 SHA512 7f9bd1aef6c285aedd3fe588a5f70e0458f85f6db14f0368ea24c5524fd66990510e0d5624a7faf48091a3dc73ff66ac52ab9a6ed571a10cca272b9588fb1aff
+DIST uv-0.12.8-crates.tar.xz 44173544 BLAKE2B acdbb473c57cebddedc908d0e4e2e4b69ce233ffe7afe5dde2ef01bf0025a089e4be2a2c95e48e57176f08d3f970b82d0fc7f14c1dc23228d846a26c33bed410 SHA512 9974e7f5fa53b5848986f20147560b096a8812c4e5f4af619bcfe3f29f50e3edde6d05a959f906064e81316f81e4d4a4b8b4f0de315774d7f5f05bdf97003a2b
+DIST uv-0.12.8.gh.tar.gz 8678426 BLAKE2B 71c97c50ca10bba766e0cb0877792a1e9aee1821f3de0eca7964522eacc870b62df50e6a5820e75e9daef559cbc24905c9dd01596e98488bbba348cb12e467be SHA512 ecac878e03791c00875b7d1f0a1849ed165435e94d1ce999b4158be2bd305111ee69c418f4e75bb15541089a29a15a86e4201a56b024cdcf522554b925829e49
diff --git a/dev-python/uv/uv-0.12.8.ebuild b/dev-python/uv/uv-0.12.8.ebuild
new file mode 100644
index 000000000000..9826f9045941
--- /dev/null
+++ b/dev-python/uv/uv-0.12.8.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.96.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 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
+}