public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 0/3] python*-r1.eclass: dev-lang/pypy use
@ 2024-10-21 17:53 Michał Górny
  2024-10-21 17:53 ` [gentoo-dev] [PATCH 1/3] python-any-r1.eclass: Fix python_gen_any_dep w/ PYTHON_REQ_USE Michał Górny
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michał Górny @ 2024-10-21 17:53 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Hello,

Here's a series of patches to update the eclasses for dev-lang/pypy dep.
Or to put it more precisely, a bugfix for `python_gen_any_dep()`
with USE dependencies, removal of dead code and then the dependency
change.

As noted in the commit message, dev-python/pypy3 will need to remain
around at least for some time after the next subslot bump so that users
get everything rebuilt with the new dep.

This also requires pkgcheck update.  The relevant changes have been
merged already, so pending the release + stabilization + infra upgrade
cycle.  This should also gives us enough time to test the new package
layout a bit before we commit to it finally (currently the system can
gracefully switch back on revert).



Michał Górny (3):
  python-any-r1.eclass: Fix python_gen_any_dep w/ PYTHON_REQ_USE
  python-any-r1.eclass: Remove obsolete variable
  python-utils-r1.eclass: Depend on dev-lang/pypy directly

 eclass/python-any-r1.eclass     | 5 ++---
 eclass/python-utils-r1.eclass   | 9 ++-------
 eclass/tests/python-utils-r1.sh | 4 +++-
 3 files changed, 7 insertions(+), 11 deletions(-)

-- 
2.47.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [gentoo-dev] [PATCH 1/3] python-any-r1.eclass: Fix python_gen_any_dep w/ PYTHON_REQ_USE
  2024-10-21 17:53 [gentoo-dev] [PATCH 0/3] python*-r1.eclass: dev-lang/pypy use Michał Górny
@ 2024-10-21 17:53 ` Michał Górny
  2024-10-21 17:53 ` [gentoo-dev] [PATCH 2/3] python-any-r1.eclass: Remove obsolete variable Michał Górny
  2024-10-21 17:53 ` [gentoo-dev] [PATCH 3/3] python-utils-r1.eclass: Depend on dev-lang/pypy directly Michał Górny
  2 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2024-10-21 17:53 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Fix `python_gen_any_dep()` to correctly strip the `:=` operator when
it does not occur at the end of `PYTHON_PKG_DEP`, i.e. when
`PYTHON_REQ_USE` is used and a USE dependency string is appended.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/python-any-r1.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass
index 0c01a49f9000..ca2ddf146406 100644
--- a/eclass/python-any-r1.eclass
+++ b/eclass/python-any-r1.eclass
@@ -259,7 +259,7 @@ python_gen_any_dep() {
 		local i_depstr=${depstr//\$\{PYTHON_USEDEP\}/${PYTHON_USEDEP}}
 		i_depstr=${i_depstr//\$\{PYTHON_SINGLE_USEDEP\}/${PYTHON_SINGLE_USEDEP}}
 		# note: need to strip '=' slot operator for || deps
-		out="( ${PYTHON_PKG_DEP%:=} ${i_depstr} ) ${out}"
+		out="( ${PYTHON_PKG_DEP/:=} ${i_depstr} ) ${out}"
 	done
 	echo "|| ( ${out})"
 }
-- 
2.47.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-dev] [PATCH 2/3] python-any-r1.eclass: Remove obsolete variable
  2024-10-21 17:53 [gentoo-dev] [PATCH 0/3] python*-r1.eclass: dev-lang/pypy use Michał Górny
  2024-10-21 17:53 ` [gentoo-dev] [PATCH 1/3] python-any-r1.eclass: Fix python_gen_any_dep w/ PYTHON_REQ_USE Michał Górny
@ 2024-10-21 17:53 ` Michał Górny
  2024-10-21 17:53 ` [gentoo-dev] [PATCH 3/3] python-utils-r1.eclass: Depend on dev-lang/pypy directly Michał Górny
  2 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2024-10-21 17:53 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Remove a leftover variable from before PYTHON_PKG_DEP was used.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/python-any-r1.eclass | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass
index ca2ddf146406..adc7b1bfec47 100644
--- a/eclass/python-any-r1.eclass
+++ b/eclass/python-any-r1.eclass
@@ -167,8 +167,7 @@ inherit python-utils-r1
 # @CODE
 
 _python_any_set_globals() {
-	local usestr deps i PYTHON_PKG_DEP
-	[[ ${PYTHON_REQ_USE} ]] && usestr="[${PYTHON_REQ_USE}]"
+	local deps i PYTHON_PKG_DEP
 
 	_python_set_impls
 
-- 
2.47.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-dev] [PATCH 3/3] python-utils-r1.eclass: Depend on dev-lang/pypy directly
  2024-10-21 17:53 [gentoo-dev] [PATCH 0/3] python*-r1.eclass: dev-lang/pypy use Michał Górny
  2024-10-21 17:53 ` [gentoo-dev] [PATCH 1/3] python-any-r1.eclass: Fix python_gen_any_dep w/ PYTHON_REQ_USE Michał Górny
  2024-10-21 17:53 ` [gentoo-dev] [PATCH 2/3] python-any-r1.eclass: Remove obsolete variable Michał Górny
@ 2024-10-21 17:53 ` Michał Górny
  2 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2024-10-21 17:53 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Depend on `>=dev-lang/pypy-3.10:=` rather than the backwards
compatibility `dev-python/pypy3` package.  Note that the package needs
to remain at least for some time after the next subslot bump, so that
users rebuild all packages and get the updated dependency across
the system.

Note that this requires pkgcheck to be updated first.

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/python-utils-r1.eclass   | 9 ++-------
 eclass/tests/python-utils-r1.sh | 4 +++-
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 555b6c561a18..1c0e63a2621f 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -450,20 +450,15 @@ _python_export() {
 				local d
 				case ${impl} in
 					python*)
-						PYTHON_PKG_DEP="dev-lang/python:${impl#python}"
+						PYTHON_PKG_DEP="dev-lang/python:${impl#python}${PYTHON_REQ_USE:+[${PYTHON_REQ_USE}]}"
 						;;
 					pypy3)
-						PYTHON_PKG_DEP="dev-python/${impl}:="
+						PYTHON_PKG_DEP=">=dev-lang/pypy-3.10:=[symlink${PYTHON_REQ_USE:+,${PYTHON_REQ_USE}}]"
 						;;
 					*)
 						die "Invalid implementation: ${impl}"
 				esac
 
-				# use-dep
-				if [[ ${PYTHON_REQ_USE} ]]; then
-					PYTHON_PKG_DEP+=[${PYTHON_REQ_USE}]
-				fi
-
 				export PYTHON_PKG_DEP
 				debug-print "${FUNCNAME}: PYTHON_PKG_DEP = ${PYTHON_PKG_DEP}"
 				;;
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index 732f53381b22..81c3c6f78158 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -79,6 +79,7 @@ for minor in {10..13} 13t; do
 		test_var PYTHON_LIBS "python3_${minor}" "*-lpython3.${minor}*"
 	fi
 	test_var PYTHON_PKG_DEP "python3_${minor}" "*dev-lang/python*:3.${minor}"
+	PYTHON_REQ_USE=sqlite test_var PYTHON_PKG_DEP "python3_${minor}" "*dev-lang/python*:3.${minor}\[sqlite\]"
 	test_var PYTHON_SCRIPTDIR "python3_${minor}" "/usr/lib/python-exec/python3.${minor}"
 
 	tbegin "Testing that python3_${minor} is present in an impl array"
@@ -126,7 +127,8 @@ if [[ -x /usr/bin/pypy3 ]]; then
 	test_var PYTHON_SITEDIR pypy3 "/usr/lib*/pypy3.*/site-packages"
 	test_var PYTHON_INCLUDEDIR pypy3 "/usr/include/pypy3.*"
 fi
-test_var PYTHON_PKG_DEP pypy3 '*dev-python/pypy3*:='
+test_var PYTHON_PKG_DEP pypy3 '*dev-lang/pypy*:=\[symlink\]'
+PYTHON_REQ_USE=sqlite test_var PYTHON_PKG_DEP pypy3 '*dev-lang/pypy*:=\[symlink,sqlite\]'
 test_var PYTHON_SCRIPTDIR pypy3 /usr/lib/python-exec/pypy3
 eoutdent
 
-- 
2.47.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-10-21 17:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-21 17:53 [gentoo-dev] [PATCH 0/3] python*-r1.eclass: dev-lang/pypy use Michał Górny
2024-10-21 17:53 ` [gentoo-dev] [PATCH 1/3] python-any-r1.eclass: Fix python_gen_any_dep w/ PYTHON_REQ_USE Michał Górny
2024-10-21 17:53 ` [gentoo-dev] [PATCH 2/3] python-any-r1.eclass: Remove obsolete variable Michał Górny
2024-10-21 17:53 ` [gentoo-dev] [PATCH 3/3] python-utils-r1.eclass: Depend on dev-lang/pypy directly Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox