File tree Expand file tree Collapse file tree
actions/create-virtualenv Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11---
22name : create virtualenv
3- description : create virtualenv using input name
3+ description : create virtualenv using input name in the default working directory
44
55inputs :
66 venv :
77 description : name of virtualenv
88 required : true
9+ use_uv :
10+ description : if 'true', use uv if available (falls back to virtualenv if not) (default='true')
11+ required : false
12+ default : ' true'
913
1014outputs :
1115 penv :
@@ -16,10 +20,19 @@ runs:
1620 using : composite
1721 steps :
1822 - id : env
23+ env :
24+ USE_UV : ${{ inputs.us_uv }}
25+ VENV_NAME : ${{ inputs.venv }}
1926 run : |
20- # install virtualenv
21- python -m pip install virtualenv
22- python -m virtualenv ${{ inputs.venv }}
23- pwd; ls -al
24- echo "penv=$(pwd)/${{ inputs.venv }}" >> "$GITHUB_OUTPUT"
27+ if [[ ${USE_UV} == 'true' ]] && command -v uv; then
28+ uv venv "${VENV_NAME}"
29+ else
30+ python -m pip install virtualenv
31+ python -m virtualenv "${VENV_NAME}"
32+ fi
33+
34+ echo "::group::$(pwd) contents:"
35+ ls -Al
36+ echo "::endgroup::"
37+ echo "penv=$(pwd)/${VENV_NAME}" >> "${GITHUB_OUTPUT}"
2538 shell : bash
You can’t perform that action at this time.
0 commit comments