-
Notifications
You must be signed in to change notification settings - Fork 807
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
[bazel,python] update rules_python and vendor in requirements.bzl #26090
[bazel,python] update rules_python and vendor in requirements.bzl #26090
Conversation
This updates rules_python to 0.39.0 to match the version on the master branch. See lowRISC#24781. Signed-off-by: Tim Trippel <[email protected]>
9d97e46
to
b2c2529
Compare
cmd = " | ".join([ | ||
"cat $<", | ||
# Substitute the name of the hub to ensure that the dependencies do | ||
# not require the hub repo initialized in the WORKSPACE. | ||
"sed -e 's/ot_python_deps/ot_python_deps_vendored/g'", | ||
# Change the labels from using the hub repo to using the spoke repos | ||
# directly. | ||
"sed -e 's|//\\([^:]*\\):pkg|_\\1//:pkg|g'", | ||
"sed -e 's|//\\([^:]*\\):whl|_\\1//:whl|g'", | ||
"sed -e 's|//\\([^:]*\\):data|_\\1//:data|g'", | ||
# Change the convenience macros to use the same naming. | ||
"sed -e 's|//{}:{}|_{}//:{}|g' >$@", | ||
]), |
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.
This is a cool way of building this pipeline while being able to intersperse comments.
FYI, I think you could do this with a single sed invocation if you wanted to:
sed \
-e 's|...|...|g' \
-e 's|...|...|g' \
-e 's|...|...|g' \
$< >$@
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.
Ah good idea. Let me update this in a follow up.
Our current version of rules_python autogenerates the `requirements.bzl` file from a `requirements.txt` lock file. However, this is awkward if this project is ever a dependency of another downstream bazel project, as shown here: bazelbuild/rules_python#608 To circumvent this issue, rules_python provides a mechanism to vendor in the requirements.bzl file into the repo, which this commit does. Signed-off-by: Tim Trippel <[email protected]>
b2c2529
to
ea8620c
Compare
submitted as part of #26091 |
Our current version of rules_python autogenerates the
requirements.bzl
file from arequirements.txt
lock file. However, this is awkward if this project is ever a dependency of another downstream bazel project, as shown here: bazelbuild/rules_python#608To circumvent this issue, rules_python provides a mechanism to vendor in the requirements.bzl file into the repo, which this commit does.
Additionally, this updates the
rules_python
version to match themaster
branch, and also updates thepython-requirements.txt
lock file.This is part 1 of a series of changes that will re-enable airgapped builds with python dependencies.