Skip to content

Commit 31ae812

Browse files
committed
Install Python 3.12
This is necessary to support mitmproxy version 11.1.0 and newer.
1 parent babd69b commit 31ae812

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

monitor/setup.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,14 @@ if [ "$RUNNER_OS" = "macOS" ]; then
111111

112112
elif [ "$RUNNER_OS" = "Linux" ]; then
113113

114-
# ubuntu 22.04 and later install python 3.10 or later by default
114+
# ubuntu 24.04 and later install python 3.12 or later by default
115115
python_package="python3"
116116

117-
# install python 3.10, otherwise ubuntu 20.04 installs 3.8 and we won't get the latest mitmproxy with important bug fixes
118-
if (( "$(lsb_release --short --release | cut --delimiter='.' --fields=1)" < 22 )); then
117+
# install python 3.12, otherwise ubuntu 20.04 installs 3.8 and ubuntu 22.04 installs
118+
# 3.10 so we won't get the latest mitmproxy with important bug fixes
119+
if (( "$(lsb_release --short --release | cut --delimiter='.' --fields=1)" < 24 )); then
119120
sudo add-apt-repository ppa:deadsnakes/ppa -y
120-
python_package="python3.10"
121+
python_package="python3.12"
121122
fi
122123

123124
sudo apt install -y "$python_package"-venv
@@ -128,7 +129,7 @@ elif [ "$RUNNER_OS" = "Linux" ]; then
128129

129130
# install mitmproxy
130131
sudo -u mitmproxyuser -H bash -e -c 'cd ~ && \
131-
"$(command -v python3.10 || command -v python3)" -m venv venv && \
132+
"$(command -v python3.12 || command -v python3)" -m venv venv && \
132133
venv/bin/pip install mitmproxy==11.0.0 requests==2.32.3'
133134

134135
sudo cp mitm_plugin.py /home/mitmproxyuser/mitm_plugin.py

0 commit comments

Comments
 (0)