From 2bedcbf0058f9e62c03a7b7727fec91d67a3ca43 Mon Sep 17 00:00:00 2001 From: Flatcar Buildbot Date: Mon, 2 Mar 2026 07:24:57 +0000 Subject: [PATCH] dev-python/hatchling: Sync with Gentoo It's from Gentoo commit 77808a6844438397506b008dd5a61ce4de846613. Signed-off-by: Flatcar Buildbot --- .../dev-python/hatchling/Manifest | 1 + .../hatchling/hatchling-1.29.0.ebuild | 98 +++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 sdk_container/src/third_party/portage-stable/dev-python/hatchling/hatchling-1.29.0.ebuild diff --git a/sdk_container/src/third_party/portage-stable/dev-python/hatchling/Manifest b/sdk_container/src/third_party/portage-stable/dev-python/hatchling/Manifest index e81a36e877..91f364775c 100644 --- a/sdk_container/src/third_party/portage-stable/dev-python/hatchling/Manifest +++ b/sdk_container/src/third_party/portage-stable/dev-python/hatchling/Manifest @@ -1,2 +1,3 @@ DIST hatch-hatchling-v1.27.0.gh.tar.gz 5275714 BLAKE2B 5db266a4efa8d315ac991b4f109834cbe3710d6b944de78591f3707d1552a60ac24c1970c093190c2b3fdb8515d7ed5f4af7a32a1a364cefe9f4c08eef84b369 SHA512 d519428c4c7c21950df2484f38332b5c89525347f3557ff21a55a85811955c8466f6eb4f919d824ab7a576cd35d8a59e4a5e7827100f6ea1e38c10c0f1864a29 DIST hatch-hatchling-v1.28.0.gh.tar.gz 5296066 BLAKE2B 2def4eee372b0fbf2019c716f63fdd35b110ce6a17a0fcfd4208a52334cd16ab1db9bd73d3a46ab652dd43ac8be02fb1bd4f5b7df44016895523f7900001ab99 SHA512 cbf29be0d0e2e0053c39034a697b4bebce4754205713c9dc35c9f3c9ea9be2652924664c0d11b90869443995c6f9f06ce20ca06afe10a2ac174a0e9dc2e737a2 +DIST hatch-hatchling-v1.29.0.gh.tar.gz 5301488 BLAKE2B d1e36649483f213c56488caf018ad3a3310fafa944e11484ae613021e081999a80321d353c68cfb64bc149558e2c996b788f7b11a228d2f658175165d515bdcd SHA512 321f9ab996dcab54341653e2abf5bdb893c4ac307c62aa9f0dd222609a18f82cd502fb0d0ac598f109d519a0dc8ab40866a37d1ea4023d7d58fe442da7c32ff9 diff --git a/sdk_container/src/third_party/portage-stable/dev-python/hatchling/hatchling-1.29.0.ebuild b/sdk_container/src/third_party/portage-stable/dev-python/hatchling/hatchling-1.29.0.ebuild new file mode 100644 index 0000000000..df05e77c38 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-python/hatchling/hatchling-1.29.0.ebuild @@ -0,0 +1,98 @@ +# Copyright 2022-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=standalone +PYTHON_TESTED=( pypy3_11 python3_{11..14} ) +PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" python3_{13,14}t ) + +inherit distutils-r1 + +TAG=${P/-/-v} +MY_P=hatch-${TAG} +DESCRIPTION="Modern, extensible Python build backend" +HOMEPAGE=" + https://pypi.org/project/hatchling/ + https://github.com/pypa/hatch/ +" +SRC_URI=" + https://github.com/pypa/hatch/archive/${TAG}.tar.gz + -> ${MY_P}.gh.tar.gz +" +S=${WORKDIR}/${MY_P}/backend + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos ~x64-solaris" +IUSE="test" +RESTRICT="!test? ( test )" + +# deps are listed in backend/src/hatchling/ouroboros.py +# editables are optional but required for editable installs +RDEPEND=" + >=dev-python/editables-0.3[${PYTHON_USEDEP}] + >=dev-python/packaging-24.2[${PYTHON_USEDEP}] + >=dev-python/pathspec-0.10.1[${PYTHON_USEDEP}] + >=dev-python/pluggy-1.0.0[${PYTHON_USEDEP}] + dev-python/trove-classifiers[${PYTHON_USEDEP}] +" +BDEPEND=" + ${RDEPEND} + test? ( + $(python_gen_cond_dep ' + dev-python/atomicwrites[${PYTHON_USEDEP}] + dev-python/click[${PYTHON_USEDEP}] + dev-python/httpx[${PYTHON_USEDEP}] + dev-python/platformdirs[${PYTHON_USEDEP}] + dev-python/pytest[${PYTHON_USEDEP}] + dev-python/pytest-mock[${PYTHON_USEDEP}] + dev-python/rich[${PYTHON_USEDEP}] + dev-python/tomli-w[${PYTHON_USEDEP}] + dev-python/virtualenv[${PYTHON_USEDEP}] + ' "${PYTHON_TESTED[@]}") + ) +" + +src_test() { + # top-level "tests" directory contains tests both for hatch + # and hatchling + cd "${WORKDIR}/${MY_P}" || die + + # sigh; standalone test suites are overrated, right? + echo "__version__ = '${PV}'" > src/hatch/_version.py || die + local -x PYTHONPATH="src:${PYTHONPATH}" + + # do not require uv for portability, sigh + mkdir "${T}/bin" || die + cat > "${T}/bin/uv" <<-EOF || die + #!/bin/sh + exit 127 + EOF + chmod +x "${T}/bin/uv" || die + local -x PATH=${T}/bin:${PATH} + + # tests mock cargo subprocess call but the backend raises if CARGO + # is not set and shutil.which() can't find it + local -x CARGO=cargo + + distutils-r1_src_test +} + +python_test() { + if ! has "${EPYTHON}" "${PYTHON_TESTED[@]/_/.}"; then + einfo "Skipping tests on ${EPYTHON}" + return + fi + + local -x EPYTEST_DESELECT=( + # most of these run uv to install stuff + # the few remaining tests aren't worth running + tests/backend/dep/test_core.py + # broken if CARGO is set + tests/backend/builders/test_binary.py::TestBuildBootstrap::test_no_cargo + ) + + local EPYTEST_PLUGINS=( pytest-mock ) + epytest tests/backend +}