Skip to content

Commit 6b6bdc7

Browse files
committed
inc/python: Remove ability to mark packages as non-Python3
Everything in OpenStack *must* be Python 3 supporting now, which means it's time to remove the functionality that allows us to blacklist packages that didn't support Python 3. Change-Id: I7c8cf538ec88bd4056b0109f19671e3d65f5da3a Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
1 parent 035b41b commit 6b6bdc7

File tree

3 files changed

+5
-104
lines changed

3 files changed

+5
-104
lines changed

inc/python

Lines changed: 5 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -85,60 +85,8 @@ function pip_install_gr_extras {
8585
pip_install $clean_name[$extras]
8686
}
8787

88-
# python3_enabled_for() assumes the service(s) specified as arguments are
89-
# enabled for python 3 unless explicitly disabled. See python3_disabled_for().
90-
#
91-
# Multiple services specified as arguments are ``OR``'ed together; the test
92-
# is a short-circuit boolean, i.e it returns on the first match.
93-
#
94-
# python3_enabled_for dir [dir ...]
95-
function python3_enabled_for {
96-
local xtrace
97-
xtrace=$(set +o | grep xtrace)
98-
set +o xtrace
99-
100-
local enabled=1
101-
local dirs=$@
102-
local dir
103-
for dir in ${dirs}; do
104-
if ! python3_disabled_for "${dir}"; then
105-
enabled=0
106-
fi
107-
done
108-
109-
$xtrace
110-
return $enabled
111-
}
112-
113-
# python3_disabled_for() checks if the service(s) specified as arguments are
114-
# disabled by the user in ``DISABLED_PYTHON3_PACKAGES``.
115-
#
116-
# Multiple services specified as arguments are ``OR``'ed together; the test
117-
# is a short-circuit boolean, i.e it returns on the first match.
118-
#
119-
# Uses global ``DISABLED_PYTHON3_PACKAGES``
120-
# python3_disabled_for dir [dir ...]
121-
function python3_disabled_for {
122-
local xtrace
123-
xtrace=$(set +o | grep xtrace)
124-
set +o xtrace
125-
126-
local enabled=1
127-
local dirs=$@
128-
local dir
129-
for dir in ${dirs}; do
130-
[[ ,${DISABLED_PYTHON3_PACKAGES}, =~ ,${dir}, ]] && enabled=0
131-
done
132-
133-
$xtrace
134-
return $enabled
135-
}
136-
13788
# enable_python3_package() -- no-op for backwards compatibility
13889
#
139-
# For example:
140-
# enable_python3_package nova
141-
#
14290
# enable_python3_package dir [dir ...]
14391
function enable_python3_package {
14492
local xtrace
@@ -150,25 +98,15 @@ function enable_python3_package {
15098
$xtrace
15199
}
152100

153-
# disable_python3_package() adds the services passed as argument to
154-
# the ``DISABLED_PYTHON3_PACKAGES`` list.
155-
#
156-
# For example:
157-
# disable_python3_package swift
101+
# disable_python3_package() -- no-op for backwards compatibility
158102
#
159-
# Uses global ``DISABLED_PYTHON3_PACKAGES``
160103
# disable_python3_package dir [dir ...]
161104
function disable_python3_package {
162105
local xtrace
163106
xtrace=$(set +o | grep xtrace)
164107
set +o xtrace
165108

166-
local disabled_svcs="${DISABLED_PYTHON3_PACKAGES}"
167-
local dir
168-
for dir in $@; do
169-
disabled_svcs+=",$dir"
170-
done
171-
DISABLED_PYTHON3_PACKAGES=$(_cleanup_service_list "$disabled_svcs")
109+
echo "It is no longer possible to call disable_python3_package()."
172110

173111
$xtrace
174112
}
@@ -231,17 +169,9 @@ function pip_install {
231169
# support for python3 in progress, but don't claim support
232170
# in their classifier
233171
echo "Check python version for : $package_dir"
234-
if python3_disabled_for ${package_dir##*/}; then
235-
echo "Explicitly using $PYTHON2_VERSION version to install $package_dir based on DISABLED_PYTHON3_PACKAGES"
236-
else
237-
# For everything that is not explicitly blacklisted with
238-
# DISABLED_PYTHON3_PACKAGES, assume it supports python3
239-
# and we will let pip sort out the install, regardless of
240-
# the package being local or remote.
241-
echo "Using $PYTHON3_VERSION version to install $package_dir based on default behavior"
242-
sudo_pip="$sudo_pip LC_ALL=en_US.UTF-8"
243-
cmd_pip=$(get_pip_command $PYTHON3_VERSION)
244-
fi
172+
echo "Using $PYTHON3_VERSION version to install $package_dir based on default behavior"
173+
sudo_pip="$sudo_pip LC_ALL=en_US.UTF-8"
174+
cmd_pip=$(get_pip_command $PYTHON3_VERSION)
245175
fi
246176
fi
247177

stackrc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,6 @@ fi
138138
# Control whether Python 3 should be used at all.
139139
export USE_PYTHON3=$(trueorfalse True USE_PYTHON3)
140140

141-
# Explicitly list services not to run under Python 3. See
142-
# disable_python3_package to edit this variable.
143-
export DISABLED_PYTHON3_PACKAGES=""
144-
145141
# When Python 3 is supported by an application, adding the specific
146142
# version of Python 3 to this variable will install the app using that
147143
# version of the interpreter instead of 2.7.

tests/test_python.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)