Skip to content

Commit

Permalink
Add Python version modularity in venv scripts (#1504)
Browse files Browse the repository at this point in the history
Co-authored-by: Taner Topal <taner@adap.com>
  • Loading branch information
charlesbvll and tanertopal authored Dec 11, 2022
1 parent dac3450 commit dcd6657
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
10 changes: 8 additions & 2 deletions baselines/dev/venv-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,11 @@
set -e
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../

pyenv virtualenv 3.7.12 baselines-3.7.12
echo baselines-3.7.12 > .python-version
version=${1:-3.7.12}

# Check if the directory for the Python version does not exist and if so,
# install the right Python version through pyenv
[[ ! -d $PYENV_ROOT/versions/$version ]] && pyenv install $version

pyenv virtualenv $version baselines-$version
echo baselines-$version > .python-version
4 changes: 3 additions & 1 deletion baselines/dev/venv-delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
set -e
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../

pyenv uninstall -f baselines-3.7.12
version=${1:-3.7.12}

pyenv uninstall -f baselines-$version
10 changes: 8 additions & 2 deletions dev/venv-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,11 @@
set -e
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../

pyenv virtualenv 3.7.12 flower-3.7.12
echo flower-3.7.12 > .python-version
version=${1:-3.7.12}

# Check if the directory for the Python version does not exist and if so,
# install the right Python version through pyenv
[[ ! -d $PYENV_ROOT/versions/$version ]] && pyenv install $version

pyenv virtualenv $version flower-$version
echo flower-$version > .python-version
4 changes: 3 additions & 1 deletion dev/venv-delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
set -e
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../

pyenv uninstall -f flower-3.7.12
version=${1:-3.7.12}

pyenv uninstall -f flower-$version

0 comments on commit dcd6657

Please sign in to comment.