* [gentoo-dev] [PATCH 0/7] Initial support for EAPI 7 for python-r1 suite
@ 2018-05-03 14:12 Michał Górny
2018-05-03 14:12 ` [gentoo-dev] [PATCH 1/7] python-utils-r1.eclass: Initial EAPI 7 support Michał Górny
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: Michał Górny @ 2018-05-03 14:12 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Hi,
Here are the initial EAPI 7 patches. Note that they do not provide
real cross support since we never did provide one.
--
Best regards,
Michał Górny
Michał Górny (7):
python-utils-r1.eclass: Initial EAPI 7 support
python-any-r1.eclass: Enable EAPI 7 (no changes)
python-single-r1.eclass: Enable EAPI 7 (no changes)
python-r1.eclass: Enable EAPI 7 (no changes)
distutils-r1.eclass: Remove xdg_environment_reset in EAPI 7
distutils-r1.eclass: Call python via ${EPYTHON}, not full path
distutils-r1.eclass: Enable EAPI 7 support
eclass/distutils-r1.eclass | 25 ++++++++++++--------
eclass/python-any-r1.eclass | 4 ++--
eclass/python-r1.eclass | 4 ++--
eclass/python-single-r1.eclass | 4 ++--
eclass/python-utils-r1.eclass | 43 +++++++++++++++++++++-------------
5 files changed, 48 insertions(+), 32 deletions(-)
--
2.17.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [gentoo-dev] [PATCH 1/7] python-utils-r1.eclass: Initial EAPI 7 support
2018-05-03 14:12 [gentoo-dev] [PATCH 0/7] Initial support for EAPI 7 for python-r1 suite Michał Górny
@ 2018-05-03 14:12 ` Michał Górny
2018-05-03 14:12 ` [gentoo-dev] [PATCH 2/7] python-any-r1.eclass: Enable EAPI 7 (no changes) Michał Górny
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Michał Górny @ 2018-05-03 14:12 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Add initial EAPI 7 support. Handle trailing slash in D/ED correctly.
Support new has_version switches.
This does not provide proper cross support. In particular, the PYTHON
variable (full path to the interpreter) is used both in contexts
of BDEPEND and DEPEND, so we need to clean the uses first.
---
eclass/python-utils-r1.eclass | 43 ++++++++++++++++++++++-------------
1 file changed, 27 insertions(+), 16 deletions(-)
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 68fb9ba2578d..3a462e34614a 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: python-utils-r1.eclass
@@ -19,7 +19,7 @@
# https://wiki.gentoo.org/wiki/Project:Python/python-utils-r1
case "${EAPI:-0}" in
- 0|1|2|3|4|5|6)
+ 0|1|2|3|4|5|6|7)
;;
*)
die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
@@ -688,8 +688,8 @@ python_optimize() {
# 2) skip paths which do not exist
# (python2.6 complains about them verbosely)
- if [[ ${f} == /* && -d ${D}${f} ]]; then
- set -- "${D}${f}" "${@}"
+ if [[ ${f} == /* && -d ${D%/}${f} ]]; then
+ set -- "${D%/}${f}" "${@}"
fi
done < <("${PYTHON}" -c 'import sys; print("\0".join(sys.path))' || die)
@@ -699,7 +699,7 @@ python_optimize() {
local d
for d; do
# make sure to get a nice path without //
- local instpath=${d#${D}}
+ local instpath=${d#${D%/}}
instpath=/${instpath##/}
case "${EPYTHON}" in
@@ -924,7 +924,7 @@ python_domodule() {
doins -r "${@}" || return ${?}
)
- python_optimize "${ED}/${d}"
+ python_optimize "${ED%/}/${d}"
}
# @FUNCTION: python_doheader
@@ -1086,9 +1086,20 @@ python_is_python3() {
python_is_installed() {
local impl=${1:-${EPYTHON}}
[[ ${impl} ]] || die "${FUNCNAME}: no impl nor EPYTHON"
+ local hasv_args=()
+
+ case ${EAPI:-0} in
+ 0|1|2|3|4)
+ local -x ROOT=/
+ ;;
+ 5|6)
+ hasv_args+=( --host-root )
+ ;;
+ *)
+ hasv_args+=( -b )
+ ;;
+ esac
- # for has_version
- local -x ROOT=/
case "${impl}" in
pypy|pypy3)
local append=
@@ -1097,13 +1108,13 @@ python_is_installed() {
fi
# be happy with just the interpeter, no need for the virtual
- has_version "dev-python/${impl}${append}" \
- || has_version "dev-python/${impl}-bin${append}"
+ 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 "${PYTHON_PKG_DEP}"
+ has_version "${hasv_args[@]}" "${PYTHON_PKG_DEP}"
;;
esac
}
@@ -1167,7 +1178,7 @@ python_fix_shebang() {
for i in "${split_shebang[@]}"; do
case "${i}" in
*"${EPYTHON}")
- debug-print "${FUNCNAME}: in file ${f#${D}}"
+ debug-print "${FUNCNAME}: in file ${f#${D%/}}"
debug-print "${FUNCNAME}: shebang matches EPYTHON: ${shebang}"
# Nothing to do, move along.
@@ -1176,7 +1187,7 @@ python_fix_shebang() {
break
;;
*python|*python[23])
- debug-print "${FUNCNAME}: in file ${f#${D}}"
+ debug-print "${FUNCNAME}: in file ${f#${D%/}}"
debug-print "${FUNCNAME}: rewriting shebang: ${shebang}"
if [[ ${i} == *python2 ]]; then
@@ -1226,7 +1237,7 @@ python_fix_shebang() {
fi
if [[ ! ${quiet} ]]; then
- einfo "Fixing shebang in ${f#${D}}."
+ einfo "Fixing shebang in ${f#${D%/}}."
fi
if [[ ! ${error} ]]; then
@@ -1240,7 +1251,7 @@ python_fix_shebang() {
any_fixed=1
else
eerror "The file has incompatible shebang:"
- eerror " file: ${f#${D}}"
+ eerror " file: ${f#${D%/}}"
eerror " current shebang: ${shebang}"
eerror " requested impl: ${EPYTHON}"
die "${FUNCNAME}: conversion of incompatible shebang requested"
@@ -1251,7 +1262,7 @@ python_fix_shebang() {
local cmd=eerror
[[ ${EAPI:-0} == [012345] ]] && cmd=eqawarn
- "${cmd}" "QA warning: ${FUNCNAME}, ${path#${D}} did not match any fixable files."
+ "${cmd}" "QA warning: ${FUNCNAME}, ${path#${D%/}} did not match any fixable files."
if [[ ${any_correct} ]]; then
"${cmd}" "All files have ${EPYTHON} shebang already."
else
--
2.17.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [gentoo-dev] [PATCH 2/7] python-any-r1.eclass: Enable EAPI 7 (no changes)
2018-05-03 14:12 [gentoo-dev] [PATCH 0/7] Initial support for EAPI 7 for python-r1 suite Michał Górny
2018-05-03 14:12 ` [gentoo-dev] [PATCH 1/7] python-utils-r1.eclass: Initial EAPI 7 support Michał Górny
@ 2018-05-03 14:12 ` Michał Górny
2018-05-03 14:12 ` [gentoo-dev] [PATCH 3/7] python-single-r1.eclass: " Michał Górny
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Michał Górny @ 2018-05-03 14:12 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
---
eclass/python-any-r1.eclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass
index e4d2d46bc706..6f23109cf8d7 100644
--- a/eclass/python-any-r1.eclass
+++ b/eclass/python-any-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: python-any-r1.eclass
@@ -36,7 +36,7 @@
# https://wiki.gentoo.org/wiki/Project:Python/python-any-r1
case "${EAPI:-0}" in
- 0|1|2|3|4|5|6)
+ 0|1|2|3|4|5|6|7)
;;
*)
die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
--
2.17.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [gentoo-dev] [PATCH 3/7] python-single-r1.eclass: Enable EAPI 7 (no changes)
2018-05-03 14:12 [gentoo-dev] [PATCH 0/7] Initial support for EAPI 7 for python-r1 suite Michał Górny
2018-05-03 14:12 ` [gentoo-dev] [PATCH 1/7] python-utils-r1.eclass: Initial EAPI 7 support Michał Górny
2018-05-03 14:12 ` [gentoo-dev] [PATCH 2/7] python-any-r1.eclass: Enable EAPI 7 (no changes) Michał Górny
@ 2018-05-03 14:12 ` Michał Górny
2018-05-03 14:12 ` [gentoo-dev] [PATCH 4/7] python-r1.eclass: " Michał Górny
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Michał Górny @ 2018-05-03 14:12 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
---
eclass/python-single-r1.eclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/eclass/python-single-r1.eclass b/eclass/python-single-r1.eclass
index 3762d3d6e990..8c45c391ebb0 100644
--- a/eclass/python-single-r1.eclass
+++ b/eclass/python-single-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: python-single-r1.eclass
@@ -34,7 +34,7 @@ case "${EAPI:-0}" in
0|1|2|3|4)
die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
;;
- 5|6)
+ 5|6|7)
# EAPI=5 is required for sane USE_EXPAND dependencies
;;
*)
--
2.17.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [gentoo-dev] [PATCH 4/7] python-r1.eclass: Enable EAPI 7 (no changes)
2018-05-03 14:12 [gentoo-dev] [PATCH 0/7] Initial support for EAPI 7 for python-r1 suite Michał Górny
` (2 preceding siblings ...)
2018-05-03 14:12 ` [gentoo-dev] [PATCH 3/7] python-single-r1.eclass: " Michał Górny
@ 2018-05-03 14:12 ` Michał Górny
2018-05-03 14:12 ` [gentoo-dev] [PATCH 5/7] distutils-r1.eclass: Remove xdg_environment_reset in EAPI 7 Michał Górny
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Michał Górny @ 2018-05-03 14:12 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
---
eclass/python-r1.eclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
index 5ec23d23d8cc..8a8adb449cc3 100644
--- a/eclass/python-r1.eclass
+++ b/eclass/python-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: python-r1.eclass
@@ -32,7 +32,7 @@ case "${EAPI:-0}" in
0|1|2|3|4)
die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
;;
- 5|6)
+ 5|6|7)
# EAPI=5 is required for sane USE_EXPAND dependencies
;;
*)
--
2.17.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [gentoo-dev] [PATCH 5/7] distutils-r1.eclass: Remove xdg_environment_reset in EAPI 7
2018-05-03 14:12 [gentoo-dev] [PATCH 0/7] Initial support for EAPI 7 for python-r1 suite Michał Górny
` (3 preceding siblings ...)
2018-05-03 14:12 ` [gentoo-dev] [PATCH 4/7] python-r1.eclass: " Michał Górny
@ 2018-05-03 14:12 ` Michał Górny
2018-05-03 14:12 ` [gentoo-dev] [PATCH 6/7] distutils-r1.eclass: Call python via ${EPYTHON}, not full path Michał Górny
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Michał Górny @ 2018-05-03 14:12 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Limit xdg_environment_reset call to EAPIs 5 & 6. It should no longer
be necessary with ENV_UNSET done in EAPI 7.
---
eclass/distutils-r1.eclass | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index dd0c429d50fc..ede30b280863 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: distutils-r1.eclass
@@ -79,7 +79,8 @@ esac
if [[ ! ${_DISTUTILS_R1} ]]; then
[[ ${EAPI} == [45] ]] && inherit eutils
-inherit toolchain-funcs xdg-utils
+[[ ${EAPI} == [56] ]] && inherit xdg-utils
+inherit toolchain-funcs
if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
inherit multiprocessing python-r1
@@ -739,7 +740,7 @@ distutils-r1_src_prepare() {
distutils-r1_src_configure() {
python_export_utf8_locale
- xdg_environment_reset # Bug 577704
+ [[ ${EAPI} == [56] ]] && xdg_environment_reset # Bug 577704
if declare -f python_configure >/dev/null; then
_distutils-r1_run_foreach_impl python_configure
--
2.17.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [gentoo-dev] [PATCH 6/7] distutils-r1.eclass: Call python via ${EPYTHON}, not full path
2018-05-03 14:12 [gentoo-dev] [PATCH 0/7] Initial support for EAPI 7 for python-r1 suite Michał Górny
` (4 preceding siblings ...)
2018-05-03 14:12 ` [gentoo-dev] [PATCH 5/7] distutils-r1.eclass: Remove xdg_environment_reset in EAPI 7 Michał Górny
@ 2018-05-03 14:12 ` Michał Górny
2018-05-03 14:12 ` [gentoo-dev] [PATCH 7/7] distutils-r1.eclass: Enable EAPI 7 support Michał Górny
2018-05-03 19:33 ` [gentoo-dev] [PATCH 0/7] Initial support for EAPI 7 for python-r1 suite Mike Gilbert
7 siblings, 0 replies; 9+ messages in thread
From: Michał Górny @ 2018-05-03 14:12 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
---
eclass/distutils-r1.eclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index ede30b280863..26fa0069a73d 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -231,7 +231,7 @@ fi
# @USAGE: [<args>...]
# @DESCRIPTION:
# Run setup.py using currently selected Python interpreter
-# (if ${PYTHON} is set; fallback 'python' otherwise).
+# (if ${EPYTHON} is set; fallback 'python' otherwise).
#
# setup.py will be passed the following, in order:
# 1. ${mydistutilsargs[@]}
@@ -250,7 +250,7 @@ esetup.py() {
[[ ${BUILD_DIR} ]] && _distutils-r1_create_setup_cfg
- set -- "${PYTHON:-python}" setup.py "${mydistutilsargs[@]}" "${@}"
+ set -- "${EPYTHON:-python}" setup.py "${mydistutilsargs[@]}" "${@}"
echo "${@}" >&2
"${@}" || die "${die_args[@]}"
--
2.17.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [gentoo-dev] [PATCH 7/7] distutils-r1.eclass: Enable EAPI 7 support
2018-05-03 14:12 [gentoo-dev] [PATCH 0/7] Initial support for EAPI 7 for python-r1 suite Michał Górny
` (5 preceding siblings ...)
2018-05-03 14:12 ` [gentoo-dev] [PATCH 6/7] distutils-r1.eclass: Call python via ${EPYTHON}, not full path Michał Górny
@ 2018-05-03 14:12 ` Michał Górny
2018-05-03 19:33 ` [gentoo-dev] [PATCH 0/7] Initial support for EAPI 7 for python-r1 suite Mike Gilbert
7 siblings, 0 replies; 9+ messages in thread
From: Michał Górny @ 2018-05-03 14:12 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Support EAPI 7. Move PYTHON_DEPS from DEPEND to BDEPEND. Fix trailing
slash uses for D/ED.
---
eclass/distutils-r1.eclass | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 26fa0069a73d..975383acc09b 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -46,7 +46,7 @@ case "${EAPI:-0}" in
0|1|2|3|4)
die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
;;
- 5|6)
+ 5|6|7)
;;
*)
die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
@@ -98,7 +98,11 @@ if [[ ! ${_DISTUTILS_R1} ]]; then
if [[ ! ${DISTUTILS_OPTIONAL} ]]; then
RDEPEND=${PYTHON_DEPS}
- DEPEND=${PYTHON_DEPS}
+ if [[ ${EAPI} != [56] ]]; then
+ BDEPEND=${PYTHON_DEPS}
+ else
+ DEPEND=${PYTHON_DEPS}
+ fi
REQUIRED_USE=${PYTHON_REQUIRED_USE}
fi
@@ -413,7 +417,7 @@ _distutils-r1_create_setup_cfg() {
[install]
compile = True
optimize = 2
- root = ${D}
+ root = ${D%/}
_EOF_
if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
@@ -583,7 +587,7 @@ distutils-r1_python_install() {
if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
_distutils-r1_wrap_scripts "${root}" "${scriptdir}"
- multibuild_merge_root "${root}" "${D}"
+ multibuild_merge_root "${root}" "${D%/}"
fi
}
@@ -798,7 +802,7 @@ _distutils-r1_check_namespace_pth() {
while IFS= read -r -d '' f; do
pth+=( "${f}" )
- done < <(find "${ED}" -name '*-nspkg.pth' -print0)
+ done < <(find "${ED%/}" -name '*-nspkg.pth' -print0)
if [[ ${pth[@]} ]]; then
ewarn "The following *-nspkg.pth files were found installed:"
--
2.17.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [gentoo-dev] [PATCH 0/7] Initial support for EAPI 7 for python-r1 suite
2018-05-03 14:12 [gentoo-dev] [PATCH 0/7] Initial support for EAPI 7 for python-r1 suite Michał Górny
` (6 preceding siblings ...)
2018-05-03 14:12 ` [gentoo-dev] [PATCH 7/7] distutils-r1.eclass: Enable EAPI 7 support Michał Górny
@ 2018-05-03 19:33 ` Mike Gilbert
7 siblings, 0 replies; 9+ messages in thread
From: Mike Gilbert @ 2018-05-03 19:33 UTC (permalink / raw
To: Gentoo Dev; +Cc: Michał Górny
On Thu, May 3, 2018 at 10:12 AM, Michał Górny <mgorny@gentoo.org> wrote:
> Hi,
>
> Here are the initial EAPI 7 patches. Note that they do not provide
> real cross support since we never did provide one.
Looks ok to me.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2018-05-03 19:34 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-03 14:12 [gentoo-dev] [PATCH 0/7] Initial support for EAPI 7 for python-r1 suite Michał Górny
2018-05-03 14:12 ` [gentoo-dev] [PATCH 1/7] python-utils-r1.eclass: Initial EAPI 7 support Michał Górny
2018-05-03 14:12 ` [gentoo-dev] [PATCH 2/7] python-any-r1.eclass: Enable EAPI 7 (no changes) Michał Górny
2018-05-03 14:12 ` [gentoo-dev] [PATCH 3/7] python-single-r1.eclass: " Michał Górny
2018-05-03 14:12 ` [gentoo-dev] [PATCH 4/7] python-r1.eclass: " Michał Górny
2018-05-03 14:12 ` [gentoo-dev] [PATCH 5/7] distutils-r1.eclass: Remove xdg_environment_reset in EAPI 7 Michał Górny
2018-05-03 14:12 ` [gentoo-dev] [PATCH 6/7] distutils-r1.eclass: Call python via ${EPYTHON}, not full path Michał Górny
2018-05-03 14:12 ` [gentoo-dev] [PATCH 7/7] distutils-r1.eclass: Enable EAPI 7 support Michał Górny
2018-05-03 19:33 ` [gentoo-dev] [PATCH 0/7] Initial support for EAPI 7 for python-r1 suite Mike Gilbert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox