* [gentoo-python] [PATCH python-distutils-ng 1/4] Mark the eclass as work-in-progress.
2012-09-08 22:00 [gentoo-python] python-distutils-ng -- the future? Michał Górny
@ 2012-09-08 22:00 ` Michał Górny
2012-09-08 22:00 ` [gentoo-python] [PATCH python-distutils-ng 2/4] Drop pointless default S assignment Michał Górny
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Michał Górny @ 2012-09-08 22:00 UTC (permalink / raw
To: gentoo-python; +Cc: Michał Górny
---
gx86/eclass/python-distutils-ng.eclass | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/gx86/eclass/python-distutils-ng.eclass b/gx86/eclass/python-distutils-ng.eclass
index 4aecc3c..4f32da7 100644
--- a/gx86/eclass/python-distutils-ng.eclass
+++ b/gx86/eclass/python-distutils-ng.eclass
@@ -9,6 +9,14 @@
# Author: Krzysztof Pawlik <nelchael@gentoo.org>
# @BLURB: Install Python packages using distutils.
# @DESCRIPTION:
+# !IMPORTANT!
+#
+# Please note that the eclass is undergoing serious changes and new packages
+# shouldn't be using it. The API may change, and new features will be added
+# which will simplify adoption of the eclass to packages.
+#
+# !IMPORTANT!
+#
# The Python eclass is designed to allow an easier installation of Python
# packages and their incorporation into the Gentoo Linux system.
#
--
1.7.12
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-python] [PATCH python-distutils-ng 2/4] Drop pointless default S assignment.
2012-09-08 22:00 [gentoo-python] python-distutils-ng -- the future? Michał Górny
2012-09-08 22:00 ` [gentoo-python] [PATCH python-distutils-ng 1/4] Mark the eclass as work-in-progress Michał Górny
@ 2012-09-08 22:00 ` Michał Górny
2012-09-08 22:00 ` [gentoo-python] [PATCH python-distutils-ng 3/4] Move EXPORT_FUNCTIONS after the EAPI switch Michał Górny
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Michał Górny @ 2012-09-08 22:00 UTC (permalink / raw
To: gentoo-python; +Cc: Michał Górny
---
gx86/eclass/python-distutils-ng.eclass | 1 -
1 file changed, 1 deletion(-)
diff --git a/gx86/eclass/python-distutils-ng.eclass b/gx86/eclass/python-distutils-ng.eclass
index 4f32da7..89d8007 100644
--- a/gx86/eclass/python-distutils-ng.eclass
+++ b/gx86/eclass/python-distutils-ng.eclass
@@ -74,7 +74,6 @@ case "${EAPI}" in
die "Unsupported EAPI=${EAPI} (too old) for python-distutils-ng.eclass" ;;
4)
# EAPI=4 needed for REQUIRED_USE
- S="${S:-${WORKDIR}/${P}}"
;;
*)
die "Unsupported EAPI=${EAPI} (unknown) for python-distutils-ng.eclass" ;;
--
1.7.12
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-python] [PATCH python-distutils-ng 3/4] Move EXPORT_FUNCTIONS after the EAPI switch.
2012-09-08 22:00 [gentoo-python] python-distutils-ng -- the future? Michał Górny
2012-09-08 22:00 ` [gentoo-python] [PATCH python-distutils-ng 1/4] Mark the eclass as work-in-progress Michał Górny
2012-09-08 22:00 ` [gentoo-python] [PATCH python-distutils-ng 2/4] Drop pointless default S assignment Michał Górny
@ 2012-09-08 22:00 ` Michał Górny
2012-09-08 22:00 ` [gentoo-python] [PATCH python-distutils-ng 4/4] Temporarily remove PYTHON_OPTIONAL -- it is mis-designed Michał Górny
2012-09-11 3:23 ` [gentoo-python] python-distutils-ng -- the future? Ben de Groot
4 siblings, 0 replies; 6+ messages in thread
From: Michał Górny @ 2012-09-08 22:00 UTC (permalink / raw
To: gentoo-python; +Cc: Michał Górny
---
gx86/eclass/python-distutils-ng.eclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gx86/eclass/python-distutils-ng.eclass b/gx86/eclass/python-distutils-ng.eclass
index 89d8007..4093600 100644
--- a/gx86/eclass/python-distutils-ng.eclass
+++ b/gx86/eclass/python-distutils-ng.eclass
@@ -67,8 +67,6 @@ fi
# Set to any value to disable automatic reinstallation of scripts in bin
# directories. See python-distutils-ng_src_install function.
-EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
-
case "${EAPI}" in
0|1|2|3)
die "Unsupported EAPI=${EAPI} (too old) for python-distutils-ng.eclass" ;;
@@ -79,6 +77,8 @@ case "${EAPI}" in
die "Unsupported EAPI=${EAPI} (unknown) for python-distutils-ng.eclass" ;;
esac
+EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
+
DEPEND="${DEPEND} !<sys-apps/portage-2.1.10.58"
# @FUNCTION: _python-distutils-ng_get_binary_for_implementation
--
1.7.12
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-python] [PATCH python-distutils-ng 4/4] Temporarily remove PYTHON_OPTIONAL -- it is mis-designed.
2012-09-08 22:00 [gentoo-python] python-distutils-ng -- the future? Michał Górny
` (2 preceding siblings ...)
2012-09-08 22:00 ` [gentoo-python] [PATCH python-distutils-ng 3/4] Move EXPORT_FUNCTIONS after the EAPI switch Michał Górny
@ 2012-09-08 22:00 ` Michał Górny
2012-09-11 3:23 ` [gentoo-python] python-distutils-ng -- the future? Ben de Groot
4 siblings, 0 replies; 6+ messages in thread
From: Michał Górny @ 2012-09-08 22:00 UTC (permalink / raw
To: gentoo-python; +Cc: Michał Górny
Let's remove it quickly before someone starts relying on it. Hopefully,
noone outside the tree started to do that -- assumption based
on the fact that it is very unlikely for a package to want optional
distutils.
---
gx86/eclass/python-distutils-ng.eclass | 32 +++-----------------------------
1 file changed, 3 insertions(+), 29 deletions(-)
diff --git a/gx86/eclass/python-distutils-ng.eclass b/gx86/eclass/python-distutils-ng.eclass
index 4093600..3ba6988 100644
--- a/gx86/eclass/python-distutils-ng.eclass
+++ b/gx86/eclass/python-distutils-ng.eclass
@@ -49,12 +49,6 @@ if [[ -z "${PYTHON_COMPAT}" ]]; then
PYTHON_COMPAT+=" pypy1_8 pypy1_9"
fi
-# @ECLASS-VARIABLE: PYTHON_OPTIONAL
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Set the value to "yes" to make the dependency on a Python interpreter
-# optional.
-
# @ECLASS-VARIABLE: PYTHON_DISABLE_COMPILATION
# @DEFAULT_UNSET
# @DESCRIPTION:
@@ -106,12 +100,7 @@ for impl in ${PYTHON_COMPAT}; do
required_use_str+=" python_targets_${impl}"
done
required_use_str=" || ( ${required_use_str} )"
-if [[ "${PYTHON_OPTIONAL}" = "yes" ]]; then
- IUSE+=" python"
- REQUIRED_USE+=" python? ( ${required_use_str} )"
-else
- REQUIRED_USE+=" ${required_use_str}"
-fi
+REQUIRED_USE+=" ${required_use_str}"
unset required_use_str
for impl in ${PYTHON_COMPAT}; do
@@ -129,13 +118,8 @@ for impl in ${PYTHON_COMPAT}; do
esac
dep_str="python_targets_${impl}? ( ${dep_str} )"
- if [[ "${PYTHON_OPTIONAL}" = "yes" ]]; then
- RDEPEND="${RDEPEND} python? ( ${dep_str} )"
- DEPEND="${DEPEND} python? ( ${dep_str} )"
- else
- RDEPEND="${RDEPEND} ${dep_str}"
- DEPEND="${DEPEND} ${dep_str}"
- fi
+ RDEPEND="${RDEPEND} ${dep_str}"
+ DEPEND="${DEPEND} ${dep_str}"
unset dep_str
done
@@ -312,8 +296,6 @@ python-distutils-ng_newscript() {
# Phase function: src_prepare
python-distutils-ng_src_prepare() {
- [[ "${PYTHON_OPTIONAL}" = "yes" ]] && { use python || return; }
-
# Try to run binary for each implementation:
for impl in ${PYTHON_COMPAT}; do
use "python_targets_${impl}" ${PYTHON_COMPAT} || continue
@@ -344,8 +326,6 @@ python-distutils-ng_src_prepare() {
# Phase function: src_configure
python-distutils-ng_src_configure() {
- [[ "${PYTHON_OPTIONAL}" = "yes" ]] && { use python || return; }
-
if type python_configure &> /dev/null; then
_python-distutils-ng_run_for_each_impl python_configure
fi
@@ -353,8 +333,6 @@ python-distutils-ng_src_configure() {
# Phase function: src_compile
python-distutils-ng_src_compile() {
- [[ "${PYTHON_OPTIONAL}" = "yes" ]] && { use python || return; }
-
if type python_compile &> /dev/null; then
_python-distutils-ng_run_for_each_impl python_compile
else
@@ -365,8 +343,6 @@ python-distutils-ng_src_compile() {
# Phase function: src_test
python-distutils-ng_src_test() {
- [[ "${PYTHON_OPTIONAL}" = "yes" ]] && { use python || return; }
-
if type python_test &> /dev/null; then
_python-distutils-ng_run_for_each_impl python_test
fi
@@ -374,8 +350,6 @@ python-distutils-ng_src_test() {
# Phase function: src_install
python-distutils-ng_src_install() {
- [[ "${PYTHON_OPTIONAL}" = "yes" ]] && { use python || return; }
-
if type python_install &> /dev/null; then
_python-distutils-ng_run_for_each_impl python_install
else
--
1.7.12
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [gentoo-python] python-distutils-ng -- the future?
2012-09-08 22:00 [gentoo-python] python-distutils-ng -- the future? Michał Górny
` (3 preceding siblings ...)
2012-09-08 22:00 ` [gentoo-python] [PATCH python-distutils-ng 4/4] Temporarily remove PYTHON_OPTIONAL -- it is mis-designed Michał Górny
@ 2012-09-11 3:23 ` Ben de Groot
4 siblings, 0 replies; 6+ messages in thread
From: Ben de Groot @ 2012-09-11 3:23 UTC (permalink / raw
To: gentoo-python
On 9 September 2012 06:00, Michał Górny <mgorny@gentoo.org> wrote:
> I've just looked through python-distutils-ng again and I think it
> deserves at least a bit of changes, if not complete redesign.
Sounds to me like you want to write a new eclass, not a few changes to
the existing one. Major changes to an eclass are a recipe for disaster
(just consider the messy history of the python and distutils
eclasses).
> It is currently used by 22 packages in Gentoo, and probably a few
> in the overlays. I'd honestly prefer to avoid further packages doing
> that before we decide on how to proceed. That's why the first patch I'm
> suggesting somehow marks is as work-in-progress and asks people not to
> use it yet.
Please don't. As it is, the python-distutils-ng is much more usable
than the overcomplicated python and distutils eclasses. I recommend
everyone to use it for new ebuilds.
> The second and third patches just fix one of the formal problems.
>
> The fourth patch completely removes PYTHON_OPTIONAL support. It is not
> used by any of the mentioned packages right now and that way I'd like to
> avoid it being used by anything else, before we redesign it.
Sounds good.
> The major issue I see with it is that it hardcodes the 'python' flag.
> That's a bit mistaken, I believe. Not that I see much use for
> an optional Python support in package using distutils, and if there is
> one, I believe developers will find it more comfortable to do:
>
> use python && python-distutils-ng_src_compile
>
> than expect the eclass to do that check for them.
I agree here.
> We also should think about USE-dependencies more (I will think about it
> myself, trying to find some working solution better than one suggested
> by Arfrever [the <<[use]>>]). It will be hard thinking...
>
> And one thing certainly needing discussing is extracting some
> common-python code to a separate eclass, without the distutils part.
> To be honest, I'd rather move the whole 'optionality' of Python there.
Sounds good.
> And lastly, the name. Considering the amount of work that needs to be
> done, we might also decide to 'lastrite' the eclass and work on a new
> one, replacing 'ng' with something saner.
Yes, once your new eclass(es) is/are in place, we can migrate existing
ebuilds and lastrite the current eclass(es). Unfortunately, we don't
have a method for versioning eclasses in place, so we have to do it
the clunky way of introducing new eclasses with new names.
--
Cheers,
Ben | yngwin
Gentoo developer
Gentoo Qt project lead, Gentoo Wiki admin
^ permalink raw reply [flat|nested] 6+ messages in thread