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

Drop Python 2 support #886

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
Contributor

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
Collaborator

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

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