Skip to content

Commit

Permalink
wip: factoring out build-phase loading repo-phase symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
rickeylev committed Jul 11, 2024
1 parent 04f5798 commit 6a9fa14
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 24 deletions.
4 changes: 2 additions & 2 deletions python/private/pypi/deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ py_library(
# Collate all the repository names so they can be easily consumed
all_requirements = [name for (name, _, _) in _RULE_DEPS]

def requirement(pkg):
return Label("@pypi__" + pkg + "//:lib")
##def requirement(pkg):
## return Label("@pypi__" + pkg + "//:lib")

def pypi_deps():
"""
Expand Down
27 changes: 13 additions & 14 deletions python/private/pypi/pip_compile.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ make it possible to have multiple tools inside the `pypi` directory
"""

load("//python:defs.bzl", _py_binary = "py_binary", _py_test = "py_test")
load(":deps.bzl", "requirement")

def pip_compile(
name,
Expand Down Expand Up @@ -115,19 +114,19 @@ def pip_compile(
args.extend(extra_args)

deps = [
requirement("build"),
requirement("click"),
requirement("colorama"),
requirement("importlib_metadata"),
requirement("more_itertools"),
requirement("packaging"),
requirement("pep517"),
requirement("pip"),
requirement("pip_tools"),
requirement("pyproject_hooks"),
requirement("setuptools"),
requirement("tomli"),
requirement("zipp"),
Label("@pypi__build//:lib"),
Label("@pypi__click//:lib"),
Label("@pypi__colorama//:lib"),
Label("@pypi__importlib_metadata//:lib"),
Label("@pypi__more_itertools//:lib"),
Label("@pypi__packaging//:lib"),
Label("@pypi__pep517//:lib"),
Label("@pypi__pip//:lib"),
Label("@pypi__pip_tools//:lib"),
Label("@pypi__pyproject_hooks//:lib"),
Label("@pypi__setuptools//:lib"),
Label("@pypi__tomli//:lib"),
Label("@pypi__zipp//:lib"),
Label("//python/runfiles:runfiles"),
] + extra_deps

Expand Down
14 changes: 6 additions & 8 deletions python/private/pypi/whl_installer/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
load("//python:defs.bzl", "py_binary", "py_library")
load("//python/private/pypi:deps.bzl", "requirement")

py_library(
name = "lib",
Expand All @@ -10,14 +9,13 @@ py_library(
"wheel_installer.py",
],
visibility = [
"//tests:__subpackages__",
"//third_party/rules_pycross/pycross/private:__subpackages__",
"//:__subpackages__",
],
deps = [
requirement("installer"),
requirement("pip"),
requirement("packaging"),
requirement("setuptools"),
"@pypi__installer//:lib",
"@pypi__packaging//:lib",
"@pypi__pip//:lib",
"@pypi__setuptools//:lib",
],
)

Expand All @@ -32,5 +30,5 @@ py_binary(
filegroup(
name = "distribution",
srcs = glob(["*"]),
visibility = ["//python/private/pypi:__subpackages__"],
visibility = ["//:__subpackages__"],
)

0 comments on commit 6a9fa14

Please sign in to comment.