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

pip_install Python2 support? #409

Closed
gfl-chris opened this issue Jan 28, 2021 · 2 comments
Closed

pip_install Python2 support? #409

gfl-chris opened this issue Jan 28, 2021 · 2 comments

Comments

@gfl-chris
Copy link

🐞 bug report

Affected Rule

The issue is caused by the rule: pip_import

Is this a regression?

No. Yes. Maybe.

Description

I'm trying to invoke the pip_install workspace rule with Python2, setting python_interpreter to "python2". But pip_install fails with the error /usr/bin/python2: No module named python.pip_install. I tracked this down to missing __init__.py files in the rules_python/python and rules_python/python/pip_install directories. Python2 must require init.py files in the whole module path whereas Python3 doesn't... Anyhow, once the files are there, python2 fails with the error:

  File "python/pip_install/extract_wheels/__init__.py", line 18
    def configure_reproducible_wheels() -> None:
                                        ^
SyntaxError: invalid syntax

Which tells me that that's Python3 syntax. :( Is Python2 not supported for pip_install?

🌍 Your Environment

Output of bazel version:

  
Bazelisk version: development
Build label: 3.7.1
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Nov 24 17:38:30 2020 (1606239510)
Build timestamp: 1606239510
Build timestamp as int: 1606239510
  

Rules_python version:

  
8537cea11d867333c07c465d536778c1b7560cde
  

python2 --version:
Python 2.7.18

@thundergolfer
Copy link
Collaborator

Thanks for the issue report. rules_python_external, which the new packing rules are from, was always only supporting 3.5+. Though this is not clearly communicated in the repo.

Going forward, Python 2 won't be supported by the packaging rules. Python 2 is officially sunsetted and no longer supported. Pip has dropped support for Python 2 and we want to move forward along with Pip.

The legacy rules still should work for Python 2, so we should make it much clearer that that's the only option for Python 2.

@thundergolfer
Copy link
Collaborator

Closing as answered.

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