You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
383 B
Bash
14 lines
383 B
Bash
# shellcheck shell=bash
|
|
|
|
# Tox environment name -> Python executable name (e.g. py312-m_mtg -> python3.12)
|
|
toxenv-python() {
|
|
local pattern='^py([23])([0-9]{1,2}).*'
|
|
if [[ $1 =~ $pattern ]]; then
|
|
echo "python${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"
|
|
return
|
|
else
|
|
echo "${FUNCNAME[0]}: $1: environment name not recognised" >&2
|
|
return 1
|
|
fi
|
|
}
|