1"""Starlark representation of locked requirements. 2 3@generated by rules_python pip_parse repository rule 4from %%REQUIREMENTS_LOCK%%. 5""" 6 7all_requirements = %%ALL_REQUIREMENTS%% 8 9all_whl_requirements = %%ALL_WHL_REQUIREMENTS%% 10 11all_data_requirements = %%ALL_DATA_REQUIREMENTS%% 12 13def _clean_name(name): 14 return name.replace("-", "_").replace(".", "_").lower() 15 16def requirement(name): 17 return "%%MACRO_TMPL%%".format(_clean_name(name), "pkg") 18 19def whl_requirement(name): 20 return "%%MACRO_TMPL%%".format(_clean_name(name), "whl") 21 22def data_requirement(name): 23 return "%%MACRO_TMPL%%".format(_clean_name(name), "data") 24 25def dist_info_requirement(name): 26 return "%%MACRO_TMPL%%".format(_clean_name(name), "dist_info") 27 28def entry_point(pkg, script = None): 29 """entry_point returns the target of the canonical label of the package entrypoints. 30 """ 31 if not script: 32 script = pkg 33 return "@@%%NAME%%_{}//:rules_python_wheel_entry_point_{}".format(_clean_name(pkg), script) 34