Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: python@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH] python-utils-r1.eclass: Make python_wrapper_setup private
Date: Thu, 19 Mar 2020 21:26:38
Message-Id: 20200319212605.316447-1-mgorny@gentoo.org
1 This function was never meant to be a part of the public API. Correct
2 the mistake by renaming it to _python_wrapper_setup(), and adding a QA
3 warning under the old name.
4
5 Signed-off-by: Michał Górny <mgorny@g.o>
6 ---
7 eclass/python-any-r1.eclass | 8 ++++----
8 eclass/python-r1.eclass | 4 ++--
9 eclass/python-single-r1.eclass | 4 ++--
10 eclass/python-utils-r1.eclass | 16 +++++++++++++++-
11 4 files changed, 23 insertions(+), 9 deletions(-)
12
13 diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass
14 index 66c6965c04ea..d16677debd2a 100644
15 --- a/eclass/python-any-r1.eclass
16 +++ b/eclass/python-any-r1.eclass
17 @@ -300,7 +300,7 @@ python_setup() {
18 ewarn "Dependencies won't be satisfied, and EPYTHON/eselect-python will be ignored."
19
20 python_export "${impls[0]}" EPYTHON PYTHON
21 - python_wrapper_setup
22 + _python_wrapper_setup
23 einfo "Using ${EPYTHON} to build"
24 return
25 fi
26 @@ -309,7 +309,7 @@ python_setup() {
27 if [[ ${EPYTHON} ]]; then
28 if _python_EPYTHON_supported "${EPYTHON}"; then
29 python_export EPYTHON PYTHON
30 - python_wrapper_setup
31 + _python_wrapper_setup
32 einfo "Using ${EPYTHON} to build"
33 return
34 fi
35 @@ -325,7 +325,7 @@ python_setup() {
36 break
37 elif _python_EPYTHON_supported "${i}"; then
38 python_export "${i}" EPYTHON PYTHON
39 - python_wrapper_setup
40 + _python_wrapper_setup
41 einfo "Using ${EPYTHON} to build"
42 return
43 fi
44 @@ -336,7 +336,7 @@ python_setup() {
45 for (( i = ${#_PYTHON_SUPPORTED_IMPLS[@]} - 1; i >= 0; i-- )); do
46 python_export "${_PYTHON_SUPPORTED_IMPLS[i]}" EPYTHON PYTHON
47 if _python_EPYTHON_supported "${EPYTHON}"; then
48 - python_wrapper_setup
49 + _python_wrapper_setup
50 einfo "Using ${EPYTHON} to build"
51 return
52 fi
53 diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
54 index 960fed8c451a..3ac35e401217 100644
55 --- a/eclass/python-r1.eclass
56 +++ b/eclass/python-r1.eclass
57 @@ -638,7 +638,7 @@ _python_multibuild_wrapper() {
58 local -x EPYTHON PYTHON
59 local -x PATH=${PATH} PKG_CONFIG_PATH=${PKG_CONFIG_PATH}
60 python_export "${MULTIBUILD_VARIANT}" EPYTHON PYTHON
61 - python_wrapper_setup
62 + _python_wrapper_setup
63
64 "${@}"
65 }
66 @@ -784,7 +784,7 @@ python_setup() {
67 die "${FUNCNAME}: no enabled implementation satisfy requirements"
68 fi
69
70 - python_wrapper_setup
71 + _python_wrapper_setup
72 einfo "Using ${EPYTHON} in global scope"
73 }
74
75 diff --git a/eclass/python-single-r1.eclass b/eclass/python-single-r1.eclass
76 index f9e26e7c334f..888db3631d9c 100644
77 --- a/eclass/python-single-r1.eclass
78 +++ b/eclass/python-single-r1.eclass
79 @@ -466,7 +466,7 @@ python_setup() {
80 ewarn "Dependencies won't be satisfied, and PYTHON_SINGLE_TARGET flags will be ignored."
81
82 python_export "${impls[0]}" EPYTHON PYTHON
83 - python_wrapper_setup
84 + _python_wrapper_setup
85 einfo "Using ${EPYTHON} to build"
86 return
87 fi
88 @@ -484,7 +484,7 @@ python_setup() {
89 fi
90
91 python_export "${impl}" EPYTHON PYTHON
92 - python_wrapper_setup
93 + _python_wrapper_setup
94 einfo "Using ${EPYTHON} to build"
95 fi
96 done
97 diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
98 index f144cbbb1279..d6fec6446320 100644
99 --- a/eclass/python-utils-r1.eclass
100 +++ b/eclass/python-utils-r1.eclass
101 @@ -950,6 +950,20 @@ python_doheader() {
102 # @FUNCTION: python_wrapper_setup
103 # @USAGE: [<path> [<impl>]]
104 # @DESCRIPTION:
105 +# Backwards compatibility function. The relevant API is now considered
106 +# private, please use python_setup instead.
107 +python_wrapper_setup() {
108 + debug-print-function ${FUNCNAME} "${@}"
109 +
110 + eqawarn "python_wrapper_setup() is part of private eclass API."
111 + eqawarn "Please call python_setup() instead."
112 +
113 + _python_wrapper_setup "${@}"
114 +}
115 +
116 +# @FUNCTION: _python_wrapper_setup
117 +# @USAGE: [<path> [<impl>]]
118 +# @DESCRIPTION:
119 # Create proper 'python' executable and pkg-config wrappers
120 # (if available) in the directory named by <path>. Set up PATH
121 # and PKG_CONFIG_PATH appropriately. <path> defaults to ${T}/${EPYTHON}.
122 @@ -961,7 +975,7 @@ python_doheader() {
123 # be assumed to contain proper wrappers already and only environment
124 # setup will be done. If wrapper update is requested, the directory
125 # shall be removed first.
126 -python_wrapper_setup() {
127 +_python_wrapper_setup() {
128 debug-print-function ${FUNCNAME} "${@}"
129
130 local workdir=${1:-${T}/${EPYTHON}}
131 --
132 2.25.2