-
-
Notifications
You must be signed in to change notification settings - Fork 594
Add exports for core Python logic that's bundled with Bazel #202
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@clintharrison: I got an email of your post but can't see a comment here, did you delete it or is github being weird? In response to your point about warning when a deprecated API ( In addition, we can sometimes make it a soft failure that can be bypassed during a transition period (a la Bazel's |
Sorry, I intended on reposting it as a full comment, rather than an inline one, but you beat me to the reply :) Thanks for explaining the reasoning there -- I think that approach makes a lot of sense! |
The "core" Python rules are the rules that traditionally have been bundled with Bazel. This includes native rules like `py_binary`, and Starlark-defined rules under `@bazel_tools` like `py_runtime_pair`. These should all live in or around `@rules_python//python:defs.bzl`. Currently we re-export the native rules here, with a magic tag to allow them to survive the flag flip for `--incompatible_load_python_rules_from_bzl`. When native rules are ported to Starlark their definitions will live here.
This adds export definitions for built-in symbols like `PyInfo` and `@bazel_tools`-defined symbols like py_runtime_pair.
This vendors in the @bazel_tools//tools/python/runfiles target as //python/runfiles. See comment in the BUILD file for why we couldn't re-export the bundled implementation.
…ntrib#202) * Introduce defs.bzl as the official home of the core Python rules The "core" Python rules are the rules that traditionally have been bundled with Bazel. This includes native rules like `py_binary`, and Starlark-defined rules under `@bazel_tools` like `py_runtime_pair`. These should all live in or around `@rules_python//python:defs.bzl`. Currently we re-export the native rules here, with a magic tag to allow them to survive the flag flip for `--incompatible_load_python_rules_from_bzl`. When native rules are ported to Starlark their definitions will live here. * Add re-exports for Starlark-defined symbols This adds export definitions for built-in symbols like `PyInfo` and `@bazel_tools`-defined symbols like py_runtime_pair. * Vendor in runfiles library This vendors in the @bazel_tools//tools/python/runfiles target as //python/runfiles. See comment in the BUILD file for why we couldn't re-export the bundled implementation. * Fix README to prefer defs.bzl over python.bzl
This series of commits adds exports to
rules_python
for Bazel-packaged Python rule logic. Most importantly, this includes the native rules and providers likepy_binary
andPyInfo
, but it also includes Starlark-defined constructs that are distributed in@bazel_tools
.Work toward bazelbuild/bazel#8893. These exports constitute the new API we wish to migrate users to for that change.
Blocked on:
@io_bazel_rules_python
to@rules_python
(Rename canonical workspace to@rules_python
#203)