-
Notifications
You must be signed in to change notification settings - Fork 539
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pip_repository): Enable PyPi dep cycles
This patch adjusts the pip_repository interface to accept a new parameter: `composite_libs`, being a list of PyPi package names which form a cycle and must be installed together. The intuition behind this design is that a dependency cycle {a <-> b} is implemented simply as emplacing both a and b at once. Hence a dependency graph {c -> a, c -> b} has the same effect. If we modify the installation of a and b to remove their mutual dependency, and generate a c which dominates a and b, we can then modify the `requirement()` and `whl_requirement()` helper functions to recognize the requirements a and b and provide a reference to c instead.
- Loading branch information
Showing
9 changed files
with
153 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
load(":lib.bzl", "install_clusters") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
# Ensure the `requirements.bzl` source can be accessed by stardoc, since users load() from it | ||
exports_files(["requirements.bzl"]) | ||
|
||
install_clusters() | ||
|
||
%%FOOTER%% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
load("@rules_python//python:defs.bzl", "py_library") | ||
load(":requirements.bzl", "requirement", "whl_requirement", "requirement_clusters") | ||
|
||
|
||
def install_clusters(): | ||
for cname, components in requirement_clusters.items(): | ||
py_library( | ||
name = cname, | ||
deps = [requirement(c, use_clusters=False) for c, _ in components] | ||
) | ||
native.filegroup( | ||
name = "whl_" + cname, | ||
data = [whl_requirement(c, use_clusters=False) for c, _ in components] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters