Prefer python3 over python(2) in checkout-deps (#1424)
* Prefer python3 over python(2) in checkout-deps We require Python 3 and don't want to accidentally use Python 2 if both are available. * Use python3 in travis build * Install python3-pip package on travis trusty image * Fix pip detection in checkout-deps.sh
This commit is contained in:
parent
70b6e96f95
commit
5bc48b2ab3
@ -15,7 +15,7 @@ jobs:
|
|||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
packages: ['clang-3.8', 'lib32stdc++6', 'lib32z1-dev', 'libc6-dev-i386', 'linux-libc-dev:i386', 'g++-4.9-multilib']
|
packages: ['clang-3.8', 'lib32stdc++6', 'lib32z1-dev', 'libc6-dev-i386', 'linux-libc-dev:i386', 'g++-4.9-multilib', 'python3-pip']
|
||||||
env:
|
env:
|
||||||
- MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8"
|
- MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8"
|
||||||
- SDKS=episode1,css,tf2,l4d2,csgo
|
- SDKS=episode1,css,tf2,l4d2,csgo
|
||||||
@ -29,7 +29,7 @@ jobs:
|
|||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
packages: ['clang-3.4', 'lib32stdc++6', 'lib32z1-dev', 'libc6-dev-i386', 'linux-libc-dev:i386', 'g++-4.9-multilib']
|
packages: ['clang-3.4', 'lib32stdc++6', 'lib32z1-dev', 'libc6-dev-i386', 'linux-libc-dev:i386', 'g++-4.9-multilib', 'python3-pip']
|
||||||
env:
|
env:
|
||||||
- MATRIX_EVAL="CC=clang && CXX=clang++"
|
- MATRIX_EVAL="CC=clang && CXX=clang++"
|
||||||
- SDKS=episode1,css,tf2,l4d2,csgo
|
- SDKS=episode1,css,tf2,l4d2,csgo
|
||||||
@ -82,5 +82,5 @@ script:
|
|||||||
- eval "${MATRIX_EVAL}"
|
- eval "${MATRIX_EVAL}"
|
||||||
- eval "${CC} --version"
|
- eval "${CC} --version"
|
||||||
- eval "${CXX} --version"
|
- eval "${CXX} --version"
|
||||||
- python ../configure.py --enable-${MODE} --sdks=${SDKS} --targets=${ARCH}
|
- python3 ../configure.py --enable-${MODE} --sdks=${SDKS} --targets=${ARCH}
|
||||||
- ambuild
|
- ambuild
|
||||||
|
4
tools/checkout-deps.ps1
vendored
4
tools/checkout-deps.ps1
vendored
@ -92,10 +92,10 @@ $SDKS | ForEach-Object {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Find a suitable installation of Python
|
# Find a suitable installation of Python
|
||||||
$PYTHON_CMD = Get-Command 'python' -ErrorAction SilentlyContinue
|
$PYTHON_CMD = Get-Command 'python3' -ErrorAction SilentlyContinue
|
||||||
if ($NULL -eq $PYTHON_CMD)
|
if ($NULL -eq $PYTHON_CMD)
|
||||||
{
|
{
|
||||||
$PYTHON_CMD = Get-Command 'python3' -ErrorAction SilentlyContinue
|
$PYTHON_CMD = Get-Command 'python' -ErrorAction SilentlyContinue
|
||||||
if ($NULL -eq $PYTHON_CMD)
|
if ($NULL -eq $PYTHON_CMD)
|
||||||
{
|
{
|
||||||
$PYTHON_CMD = Get-Command 'py' -ErrorAction SilentlyContinue
|
$PYTHON_CMD = Get-Command 'py' -ErrorAction SilentlyContinue
|
||||||
|
8
tools/checkout-deps.sh
vendored
8
tools/checkout-deps.sh
vendored
@ -143,9 +143,9 @@ do
|
|||||||
checkout
|
checkout
|
||||||
done
|
done
|
||||||
|
|
||||||
python_cmd=`command -v python`
|
python_cmd=`command -v python3`
|
||||||
if [ -z "$python_cmd" ]; then
|
if [ -z "$python_cmd" ]; then
|
||||||
python_cmd=`command -v python3`
|
python_cmd=`command -v python`
|
||||||
|
|
||||||
if [ -z "$python_cmd" ]; then
|
if [ -z "$python_cmd" ]; then
|
||||||
echo "No suitable installation of Python detected"
|
echo "No suitable installation of Python detected"
|
||||||
@ -153,11 +153,11 @@ if [ -z "$python_cmd" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
`$python_cmd -c "import ambuild2"` 2>&1 1>/dev/null
|
$python_cmd -c "import ambuild2" 2>&1 1>/dev/null
|
||||||
if [ $? -eq 1 ]; then
|
if [ $? -eq 1 ]; then
|
||||||
echo "AMBuild is required to build SourceMod"
|
echo "AMBuild is required to build SourceMod"
|
||||||
|
|
||||||
`$python_cmd -m pip --version` 2>&1 1>/dev/null
|
$python_cmd -m pip --version 2>&1 1>/dev/null
|
||||||
if [ $? -eq 1 ]; then
|
if [ $? -eq 1 ]; then
|
||||||
echo "The detected Python installation does not have PIP"
|
echo "The detected Python installation does not have PIP"
|
||||||
echo "Installing the latest version of PIP available (VIA \"get-pip.py\")"
|
echo "Installing the latest version of PIP available (VIA \"get-pip.py\")"
|
||||||
|
Loading…
Reference in New Issue
Block a user