Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add support for Python 3.12 in create_virtualenv script #116

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion util/jenkins/virtualenv_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,16 @@ function create_virtualenv () {
# create a unique hash for the job based location of where job is run
venvname="$(pwd | md5sum | cut -d' ' -f1)"

if [[ "$@" == *"--python=python3.12"* ]]; then
# Use python3.12 with -m virtualenv if Python 3.12 is specified
venv_exec="/opt/python3.12/bin/python3.12 -m virtualenv"
else
# Use the system default virtualenv for other Python versions
venv_exec="virtualenv"
fi

# create the virtualenv
virtualenv "$@" "$JOBVENVDIR/$venvname"
"$venv_exec" "$@" "$JOBVENVDIR/$venvname"

# This variable is created in global scope if function is sourced
# so we can access it after running this function.
Expand Down