commit:     50af816bf27c562dbae7121f82ad416daf14d49e
Author:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 16 20:55:00 2024 +0000
Commit:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
CommitDate: Mon Sep 16 21:09:02 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=50af816b

dev-python/jaraco-collections: force the backend to flit

It is now a dependency of setuptools, which means we cannot use
setuptools to build it or we get a dependency cycle. Similar issue with
a lot of jaraco-* packages already.

```
 * Error: circular dependencies:
(dev-python/jaraco-collections-5.1.0:0/0::gentoo, ebuild scheduled for merge) 
depends on
 (dev-python/setuptools-75.0.0:0/0::gentoo, ebuild scheduled for merge) 
(buildtime)
  (dev-python/jaraco-collections-5.1.0:0/0::gentoo, ebuild scheduled for merge) 
(buildtime)
```

Signed-off-by: Eli Schwartz <eschwartz <AT> gentoo.org>

 .../jaraco-collections/jaraco-collections-5.1.0.ebuild   | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/dev-python/jaraco-collections/jaraco-collections-5.1.0.ebuild 
b/dev-python/jaraco-collections/jaraco-collections-5.1.0.ebuild
index b0ae55d09019..6b2e5a0f229c 100644
--- a/dev-python/jaraco-collections/jaraco-collections-5.1.0.ebuild
+++ b/dev-python/jaraco-collections/jaraco-collections-5.1.0.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-DISTUTILS_USE_PEP517=setuptools
+DISTUTILS_USE_PEP517=flit
 PYPI_PN=${PN/-/.}
 PYTHON_COMPAT=( python3_{10..13} pypy3 )
 
@@ -22,12 +22,20 @@ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k 
~mips ~ppc ~ppc64 ~riscv
 RDEPEND="
        dev-python/jaraco-text[${PYTHON_USEDEP}]
 "
-BDEPEND="
-       >=dev-python/setuptools-scm-1.15.0[${PYTHON_USEDEP}]
-"
 
 distutils_enable_tests pytest
 
+src_configure() {
+       grep -q 'build-backend = "setuptools' pyproject.toml ||
+               die "Upstream changed build-backend, recheck"
+       # write a custom pyproject.toml to ease setuptools bootstrap
+       sed -i -e \
+               's/build-backend = .*/build-backend = "flit_core.buildapi"/' \
+               -e '/^name = /a\' -e "version = \"${PV}\"" \
+               -e '/^dynamic =/d' \
+               pyproject.toml || die
+}
+
 python_test() {
        local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
        epytest

Reply via email to