mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-11 07:03:30 +01:00
Adds execute perms to the repo-bundled python script (for real this time) (#24654)
* ci for updating PR * fix python not executing * do it again * we added the perms but in the wrong place (also python fixes) * fix for real (real)
This commit is contained in:
+17
-4
@@ -23,6 +23,7 @@ cd "$OldPWD"
|
||||
PythonVersion="$PYTHON_VERSION"
|
||||
PythonDir="$Cache/python-$PythonVersion"
|
||||
PythonExe="$PythonDir/python.exe"
|
||||
PythonArg=""
|
||||
Log="$Cache/last-command.log"
|
||||
|
||||
# If a portable Python for Windows is not present, search on $PATH.
|
||||
@@ -38,7 +39,8 @@ if [ "$(uname)" = "Linux" ] || [ ! -f "$PythonExe" ]; then
|
||||
elif command -v python >/dev/null 2>&1; then
|
||||
PythonExe=python
|
||||
elif command -v py >/dev/null 2>&1; then
|
||||
PythonExe="py -3"
|
||||
PythonExe="py"
|
||||
PythonArg="-3"
|
||||
else
|
||||
echo
|
||||
if command -v apt-get >/dev/null 2>&1; then
|
||||
@@ -62,12 +64,17 @@ if [ "$(uname)" = "Linux" ] || [ ! -f "$PythonExe" ]; then
|
||||
PythonDir="$Cache/venv"
|
||||
if [ ! -d "$PythonDir" ]; then
|
||||
echo "Creating virtualenv..."
|
||||
"$PythonExe" -m venv "$PythonDir"
|
||||
"$PythonExe" $PythonArg -m venv "$PythonDir"
|
||||
fi
|
||||
if [ -f "$PythonDir/bin/python" ]; then
|
||||
PythonExe="$PythonDir/bin/python"
|
||||
PythonArg=""
|
||||
elif [ -f "$PythonDir/scripts/python3.exe" ]; then
|
||||
PythonExe="$PythonDir/scripts/python3.exe";
|
||||
PythonArg=""
|
||||
elif [ -f "$PythonDir/scripts/python.exe" ]; then
|
||||
PythonExe="$PythonDir/scripts/python.exe";
|
||||
PythonArg=""
|
||||
else
|
||||
echo "bootstrap/python failed to find the python executable inside its virtualenv"
|
||||
exit 1
|
||||
@@ -77,8 +84,9 @@ fi
|
||||
# Use pip to install our requirements
|
||||
if [ ! -f "$PythonDir/requirements.txt" ] || [ "$(b2sum < "$Sdk/requirements.txt")" != "$(b2sum < "$PythonDir/requirements.txt")" ]; then
|
||||
echo "Updating dependencies..."
|
||||
"$PythonExe" -m pip install -U wheel
|
||||
"$PythonExe" -m pip install -U pip -r "$Sdk/requirements.txt"
|
||||
"$PythonExe" $PythonArg -m ensurepip || echo "ensurepip failed, continuing anyway..."
|
||||
"$PythonExe" $PythonArg -m pip install -U wheel
|
||||
"$PythonExe" $PythonArg -m pip install -U pip -r "$Sdk/requirements.txt"
|
||||
cp "$Sdk/requirements.txt" "$PythonDir/requirements.txt"
|
||||
echo "---"
|
||||
fi
|
||||
@@ -107,6 +115,11 @@ if ! command -v tee >/dev/null 2>&1; then
|
||||
}
|
||||
fi
|
||||
|
||||
if [ "$(uname -o)" = "Msys" ]; then
|
||||
# replace /c/ with c:/ for Windows
|
||||
Sdk=$(echo "$Sdk" | sed 's|^\(/.\)/|\1:/|')
|
||||
fi
|
||||
|
||||
# Invoke python with all command-line arguments
|
||||
export PYTHONPATH="$Sdk$PATHSEP${PYTHONPATH:-}"
|
||||
mkdir -p "$Cache"
|
||||
|
||||
Reference in New Issue
Block a user