@@ -176,15 +176,14 @@ source "${VIRTUAL_ENV}/bin/activate"
176176
177177set -o nounset # abort on unbound variable
178178
179- # Use the latest version of pip
179+ # Use the latest version of pip and pipenv
180180pip3 install --upgrade pip
181+ pip3 install pipenv
181182
182- # Installs wheel package management, so that pulumi requirements install quickly
183- pip3 install wheel
184-
185- # Get nodeenv version so that node can be installed before we install Python
186- # dependencies because pulumi_eks depends on the presence of node.
187- pip3 install " $( grep nodeenv " ${script_dir} /../pulumi/python/requirements.txt" ) "
183+ # Install certain utility packages like `nodeenv` and `wheel` that aid
184+ # in the installation of other build tools and dependencies
185+ # required by the other python packages.
186+ PIPENV_VERBOSITY=-1 PIPENV_PIPFILE=" ${script_dir} /../pulumi/python/Pipfile" pipenv install --dev
188187
189188# Install node.js into virtual environment so that it can be used by Python
190189# modules that make call outs to it.
@@ -195,12 +194,15 @@ else
195194fi
196195
197196# Install general package requirements
198- pip3 install --requirement " ${script_dir} /../pulumi/python/requirements.txt"
197+ PIPENV_VERBOSITY=-1 PIPENV_PIPFILE=" ${script_dir} /../pulumi/python/Pipfile" pipenv install
198+
199199# Install local common utilities module
200- pip3 install " ${script_dir} /../pulumi/python/utility/kic-pulumi-utils" &&
201- rm -rf " ${script_dir} /../pulumi/python/utility/kic-pulumi-utils/.eggs" \
202- " ${script_dir} /../pulumi/python/utility/kic-pulumi-utils/build" \
203- " ${script_dir} /../pulumi/python/utility/kic-pulumi-utils/kic_pulumi_utils.egg-info"
200+ pip3 install " ${script_dir} /../pulumi/python/utility/kic-pulumi-utils"
201+
202+ rm -rf " ${script_dir} /../pulumi/python/utility/kic-pulumi-utils/.eggs" \
203+ " ${script_dir} /../pulumi/python/utility/kic-pulumi-utils/build" \
204+ " ${script_dir} /../pulumi/python/utility/kic-pulumi-utils/kic_pulumi_utils.egg-info"
205+
204206
205207ARCH=" "
206208case $( uname -m) in
@@ -265,20 +267,15 @@ else
265267 chmod +x " ${VIRTUAL_ENV} /bin/kubectl"
266268fi
267269
268- #
269270# Download Pulumi CLI tooling
270- #
271- # Added some error checking to handle a failure here since it can be a bit confusing to the user (or at least to me)
272- # when this bombs out and you can't figure out why. Note that the logic is specifically looking for "~=" in the
273- # requirements file. Other comparisons that are legal in terms of the requirements file WILL fail with this logic.
274- #
271+ # Regular expression and sed command from https://superuser.com/a/363878
275272echo " Downloading Pulumi CLI into virtual environment"
276- PULUMI_VERSION=" $( grep ' ^ pulumi~=.*$ ' " ${script_dir} /../pulumi/python/requirements.txt " | cut -d ' = ' -f2 || true ) "
273+ PULUMI_VERSION=" $( pip3 list | grep ' pulumi ' | sed -nre ' s/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p ' ) "
277274 if [ -z $PULUMI_VERSION ] ; then
278275 echo " Failed to find Pulumi version - EXITING"
279276 exit 5
280277 else
281- echo " Pulumi version found"
278+ echo " Pulumi version found: $PULUMI_VERSION "
282279 fi
283280
284281if [[ -x " ${VIRTUAL_ENV} /bin/pulumi" ]] && [[ " $( PULUMI_SKIP_UPDATE_CHECK=true " ${VIRTUAL_ENV} /bin/pulumi" version) " == " v${PULUMI_VERSION} " ]]; then
0 commit comments