2021-04-13 13:21:30 +02:00
|
|
|
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
|
|
|
|
load("@py_deps//:requirements.bzl", "requirement")
|
|
|
|
|
|
|
|
def pip_binary(name, pkg = None):
|
2021-10-15 07:50:47 +02:00
|
|
|
"Expose a binary from pip as an executable for linting. Does not work on Windows."
|
2021-04-13 13:21:30 +02:00
|
|
|
|
|
|
|
if not pkg:
|
|
|
|
pkg = name
|
|
|
|
|
2021-10-15 07:50:47 +02:00
|
|
|
native.alias(
|
2021-04-13 13:21:30 +02:00
|
|
|
name = name,
|
2021-10-15 07:50:47 +02:00
|
|
|
actual = requirement(pkg).replace(":pkg", ":rules_python_wheel_entry_point_" + name),
|
2021-04-14 10:06:16 +02:00
|
|
|
visibility = ["//visibility:public"],
|
2021-10-15 07:50:47 +02:00
|
|
|
tags = ["manual"],
|
2021-04-13 13:21:30 +02:00
|
|
|
)
|