diff --git a/dev-python/hatchling/Manifest b/dev-python/hatchling/Manifest index 5037323ad28d8..60b06798d30ea 100644 --- a/dev-python/hatchling/Manifest +++ b/dev-python/hatchling/Manifest @@ -1 +1,2 @@ DIST hatch-hatchling-v1.30.1.gh.tar.gz 5333904 BLAKE2B d5f1c478f2bc214400a50f079d695ef3795a92b0633307799bec34f031cffa4c36b0269a3f142323c61b5ddcf4b1918d4e9f32283eaacff7615e3330fe864be6 SHA512 dfb57a076ec683d82228a453c2485153defd0b1d2f31a43041ae0b7ddd428b931ab1288b0b23393df80f5630bd09c78faa2852b28649af0db2e7f55bd915b942 +DIST hatch-hatchling-v1.31.0.gh.tar.gz 5336511 BLAKE2B 51a18127fa90768fd3116faa1bf500b7f95315fa995486922023ef3a55530c7f658ab6041a0f4cbb254f114086c09f3828d38493150ca6d8f54da8d862f4bbec SHA512 707efa1d72bde3e80bb5210602e9f0389f1659dfe65bac6ab33ecfa0e9b433a42c3dac1e92a86398c72dbcb72a69e9dc1db9466c2a9de38993025c52578db2f1 diff --git a/dev-python/hatchling/hatchling-1.31.0.ebuild b/dev-python/hatchling/hatchling-1.31.0.ebuild new file mode 100644 index 0000000000000..9081cf535303f --- /dev/null +++ b/dev-python/hatchling/hatchling-1.31.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=( python3_{12..15} ) +PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" python3_{14..15}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 +}