You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When upgrading to ubuntu 24.04 and using a python venv in a task using the builtin shell, an error occurs.
This error is because the built-in shell in go-task does not honour the 'hash' command and the python3 devs removed the conditional check in the 'activate' command.
something:
desc: runs the something command - does not work
deps: [venv]
cmds:
- |
source venvs/avid-scripts/bin/activate
trap deactivate EXIT
python3 -m something --option value
Fix:
something:
desc: runs the something command - does work
deps: [venv]
cmds:
- |
bash <<EOF
source venvs/avid-scripts/bin/activate
trap deactivate EXIT
python3 -m something --option value
EOF
The text was updated successfully, but these errors were encountered:
If you need cross platform support, the sed won't work well for BSD and Mac. I use this similar (but less concise, I may have to modify it now) approach, but I read the file in and then write it out again to avoid sed.
- cmd: | # The mvdan Go sh interpreter doesn't have the 'hash' builtin, which # newer versions of the venv activation require. Some systems have # 'hash' available as an external utility, but Gitea Actions doesn't. # In that case, we patch the venv activation script to emulate 'hash' # as a no-op if it's not present. _venv_file="$(< $VENV_ACTIVATE)" { cat << EOF if ! command -v hash 2>&1 > /dev/null; then hash(){true } fi EOF echo "$_venv_file" } > $VENV_ACTIVATEsilent: true
When upgrading to ubuntu 24.04 and using a python venv in a task using the builtin shell, an error occurs.
This error is because the built-in shell in go-task does not honour the 'hash' command and the python3 devs removed the conditional check in the 'activate' command.
See pypa/virtualenv#2086
This was mitigated by explicitly using bash.
Example
Fix:
The text was updated successfully, but these errors were encountered: