6
6
load ("@rules_python//python:pip.bzl" , "pip_utils" )
7
7
load ("@rules_python//python/pip_install:pip_repository.bzl" , "group_library" , "whl_library" )
8
8
9
- all_requirements = ["@pip//certifi :pkg" , "@pip//charset_normalizer :pkg" , "@pip//idna :pkg" , "@pip//requests :pkg" , "@pip//urllib3 :pkg" ]
9
+ all_requirements = ["@my_project_pip_deps_vendored_certifi// :pkg" , "@my_project_pip_deps_vendored_charset_normalizer// :pkg" , "@my_project_pip_deps_vendored_idna// :pkg" , "@my_project_pip_deps_vendored_requests// :pkg" , "@my_project_pip_deps_vendored_urllib3// :pkg" ]
10
10
11
- all_whl_requirements_by_package = {"certifi" : "@pip//certifi :whl" , "charset_normalizer" : "@pip//charset_normalizer :whl" , "idna" : "@pip//idna :whl" , "requests" : "@pip//requests :whl" , "urllib3" : "@pip//urllib3 :whl" }
11
+ all_whl_requirements_by_package = {"certifi" : "@my_project_pip_deps_vendored_certifi// :whl" , "charset_normalizer" : "@my_project_pip_deps_vendored_charset_normalizer// :whl" , "idna" : "@my_project_pip_deps_vendored_idna// :whl" , "requests" : "@my_project_pip_deps_vendored_requests// :whl" , "urllib3" : "@my_project_pip_deps_vendored_urllib3// :whl" }
12
12
13
13
all_whl_requirements = all_whl_requirements_by_package .values ()
14
14
15
- all_data_requirements = ["@pip//certifi :data" , "@pip//charset_normalizer :data" , "@pip//idna :data" , "@pip//requests :data" , "@pip//urllib3 :data" ]
15
+ all_data_requirements = ["@my_project_pip_deps_vendored_certifi// :data" , "@my_project_pip_deps_vendored_charset_normalizer// :data" , "@my_project_pip_deps_vendored_idna// :data" , "@my_project_pip_deps_vendored_requests// :data" , "@my_project_pip_deps_vendored_urllib3// :data" ]
16
16
17
- _packages = [("pip_certifi" , "certifi==2023.7.22 --hash=sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082 --hash=sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9" ), ("pip_charset_normalizer" , "charset-normalizer==2.1.1 --hash=sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845 --hash=sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f" ), ("pip_idna" , "idna==3.4 --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2" ), ("pip_requests" , "requests==2.28.1 --hash=sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983 --hash=sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349" ), ("pip_urllib3" , "urllib3==1.26.13 --hash=sha256:47cc05d99aaa09c9e72ed5809b60e7ba354e64b59c9c173ac3018642d8bb41fc --hash=sha256:c083dd0dce68dbfbe1129d5271cb90f9447dea7d52097c6e0126120c521ddea8" )]
18
- _config = {"download_only" : False , "enable_implicit_namespace_pkgs" : False , "environment" : {}, "envsubst" : ["PIP_RETRIES" ], "extra_pip_args" : ["--retries=${PIP_RETRIES:-5}" ], "isolated" : True , "pip_data_exclude" : [], "python_interpreter" : "python3" , "python_interpreter_target" : "@python39_host//:python" , "quiet" : True , "repo" : "pip " , "repo_prefix" : "pip_ " , "timeout" : 600 }
17
+ _packages = [("my_project_pip_deps_vendored_certifi" , "certifi==2023.7.22 --hash=sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082 --hash=sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9" ), ("my_project_pip_deps_vendored_charset_normalizer" , "charset-normalizer==2.1.1 --hash=sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845 --hash=sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f" ), ("my_project_pip_deps_vendored_idna" , "idna==3.4 --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2" ), ("my_project_pip_deps_vendored_requests" , "requests==2.28.1 --hash=sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983 --hash=sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349" ), ("my_project_pip_deps_vendored_urllib3" , "urllib3==1.26.13 --hash=sha256:47cc05d99aaa09c9e72ed5809b60e7ba354e64b59c9c173ac3018642d8bb41fc --hash=sha256:c083dd0dce68dbfbe1129d5271cb90f9447dea7d52097c6e0126120c521ddea8" )]
18
+ _config = {"download_only" : False , "enable_implicit_namespace_pkgs" : False , "environment" : {}, "envsubst" : ["PIP_RETRIES" ], "extra_pip_args" : ["--retries=${PIP_RETRIES:-5}" ], "isolated" : True , "pip_data_exclude" : [], "python_interpreter" : "python3" , "python_interpreter_target" : "@python39_host//:python" , "quiet" : True , "repo" : "my_project_pip_deps_vendored " , "repo_prefix" : "my_project_pip_deps_vendored_ " , "timeout" : 600 }
19
19
_annotations = {}
20
20
21
21
def requirement (name ):
22
- return "@pip//{} :{}" .format (pip_utils .normalize_name (name ), "pkg" )
22
+ return "@my_project_pip_deps_vendored_{}// :{}" .format (pip_utils .normalize_name (name ), "pkg" )
23
23
24
24
def whl_requirement (name ):
25
- return "@pip//{} :{}" .format (pip_utils .normalize_name (name ), "whl" )
25
+ return "@my_project_pip_deps_vendored_{}// :{}" .format (pip_utils .normalize_name (name ), "whl" )
26
26
27
27
def data_requirement (name ):
28
- return "@pip//{} :{}" .format (pip_utils .normalize_name (name ), "data" )
28
+ return "@my_project_pip_deps_vendored_{}// :{}" .format (pip_utils .normalize_name (name ), "data" )
29
29
30
30
def dist_info_requirement (name ):
31
- return "@pip//{} :{}" .format (pip_utils .normalize_name (name ), "dist_info" )
31
+ return "@my_project_pip_deps_vendored_{}// :{}" .format (pip_utils .normalize_name (name ), "dist_info" )
32
32
33
33
def entry_point (pkg , script = None ):
34
34
if not script :
35
35
script = pkg
36
- return "@pip_ " + pip_utils .normalize_name (pkg ) + "//:rules_python_wheel_entry_point_" + script
36
+ return "@my_project_pip_deps_vendored_ " + pip_utils .normalize_name (pkg ) + "//:rules_python_wheel_entry_point_" + script
37
37
38
38
def _get_annotation (requirement ):
39
39
# This expects to parse `setuptools==58.2.0 --hash=sha256:2551203ae6955b9876741a26ab3e767bb3242dafe86a32a749ea0d78b6792f11`
@@ -58,10 +58,10 @@ def install_deps(**whl_library_kwargs):
58
58
for requirement in group_requirements
59
59
}
60
60
61
- group_repo = "pip__groups "
61
+ group_repo = "my_project_pip_deps_vendored__groups "
62
62
group_library (
63
63
name = group_repo ,
64
- repo_prefix = "pip_ " ,
64
+ repo_prefix = "my_project_pip_deps_vendored_ " ,
65
65
groups = all_requirement_groups ,
66
66
)
67
67
@@ -70,7 +70,7 @@ def install_deps(**whl_library_kwargs):
70
70
whl_config .update (whl_library_kwargs )
71
71
72
72
for name , requirement in _packages :
73
- group_name = requirement_group_mapping .get (name .replace ("pip_ " , "" ))
73
+ group_name = requirement_group_mapping .get (name .replace ("my_project_pip_deps_vendored_ " , "" ))
74
74
group_deps = all_requirement_groups .get (group_name , [])
75
75
76
76
whl_library (
0 commit comments