blob: fdbaa6b65e0ae29b2e572cb382e66846e674b862 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# Copyright 2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=hatchling
# maturin compiles uv-build executable for every impl, we do not want
# that, so we hack hatchling into installing the Python module instead.
DISTUTILS_UPSTREAM_PEP517=maturin
PYTHON_COMPAT=( pypy3 pypy3_11 python3_{10..13} )
inherit distutils-r1 pypi
DESCRIPTION="PEP517 uv build backend"
HOMEPAGE="
https://github.com/astral-sh/uv/
https://pypi.org/project/uv-build/
"
LICENSE="|| ( Apache-2.0 MIT )"
SLOT="0"
KEYWORDS="~amd64"
RDEPEND="
>=dev-python/uv-${PV}
"
src_prepare() {
distutils-r1_src_prepare
cat >> pyproject.toml <<-EOF || die
[tool.hatch.build.targets.wheel]
packages = ["python/uv_build"]
EOF
# use the executable from dev-python/uv instead of building
# a largely overlapping uv-build executable (at least for now)
sed -i -e '/USE_UV_EXECUTABLE/s:False:True:' python/uv_build/__init__.py || die
}
|