Skip to content

Commit

Permalink
allow ci python version to override default in venv script
Browse files Browse the repository at this point in the history
  • Loading branch information
dec1 committed Jun 20, 2024
1 parent d0772e2 commit 9b7f908
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ jobs:
- name: Check out the repository
uses: actions/checkout@v4

- name: Set up Python 3.11
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'

- name: Set up dependencies (Linux)
if: runner.os == 'Linux'
run: |
cd prj/script
./venv_create.sh
./venv_create.sh 3.12
cd ../..
- name: Set up dependencies (Windows)
Expand Down
8 changes: 8 additions & 0 deletions prj/script/venv_create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
script_dir=$(dirname "$0")
source ${script_dir}/common.sh

# let caller (eg ci pipeline) override python version, by passing as arg to his script, eg
# - `venv_create.sh 3.11`
# if none passed then the python version used is
# - that set in `common.sh` if any, or if not set there then
# - whatever is found as "python" on path
py_ver=${1:-$py_ver}


echo "using python version: " ${py_ver}

python${py_ver} -m venv ${venv_dir}
Expand Down

0 comments on commit 9b7f908

Please sign in to comment.