Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError while setting up Python dependencies #375

Open
The-Compiler opened this issue Jan 26, 2021 · 2 comments
Open

SyntaxError while setting up Python dependencies #375

The-Compiler opened this issue Jan 26, 2021 · 2 comments

Comments

@The-Compiler
Copy link
Contributor

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?

@The-Compiler
Copy link
Contributor Author

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).

@robertbrignull
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants