File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -112,9 +112,16 @@ if [ "$RUNNER_OS" = "macOS" ]; then
112
112
113
113
elif [ " $RUNNER_OS " = " Linux" ]; then
114
114
115
+ # ubuntu 22.04 and later install python 3.10 or later by default
116
+ python_package=" python3"
117
+
115
118
# install python 3.10, otherwise ubuntu 20.04 installs 3.8 and we won't get the latest mitmproxy with important bug fixes
116
- sudo add-apt-repository ppa:deadsnakes/ppa -y
117
- sudo apt install -y python3.10-venv
119
+ if (( "$(lsb_release -- short -- release | cut -- delimiter= '.' -- fields= 1 )" < 22 )) ; then
120
+ sudo add-apt-repository ppa:deadsnakes/ppa -y
121
+ python_package=" python3.10"
122
+ fi
123
+
124
+ sudo apt install -y " $python_package " -venv
118
125
119
126
# create mitmproxyuser, otherwise proxy won't intercept local trafic from the same user
120
127
sudo useradd --create-home mitmproxyuser
@@ -125,7 +132,7 @@ elif [ "$RUNNER_OS" = "Linux" ]; then
125
132
git clone -b main https://github.com/mitmproxy/mitmproxy.git && \
126
133
cd mitmproxy && \
127
134
git checkout 5353df5f1eeaf5fc36d9b5f7024199c888aed116 && \
128
- python3.10 -m venv venv && \
135
+ "$(command -v python3.10 || command -v python3)" -m venv venv && \
129
136
venv/bin/pip install -e ".[dev]" '
130
137
131
138
sudo cp mitm_plugin.py /home/mitmproxyuser/mitm_plugin.py
You can’t perform that action at this time.
0 commit comments