@@ -12,11 +12,14 @@ function create_virtualenv_for_pyinstaller {
12
12
# This currently assumes to be run with: Python 3.10.11
13
13
# Important: pyinstaller needs a Python binary with shared library files
14
14
# With pyenv, for example, you get this like so: env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.10.4
15
- # Use pyenv if available
16
- # if command -v pyenv >/dev/null 2>&1; then
17
- if /bin/false ; then
15
+ # Use pyenv if set as environment variable
16
+ if [ $USE_PYENV_FOR_SPECTER_BUILD = true ]; then
17
+ echo " Trying to use pyenv ..."
18
+ if ! command -v pyenv > /dev/null 2>&1 ; then
19
+ echo " Error: pyenv is not available. Please make sure pyenv is installed and configured properly." >&2
20
+ exit 1
21
+ fi
18
22
# ## This is usually in .zshrc, putting it in .bashrc didn't work ###
19
- # ##
20
23
export PYENV_ROOT=" $HOME /.pyenv"
21
24
command -v pyenv > /dev/null || export PATH=" $PYENV_ROOT /bin:$PATH "
22
25
eval " $( pyenv init -) "
@@ -26,11 +29,11 @@ function create_virtualenv_for_pyinstaller {
26
29
# ## ------------------------------------------------------------ ###
27
30
PYTHON_VERSION=3.10.11
28
31
export PYENV_VERSION=$PYTHON_VERSION
29
- echo " pyenv is available. Setting PYENV_VERSION to 3.10.4 , using pyenv-virtualenv to create the buildenv..."
32
+ echo " Setting PYENV_VERSION to 3.10.11 , using pyenv-virtualenv to create the buildenv..."
30
33
echo " --> Deleting .buildenv"
31
34
pyenv uninstall -f .buildenv
32
35
rm -rf " $HOME /.pyenv/versions/$PYTHON_VERSION /envs/.buildenv"
33
- pyenv virtualenv 3.10.4 .buildenv
36
+ pyenv virtualenv 3.10.11 .buildenv
34
37
pyenv activate .buildenv
35
38
else
36
39
echo " pyenv is not available. Using system Python version."
0 commit comments