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 eeabd9f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 25 deletions.
6 changes: 3 additions & 3 deletions python/private/pypi/deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ py_library(
"""

# Collate all the repository names so they can be easily consumed
all_requirements = [name for (name, _, _) in _RULE_DEPS]
##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 eeabd9f

Please sign in to comment.