* [gentoo-dev] [PATCH 0/9] python-r1 suite cleanup
@ 2020-03-04 14:32 Michał Górny
2020-03-04 14:32 ` [gentoo-dev] [PATCH 1/9] python*-r1.eclass, distutils-r1.eclass: Link to Python Guide Michał Górny
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: Michał Górny @ 2020-03-04 14:32 UTC (permalink / raw
To: gentoo-dev; +Cc: python, Michał Górny
Hi,
Here's a short series addressing some issues I've noticed in the code.
This is mostly stale documentation, non-doc changes are:
1. python_setup() now verbosely reports the implementation selected.
2. leftover code to workaround virtual/pypy* is removed.
3. calling distutils-r1_python_install_all is no longer mandatory.
It it just a thin wrapper on einstalldocs, so it's fine to call
einstalldocs instead.
4. /usr/lib/pypy*/share is now a fatal error. It shouldn't be happening
now that pypy* is patched.
Best regards,
Michał Górny
Michał Górny (9):
python*-r1.eclass, distutils-r1.eclass: Link to Python Guide
python-utils-r1.eclass: Mark _python_check_locale_sanity @INTERNAL
python-utils-r1.eclass: Update docs to use python_setup
python-r1.eclass: Report impl used by python_setup
python-any-r1.eclass: Report impl used by python_setup
python-single-r1.eclass: Report impl used by python_setup
python-utils-r1.eclass: Remove leftover from virtual/pypy*
distutils-r1.eclass: Do not require distutils-r1_python_install_all
distutils-r1.eclass: Make /usr/lib/pypy/share warning fatal
eclass/distutils-r1.eclass | 17 +++--------------
eclass/python-any-r1.eclass | 10 +++++++---
eclass/python-r1.eclass | 7 ++++---
eclass/python-single-r1.eclass | 6 ++++--
eclass/python-utils-r1.eclass | 31 +++++++++----------------------
5 files changed, 27 insertions(+), 44 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [gentoo-dev] [PATCH 1/9] python*-r1.eclass, distutils-r1.eclass: Link to Python Guide
2020-03-04 14:32 [gentoo-dev] [PATCH 0/9] python-r1 suite cleanup Michał Górny
@ 2020-03-04 14:32 ` Michał Górny
2020-03-04 14:32 ` [gentoo-dev] [PATCH 2/9] python-utils-r1.eclass: Mark _python_check_locale_sanity @INTERNAL Michał Górny
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Michał Górny @ 2020-03-04 14:32 UTC (permalink / raw
To: gentoo-dev; +Cc: python, Michał Górny
---
eclass/distutils-r1.eclass | 4 ++--
eclass/python-any-r1.eclass | 6 +++---
eclass/python-r1.eclass | 6 +++---
eclass/python-single-r1.eclass | 4 ++--
eclass/python-utils-r1.eclass | 6 +++---
5 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 27ca236ccf5f..8b7745686d73 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -40,8 +40,8 @@
# as well. Thus, all the variables defined and documented there are
# relevant to the packages using distutils-r1.
#
-# For more information, please see the wiki:
-# https://wiki.gentoo.org/wiki/Project:Python/distutils-r1
+# For more information, please see the Python Guide:
+# https://dev.gentoo.org/~mgorny/python-guide/
case "${EAPI:-0}" in
0|1|2|3|4)
diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass
index 878e337ff3c2..5d74c8acd3e4 100644
--- a/eclass/python-any-r1.eclass
+++ b/eclass/python-any-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: python-any-r1.eclass
@@ -33,8 +33,8 @@
# packages using python-any-r1, and there is no need ever to inherit
# both.
#
-# For more information, please see the wiki:
-# https://wiki.gentoo.org/wiki/Project:Python/python-any-r1
+# For more information, please see the Python Guide:
+# https://dev.gentoo.org/~mgorny/python-guide/
case "${EAPI:-0}" in
[0-4]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;;
diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
index dd350a436fa5..cd4c22aa0bd8 100644
--- a/eclass/python-r1.eclass
+++ b/eclass/python-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: python-r1.eclass
@@ -26,8 +26,8 @@
# in the packages using python-r1, and there is no need ever to inherit
# both.
#
-# For more information, please see the wiki:
-# https://wiki.gentoo.org/wiki/Project:Python/python-r1
+# For more information, please see the Python Guide:
+# https://dev.gentoo.org/~mgorny/python-guide/
case "${EAPI:-0}" in
0|1|2|3|4)
diff --git a/eclass/python-single-r1.eclass b/eclass/python-single-r1.eclass
index 739a394ddd18..87e1cb97deda 100644
--- a/eclass/python-single-r1.eclass
+++ b/eclass/python-single-r1.eclass
@@ -33,8 +33,8 @@
# in the packages using python-single-r1, and there is no need ever
# to inherit both.
#
-# For more information, please see the wiki:
-# https://wiki.gentoo.org/wiki/Project:Python/python-single-r1
+# For more information, please see the Python Guide:
+# https://dev.gentoo.org/~mgorny/python-guide/
case "${EAPI:-0}" in
0|1|2|3|4)
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 91a32434dfaa..bb7f1a232688 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: python-utils-r1.eclass
@@ -16,8 +16,8 @@
# This eclass does not set any metadata variables nor export any phase
# functions. It can be inherited safely.
#
-# For more information, please see the wiki:
-# https://wiki.gentoo.org/wiki/Project:Python/python-utils-r1
+# For more information, please see the Python Guide:
+# https://dev.gentoo.org/~mgorny/python-guide/
case "${EAPI:-0}" in
[0-4]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;;
--
2.25.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-dev] [PATCH 2/9] python-utils-r1.eclass: Mark _python_check_locale_sanity @INTERNAL
2020-03-04 14:32 [gentoo-dev] [PATCH 0/9] python-r1 suite cleanup Michał Górny
2020-03-04 14:32 ` [gentoo-dev] [PATCH 1/9] python*-r1.eclass, distutils-r1.eclass: Link to Python Guide Michał Górny
@ 2020-03-04 14:32 ` Michał Górny
2020-03-04 14:32 ` [gentoo-dev] [PATCH 3/9] python-utils-r1.eclass: Update docs to use python_setup Michał Górny
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Michał Górny @ 2020-03-04 14:32 UTC (permalink / raw
To: gentoo-dev; +Cc: python, Michał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
eclass/python-utils-r1.eclass | 1 +
1 file changed, 1 insertion(+)
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index bb7f1a232688..37ab9c84eda6 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1261,6 +1261,7 @@ python_fix_shebang() {
# @FUNCTION: _python_check_locale_sanity
# @USAGE: <locale>
+# @INTERNAL
# @RETURN: 0 if sane, 1 otherwise
# @DESCRIPTION:
# Check whether the specified locale sanely maps between lowercase
--
2.25.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-dev] [PATCH 3/9] python-utils-r1.eclass: Update docs to use python_setup
2020-03-04 14:32 [gentoo-dev] [PATCH 0/9] python-r1 suite cleanup Michał Górny
2020-03-04 14:32 ` [gentoo-dev] [PATCH 1/9] python*-r1.eclass, distutils-r1.eclass: Link to Python Guide Michał Górny
2020-03-04 14:32 ` [gentoo-dev] [PATCH 2/9] python-utils-r1.eclass: Mark _python_check_locale_sanity @INTERNAL Michał Górny
@ 2020-03-04 14:32 ` Michał Górny
2020-03-04 14:32 ` [gentoo-dev] [PATCH 4/9] python-r1.eclass: Report impl used by python_setup Michał Górny
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Michał Górny @ 2020-03-04 14:32 UTC (permalink / raw
To: gentoo-dev; +Cc: python, Michał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
eclass/python-utils-r1.eclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 37ab9c84eda6..2791fae42112 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -198,7 +198,7 @@ _python_impl_matches() {
# This variable is set automatically in the following contexts:
#
# python-r1: Set in functions called by python_foreach_impl() or after
-# calling python_export_best().
+# calling python_setup().
#
# python-single-r1: Set after calling python-single-r1_pkg_setup().
#
@@ -217,7 +217,7 @@ _python_impl_matches() {
# This variable is set automatically in the following contexts:
#
# python-r1: Set in functions called by python_foreach_impl() or after
-# calling python_export_best().
+# calling python_setup().
#
# python-single-r1: Set after calling python-single-r1_pkg_setup().
#
--
2.25.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-dev] [PATCH 4/9] python-r1.eclass: Report impl used by python_setup
2020-03-04 14:32 [gentoo-dev] [PATCH 0/9] python-r1 suite cleanup Michał Górny
` (2 preceding siblings ...)
2020-03-04 14:32 ` [gentoo-dev] [PATCH 3/9] python-utils-r1.eclass: Update docs to use python_setup Michał Górny
@ 2020-03-04 14:32 ` Michał Górny
2020-03-04 14:32 ` [gentoo-dev] [PATCH 5/9] python-any-r1.eclass: " Michał Górny
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Michał Górny @ 2020-03-04 14:32 UTC (permalink / raw
To: gentoo-dev; +Cc: python, Michał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
eclass/python-r1.eclass | 1 +
1 file changed, 1 insertion(+)
diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
index cd4c22aa0bd8..960fed8c451a 100644
--- a/eclass/python-r1.eclass
+++ b/eclass/python-r1.eclass
@@ -785,6 +785,7 @@ python_setup() {
fi
python_wrapper_setup
+ einfo "Using ${EPYTHON} in global scope"
}
# @FUNCTION: python_replicate_script
--
2.25.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-dev] [PATCH 5/9] python-any-r1.eclass: Report impl used by python_setup
2020-03-04 14:32 [gentoo-dev] [PATCH 0/9] python-r1 suite cleanup Michał Górny
` (3 preceding siblings ...)
2020-03-04 14:32 ` [gentoo-dev] [PATCH 4/9] python-r1.eclass: Report impl used by python_setup Michał Górny
@ 2020-03-04 14:32 ` Michał Górny
2020-03-04 14:32 ` [gentoo-dev] [PATCH 6/9] python-single-r1.eclass: " Michał Górny
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Michał Górny @ 2020-03-04 14:32 UTC (permalink / raw
To: gentoo-dev; +Cc: python, Michał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
eclass/python-any-r1.eclass | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass
index 5d74c8acd3e4..66c6965c04ea 100644
--- a/eclass/python-any-r1.eclass
+++ b/eclass/python-any-r1.eclass
@@ -301,6 +301,7 @@ python_setup() {
python_export "${impls[0]}" EPYTHON PYTHON
python_wrapper_setup
+ einfo "Using ${EPYTHON} to build"
return
fi
@@ -309,6 +310,7 @@ python_setup() {
if _python_EPYTHON_supported "${EPYTHON}"; then
python_export EPYTHON PYTHON
python_wrapper_setup
+ einfo "Using ${EPYTHON} to build"
return
fi
fi
@@ -324,6 +326,7 @@ python_setup() {
elif _python_EPYTHON_supported "${i}"; then
python_export "${i}" EPYTHON PYTHON
python_wrapper_setup
+ einfo "Using ${EPYTHON} to build"
return
fi
done
@@ -334,6 +337,7 @@ python_setup() {
python_export "${_PYTHON_SUPPORTED_IMPLS[i]}" EPYTHON PYTHON
if _python_EPYTHON_supported "${EPYTHON}"; then
python_wrapper_setup
+ einfo "Using ${EPYTHON} to build"
return
fi
done
--
2.25.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-dev] [PATCH 6/9] python-single-r1.eclass: Report impl used by python_setup
2020-03-04 14:32 [gentoo-dev] [PATCH 0/9] python-r1 suite cleanup Michał Górny
` (4 preceding siblings ...)
2020-03-04 14:32 ` [gentoo-dev] [PATCH 5/9] python-any-r1.eclass: " Michał Górny
@ 2020-03-04 14:32 ` Michał Górny
2020-03-04 14:32 ` [gentoo-dev] [PATCH 7/9] python-utils-r1.eclass: Remove leftover from virtual/pypy* Michał Górny
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Michał Górny @ 2020-03-04 14:32 UTC (permalink / raw
To: gentoo-dev; +Cc: python, Michał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
eclass/python-single-r1.eclass | 2 ++
1 file changed, 2 insertions(+)
diff --git a/eclass/python-single-r1.eclass b/eclass/python-single-r1.eclass
index 87e1cb97deda..f9e26e7c334f 100644
--- a/eclass/python-single-r1.eclass
+++ b/eclass/python-single-r1.eclass
@@ -467,6 +467,7 @@ python_setup() {
python_export "${impls[0]}" EPYTHON PYTHON
python_wrapper_setup
+ einfo "Using ${EPYTHON} to build"
return
fi
@@ -484,6 +485,7 @@ python_setup() {
python_export "${impl}" EPYTHON PYTHON
python_wrapper_setup
+ einfo "Using ${EPYTHON} to build"
fi
done
--
2.25.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-dev] [PATCH 7/9] python-utils-r1.eclass: Remove leftover from virtual/pypy*
2020-03-04 14:32 [gentoo-dev] [PATCH 0/9] python-r1 suite cleanup Michał Górny
` (5 preceding siblings ...)
2020-03-04 14:32 ` [gentoo-dev] [PATCH 6/9] python-single-r1.eclass: " Michał Górny
@ 2020-03-04 14:32 ` Michał Górny
2020-03-04 14:32 ` [gentoo-dev] [PATCH 8/9] distutils-r1.eclass: Do not require distutils-r1_python_install_all Michał Górny
2020-03-04 14:32 ` [gentoo-dev] [PATCH 9/9] distutils-r1.eclass: Make /usr/lib/pypy/share warning fatal Michał Górny
8 siblings, 0 replies; 10+ messages in thread
From: Michał Górny @ 2020-03-04 14:32 UTC (permalink / raw
To: gentoo-dev; +Cc: python, Michał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
eclass/python-utils-r1.eclass | 20 +++-----------------
1 file changed, 3 insertions(+), 17 deletions(-)
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 2791fae42112..325964e0e0e8 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1085,23 +1085,9 @@ python_is_installed() {
;;
esac
- case "${impl}" in
- pypy|pypy3)
- local append=
- if [[ ${PYTHON_REQ_USE} ]]; then
- append=[${PYTHON_REQ_USE}]
- fi
-
- # be happy with just the interpeter, no need for the virtual
- has_version "${hasv_args[@]}" "dev-python/${impl}${append}" \
- || has_version "${hasv_args[@]}" "dev-python/${impl}-bin${append}"
- ;;
- *)
- local PYTHON_PKG_DEP
- python_export "${impl}" PYTHON_PKG_DEP
- has_version "${hasv_args[@]}" "${PYTHON_PKG_DEP}"
- ;;
- esac
+ local PYTHON_PKG_DEP
+ python_export "${impl}" PYTHON_PKG_DEP
+ has_version "${hasv_args[@]}" "${PYTHON_PKG_DEP}"
}
# @FUNCTION: python_fix_shebang
--
2.25.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-dev] [PATCH 8/9] distutils-r1.eclass: Do not require distutils-r1_python_install_all
2020-03-04 14:32 [gentoo-dev] [PATCH 0/9] python-r1 suite cleanup Michał Górny
` (6 preceding siblings ...)
2020-03-04 14:32 ` [gentoo-dev] [PATCH 7/9] python-utils-r1.eclass: Remove leftover from virtual/pypy* Michał Górny
@ 2020-03-04 14:32 ` Michał Górny
2020-03-04 14:32 ` [gentoo-dev] [PATCH 9/9] distutils-r1.eclass: Make /usr/lib/pypy/share warning fatal Michał Górny
8 siblings, 0 replies; 10+ messages in thread
From: Michał Górny @ 2020-03-04 14:32 UTC (permalink / raw
To: gentoo-dev; +Cc: python, Michał Górny
Stop requiring ebuilds to call distutils-r1_python_install_all default
function. It just calls einstalldocs these days, and it is unlikely
that more magic will ever be added there.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
eclass/distutils-r1.eclass | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 8b7745686d73..abb86996c5d6 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -922,8 +922,6 @@ distutils-r1_python_install_all() {
)
docompress -x "/usr/share/doc/${PF}/examples"
fi
-
- _DISTUTILS_DEFAULT_CALLED=1
}
# @FUNCTION: distutils-r1_run_phase
@@ -1154,13 +1152,6 @@ distutils-r1_src_install() {
_distutils-r1_run_common_phase distutils-r1_python_install_all
fi
- if [[ ! ${_DISTUTILS_DEFAULT_CALLED} ]]; then
- local cmd=die
- [[ ${EAPI} == [45] ]] && cmd=eqawarn
-
- "${cmd}" "QA: python_install_all() didn't call distutils-r1_python_install_all"
- fi
-
_distutils-r1_check_namespace_pth
}
--
2.25.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-dev] [PATCH 9/9] distutils-r1.eclass: Make /usr/lib/pypy/share warning fatal
2020-03-04 14:32 [gentoo-dev] [PATCH 0/9] python-r1 suite cleanup Michał Górny
` (7 preceding siblings ...)
2020-03-04 14:32 ` [gentoo-dev] [PATCH 8/9] distutils-r1.eclass: Do not require distutils-r1_python_install_all Michał Górny
@ 2020-03-04 14:32 ` Michał Górny
8 siblings, 0 replies; 10+ messages in thread
From: Michał Górny @ 2020-03-04 14:32 UTC (permalink / raw
To: gentoo-dev; +Cc: python, Michał Górny
All the share-related issues should have been fixed by the PyPy patch
by now, and since PyPy target is not stable, there is really no need
to be very graceful here.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
eclass/distutils-r1.eclass | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index abb86996c5d6..0ee0dc27c345 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -894,9 +894,7 @@ distutils-r1_python_install() {
${shopt_save}
if [[ -n ${pypy_dirs} ]]; then
- local cmd=die
- [[ ${EAPI} == [45] ]] && cmd=eqawarn
- "${cmd}" "Package installs 'share' in PyPy prefix, see bug #465546."
+ die "Package installs 'share' in PyPy prefix, see bug #465546."
fi
if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
--
2.25.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
end of thread, other threads:[~2020-03-04 14:35 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-04 14:32 [gentoo-dev] [PATCH 0/9] python-r1 suite cleanup Michał Górny
2020-03-04 14:32 ` [gentoo-dev] [PATCH 1/9] python*-r1.eclass, distutils-r1.eclass: Link to Python Guide Michał Górny
2020-03-04 14:32 ` [gentoo-dev] [PATCH 2/9] python-utils-r1.eclass: Mark _python_check_locale_sanity @INTERNAL Michał Górny
2020-03-04 14:32 ` [gentoo-dev] [PATCH 3/9] python-utils-r1.eclass: Update docs to use python_setup Michał Górny
2020-03-04 14:32 ` [gentoo-dev] [PATCH 4/9] python-r1.eclass: Report impl used by python_setup Michał Górny
2020-03-04 14:32 ` [gentoo-dev] [PATCH 5/9] python-any-r1.eclass: " Michał Górny
2020-03-04 14:32 ` [gentoo-dev] [PATCH 6/9] python-single-r1.eclass: " Michał Górny
2020-03-04 14:32 ` [gentoo-dev] [PATCH 7/9] python-utils-r1.eclass: Remove leftover from virtual/pypy* Michał Górny
2020-03-04 14:32 ` [gentoo-dev] [PATCH 8/9] distutils-r1.eclass: Do not require distutils-r1_python_install_all Michał Górny
2020-03-04 14:32 ` [gentoo-dev] [PATCH 9/9] distutils-r1.eclass: Make /usr/lib/pypy/share warning fatal 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