blob: b99322dd96dbc7cf5ed942328d841099fcc49237 [file] [log] [blame]
"""Starlark representation of locked requirements.
@generated by rules_python pip.parse bzlmod extension.
"""
load("@rules_python//python:pip.bzl", "pip_utils")
all_requirements = %%ALL_REQUIREMENTS%%
all_whl_requirements_by_package = %%ALL_WHL_REQUIREMENTS_BY_PACKAGE%%
all_whl_requirements = all_whl_requirements_by_package.values()
all_data_requirements = %%ALL_DATA_REQUIREMENTS%%
def requirement(name):
return "%%MACRO_TMPL%%".format(pip_utils.normalize_name(name), "pkg")
def whl_requirement(name):
return "%%MACRO_TMPL%%".format(pip_utils.normalize_name(name), "whl")
def data_requirement(name):
return "%%MACRO_TMPL%%".format(pip_utils.normalize_name(name), "data")
def dist_info_requirement(name):
return "%%MACRO_TMPL%%".format(pip_utils.normalize_name(name), "dist_info")
def entry_point(pkg, script = None):
"""entry_point returns the target of the canonical label of the package entrypoints.
"""
actual_script = script or pkg
fail("""Please replace this instance of entry_point with the following:
```
load("@rules_python//python/entry_points:py_console_script_binary.bzl", "py_console_script_binary")
py_console_script_binary(
name = "{pkg}",
pkg = "@%%NAME%%//{pkg}",{script}
)
```
""".format(
pkg = pip_utils.normalize_name(pkg),
script = "" if not script else "\n script = \"%s\"," % actual_script,
))