Reid 'arrdem' McKenzie
5b0062468f
This patch teaches Zapp! to introspect the `sources` of a manifest, and look for the well-known `WHEEL` file(s) indicative of an unzipped/installed wheel in the input sources. A wheel can be (somewhat*) correctly reassembled by zipping its unzipped state, so in the presence of unzipped wheels Zapp! will re-zip them and enter them into the manifest appropriately for inclusion. This fixes #6 the nasty way, as there's no good way to make `rules_python` provide wheel dependencies or to translate unrolled wheels back to wheels during rule execution as this would violate Bazel's file dependency model.
40 lines
682 B
Python
40 lines
682 B
Python
load("@rules_zapp//zapp:zapp.bzl",
|
|
"zapp_binary",
|
|
)
|
|
|
|
load("@rules_python//python:defs.bzl", "py_library")
|
|
|
|
load("@my_deps//:requirements.bzl",
|
|
py_requirement="requirement",
|
|
)
|
|
|
|
zapp_binary(
|
|
name = "hello_script",
|
|
main = "hello.py",
|
|
# entry_point is inferred from main =
|
|
)
|
|
|
|
zapp_binary(
|
|
name = "hello_deps",
|
|
main = "hello.py",
|
|
# deps also get zapped via their underlying wheels
|
|
deps = [
|
|
py_requirement("pyyaml"),
|
|
]
|
|
)
|
|
|
|
py_library(
|
|
name = "lib_hello",
|
|
srcs = [],
|
|
deps = [
|
|
py_requirement("pyyaml"),
|
|
]
|
|
)
|
|
|
|
zapp_binary(
|
|
name = "hello_lib_deps",
|
|
main = "hello.py",
|
|
deps = [
|
|
":lib_hello",
|
|
],
|
|
)
|