Skip to content

Drop Python 2 support #886

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

Closed
3 tasks
rickeylev opened this issue Nov 18, 2022 · 3 comments
Closed
3 tasks

Drop Python 2 support #886

rickeylev opened this issue Nov 18, 2022 · 3 comments

Comments

@rickeylev
Copy link
Collaborator

rickeylev commented Nov 18, 2022

This is the general tracking issue for removing Python 2 support in rules_python.

For the bazel-side of things, see bazelbuild/bazel#15684

Right now, Python 2 support is defacto not present because...

  • pip_parse doesn't work with Python 2
  • Many systems don't provide Python 2 anymore
  • Many libraries no longer support Python 2
  • Us maintainers of these rules will ignore requests for it
  • The Starlark rewrite of the native.py_* rules won't support it
  • It has been 2+ years past the Python 2 EOL date.

However, several of our apis still accept e.g. python_version=PY2 or src_version=PY2|PY2ONLY, which technically do allow Python 2. We'll be disabling and breaking those.

If you want to continue to use rules_python with Python 2, then you will need to use an earlier release and/or fork.

TODO list

  • Fail for python_version and srcs_version values that are Python 2
  • For if py_runtime_pair.py2_runtime is set
  • Remove PYTHON2 make var (see current_py_toolchain)
@pstradomski
Copy link
Contributor

pstradomski commented Nov 19, 2022

Note: there are a few if sys.version statements in wheelmaker.py. If we're dropping py2 support, these could be removed to simplify the code.

@rickeylev
Copy link
Collaborator Author

posterity/update: the PR is ready to merge and it'll be merged in January after the holidays. We're also going to cut one last release before it is merged.

rickeylev added a commit that referenced this issue Dec 1, 2022
Fail for py2 python_version, srcs_version, and runtime values.

See #886
@rickeylev
Copy link
Collaborator Author

Actually, small change of plans: I've merged this in now with #887.

If it turns out to be too problematic, we can revert it for now and attempt again after the holidays. In the meantime, we'll find out about any issues sooner rather than later.

hopez13 pushed a commit to hopez13/kernel-superproject that referenced this issue Dec 26, 2024
It has been deprecated for a long time and Bazel 8.0.0 does
not support registering a python2 toolchain by default. So
let's delete it.

Bug: 372860136
Link: bazel-contrib/rules_python#886
Change-Id: I129d864f2c8343e2e821622b20a039679070de26
hopez13 pushed a commit to hopez13/kernel-superproject that referenced this issue Dec 26, 2024
It has been deprecated for a long time and Bazel 8.0.0 does
not support registering a python2 toolchain by default. So
let's delete it.

Bug: 372860136
Link: bazel-contrib/rules_python#886
Change-Id: I129d864f2c8343e2e821622b20a039679070de26
hopez13 pushed a commit to hopez13/kernel-superproject that referenced this issue Dec 26, 2024
It has been deprecated for a long time and Bazel 8.0.0 does
not support registering a python2 toolchain by default. So
let's delete it.

Bug: 372860136
Link: bazel-contrib/rules_python#886
Change-Id: I129d864f2c8343e2e821622b20a039679070de26
hopez13 pushed a commit to hopez13/kernel-superproject that referenced this issue Dec 26, 2024
It has been deprecated for a long time and Bazel 8.0.0 does
not support registering a python2 toolchain by default. So
let's delete it.

Bug: 372860136
Link: bazel-contrib/rules_python#886
Change-Id: I129d864f2c8343e2e821622b20a039679070de26
hopez13 pushed a commit to hopez13/kernel-superproject that referenced this issue Dec 26, 2024
It has been deprecated for a long time and Bazel 8.0.0 does
not support registering a python2 toolchain by default. So
let's delete it.

Bug: 372860136
Link: bazel-contrib/rules_python#886
Change-Id: I129d864f2c8343e2e821622b20a039679070de26
hopez13 pushed a commit to hopez13/kernel-superproject that referenced this issue Dec 26, 2024
It has been deprecated for a long time and Bazel 8.0.0 does
not support registering a python2 toolchain by default. So
let's delete it.

Bug: 372860136
Link: bazel-contrib/rules_python#886
Change-Id: I129d864f2c8343e2e821622b20a039679070de26
hopez13 pushed a commit to hopez13/kernel-superproject that referenced this issue Dec 26, 2024
It has been deprecated for a long time and Bazel 8.0.0 does
not support registering a python2 toolchain by default. So
let's delete it.

Bug: 372860136
Link: bazel-contrib/rules_python#886
Change-Id: I129d864f2c8343e2e821622b20a039679070de26
hopez13 pushed a commit to hopez13/kernel-superproject that referenced this issue Dec 26, 2024
It has been deprecated for a long time and Bazel 8.0.0 does
not support registering a python2 toolchain by default. So
let's delete it.

Bug: 372860136
Link: bazel-contrib/rules_python#886
Change-Id: I129d864f2c8343e2e821622b20a039679070de26
jaavid pushed a commit to J-Androids/superproject that referenced this issue Feb 10, 2025
It has been deprecated for a long time and Bazel 8.0.0 does
not support registering a python2 toolchain by default. So
let's delete it.

Bug: 372860136
Link: bazel-contrib/rules_python#886
Change-Id: I129d864f2c8343e2e821622b20a039679070de26
jaavid pushed a commit to J-Androids/superproject that referenced this issue Feb 10, 2025
It has been deprecated for a long time and Bazel 8.0.0 does
not support registering a python2 toolchain by default. So
let's delete it.

Bug: 372860136
Link: bazel-contrib/rules_python#886
Change-Id: I129d864f2c8343e2e821622b20a039679070de26
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