summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2024-11-08 05:10:48 +0100
committerMichał Górny <mgorny@gentoo.org>2024-11-08 05:52:27 +0100
commitf46cdd4342ece4e05daea017dd7613a73977101f (patch)
tree65929d9af95db6f8ccea6640f33ceb804d7dbe0e /dev-python
parentprofiles/features/wd40: Add dev-python/inline-snapshot (pydantic) (diff)
downloadgentoo-f46cdd4342ece4e05daea017dd7613a73977101f.tar.gz
gentoo-f46cdd4342ece4e05daea017dd7613a73977101f.tar.bz2
gentoo-f46cdd4342ece4e05daea017dd7613a73977101f.zip
dev-python/uv: Bump to 0.5.0
While at it, disable automatic Python downloads, following the same idea in Fedora. See-Also: https://src.fedoraproject.org/rpms/uv/pull-request/18 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python')
-rw-r--r--dev-python/uv/Manifest2
-rw-r--r--dev-python/uv/uv-0.5.0.ebuild166
2 files changed, 168 insertions, 0 deletions
diff --git a/dev-python/uv/Manifest b/dev-python/uv/Manifest
index 5ad75329b5be..5d15e91d0bd0 100644
--- a/dev-python/uv/Manifest
+++ b/dev-python/uv/Manifest
@@ -4,3 +4,5 @@ DIST rs-async-zip-011b24604fa7bc223daaad7712c0694bac8f0a87.gh.tar.gz 51706 BLAKE
DIST tl-6e25b2ee2513d75385101a8ff9f591ef51f314ec.gh.tar.gz 37106 BLAKE2B c30d1c33f6f52e2bc83823eb6319f8a3e462b7c7408fb6a08f995747857ef234f81db4135a04f9d183095fe473a4087f8f0cb89d8f87ef4400285d2ce034ec22 SHA512 4abbc4240ed129c92da8d616e27a6df0f24cdc85a0803acfdae588ca91f9e5b8d482e3ac88b2e657ff68917b1b43cef1e7ef3c887f624659b231fa5a13fcae68
DIST uv-0.4.30-crates.tar.xz 45786704 BLAKE2B 72a5828c5c504859248312e0d796a6505e4d0546218c8f7f99e37843afdf9496ea1ba4b1f094979299de417accca7f021e4f8971e467429e7d986ed9a3fb2008 SHA512 49abd05fa9e14b1bdb1b4d26f1e68a2038d57bd25c756440bca209b513de42fd8d33ce6e1333392dce65ab427285651809b44e024758359688af5fb87efc19ed
DIST uv-0.4.30.gh.tar.gz 2832043 BLAKE2B 11c0d090161b9aa6d6e84d0edb15701c8eaba8281579653d6b0ba84003933f82ec5b71c3c33689e5324e51de70b7af41e4799f35fb45f57ce6d58fafa371a615 SHA512 4930c863aae71ae6e6f5b7ba20ff30ffe4c044f6980f973110d0c8c3079cb4aacbe774fe4577eb8d9c16f5d41d2cd0974c0fe63cf0d10e065c6b8d4cf553b80b
+DIST uv-0.5.0-crates.tar.xz 45831504 BLAKE2B 0a95463b47729d40cdaf852ba556626ed3a1d2122f5d5a8bc6c401b95c836fa0ac0726f2aeaceb10346d65c0aa3c5250598c3219244fc3b957d26ee16968d443 SHA512 b991d9aeeec6b4e5d3f3f11a51c66f929560cc75bfc9379f090ba75b243056d4cf174326f8cb31b7aefd7e60e445e05b6799d9d7a8021b0893de436dafb384ab
+DIST uv-0.5.0.gh.tar.gz 2836911 BLAKE2B 326279605229675237d239fe5395436cfaa90026011e8195feeedb84333dd96f9fe5a860073776b3c3b2e0c2604d134572322e8ab12f5b72561213b6a2705a65 SHA512 6b9527d650492ccb465167e9e3087482a083997bef5b3dd494b7122a0b176762c2526819278867f42e205a93f283a955879f2431005265db7e808018ac8e3f51
diff --git a/dev-python/uv/uv-0.5.0.ebuild b/dev-python/uv/uv-0.5.0.ebuild
new file mode 100644
index 000000000000..e67a3e7e521e
--- /dev/null
+++ b/dev-python/uv/uv-0.5.0.ebuild
@@ -0,0 +1,166 @@
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+CRATES="
+"
+
+declare -A GIT_CRATES=(
+ [async_zip]='https://github.com/charliermarsh/rs-async-zip;011b24604fa7bc223daaad7712c0694bac8f0a87;rs-async-zip-%commit%'
+ [pubgrub]='https://github.com/astral-sh/pubgrub;95e1390399cdddee986b658be19587eb1fdb2d79;pubgrub-%commit%'
+ [reqwest-middleware]='https://github.com/TrueLayer/reqwest-middleware;d95ec5a99fcc9a4339e1850d40378bbfe55ab121;reqwest-middleware-%commit%/reqwest-middleware'
+ [reqwest-retry]='https://github.com/TrueLayer/reqwest-middleware;d95ec5a99fcc9a4339e1850d40378bbfe55ab121;reqwest-middleware-%commit%/reqwest-retry'
+ [tl]='https://github.com/charliermarsh/tl;6e25b2ee2513d75385101a8ff9f591ef51f314ec;tl-%commit%'
+ [version-ranges]='https://github.com/astral-sh/pubgrub;95e1390399cdddee986b658be19587eb1fdb2d79;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://dev.gentoo.org/~mgorny/dist/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 ISC MIT
+ MPL-2.0 Unicode-DFS-2016
+"
+# 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="
+ >=virtual/rust-1.80
+ test? (
+ dev-lang/python:3.8
+ dev-lang/python:3.9
+ dev-lang/python:3.10
+ dev-lang/python:3.11
+ dev-lang/python:3.12
+ )
+"
+
+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
+}
+
+src_prepare() {
+ default
+
+ # remove patch.* that breaks GIT_CRATES
+ local reqmw=${GIT_CRATES[reqwest-middleware]}
+ reqmw=${reqmw#*;}
+ reqmw=${reqmw%;*}
+ sed -i -e "/^\[patch/,\$s@^\(reqwest-middleware = \).*@\1 { path = \"${WORKDIR}/reqwest-middleware-${reqmw}/reqwest-middleware\" }@" 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=
+
+ cd crates/uv || die
+ cargo_src_test --no-fail-fast
+}
+
+src_install() {
+ cd crates/uv || die
+ cargo_src_install
+
+ insinto /etc/uv
+ newins - uv.toml <<-EOF || die
+ # By default ("automatic"), uv downloads missing Python versions
+ # automatically and keeps them in the user's home directory.
+ # Once installed, they are preferred over system Python install.
+ # Disable that because 1) autodownloading software is bad,
+ # 2) we do not want automatically downloaded Pythons to override
+ # system Pythons installed later.
+ #
+ # The user can still manually have uv download and install
+ # Python via "uv python install". We are not switching
+ # "python-preference" to allow the user to override the system
+ # Python with these explicit installs.
+ #
+ # Relevant docs:
+ # https://docs.astral.sh/uv/reference/settings/#python-downloads
+ # https://docs.astral.sh/uv/reference/settings/#python-preference
+
+ python-downloads = "manual"
+ EOF
+}