codeql-action
codeql-action copied to clipboard
SyntaxError while setting up Python dependencies
Since a couple of days (?), I'm seeing this in my runs:
Setup Python dependencies
/home/runner/work/_actions/github/codeql-action/v1/python-setup/install_tools.sh
[...]
+
+ curl --location --fail https://bootstrap.pypa.io/get-pip.py
+ command -v python2
/usr/bin/python2
+ python2
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 1883k 100 1883k 0 0 3327k 0 --:--:-- --:--:-- --:--:-- 3327k
Traceback (most recent call last):
File "<stdin>", line 24226, in <module>
File "<stdin>", line 199, in main
File "<stdin>", line 82, in bootstrap
File "/tmp/tmpSl4FBD/pip.zip/pip/_internal/cli/main.py", line 60
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax
Warning: Unable to download and extract the tools needed for installing the python dependencies. You can call this action with 'setup-python-dependencies: false' to disable this process.
This is probably due to pip dropping support for Python 2 recently.
Given that Python 2 support seems to be optional, maybe it'd be a good time to drop it, given that Python 2 has been declared end-of-life over a year ago?
Ah, looks like there is https://bootstrap.pypa.io/2.7/get-pip.py as well, pointing to the latest pip version supporting Python 2 (pip 20.3.4). If you prefer, I'd happily open a PR updating the URL (I'm the one who introduced it in #316).
Thanks for reporting this. We're aware and there will be a new version of the codeql-action out soon that will either fix the error, and at some point in the future we will indeed drop support for installing dependencies for python 2. Your link to https://bootstrap.pypa.io/2.7/get-pip.py is very poignant because that's exactly what we intend to use to fix it.
The dependency installation is only a best-effort attempt so thankfully it's a non-fatal error. For now if you can just ignore it and a fix will be out soon.