5
5
load ("@gazelle//:def.bzl" , "gazelle" )
6
6
load ("@pip//:requirements.bzl" , "all_whl_requirements" )
7
7
load ("@rules_python//gazelle:def.bzl" , "GAZELLE_PYTHON_RUNTIME_DEPS" )
8
+ load ("@rules_python//gazelle/manifest:defs.bzl" , "gazelle_python_manifest" )
8
9
load ("@rules_python//gazelle/modules_mapping:def.bzl" , "modules_mapping" )
9
10
load ("@rules_python//python:defs.bzl" , "py_binary" , "py_library" , "py_test" )
10
11
load ("@rules_python//python:pip.bzl" , "compile_pip_requirements" )
@@ -30,6 +31,20 @@ modules_mapping(
30
31
wheels = all_whl_requirements ,
31
32
)
32
33
34
+ # Gazelle python extension needs a manifest file mapping from
35
+ # an import to the installed package that provides it.
36
+ # This macro produces two targets:
37
+ # - //:gazelle_python_manifest.update can be used with `bazel run`
38
+ # to recalculate the manifest
39
+ # - //:gazelle_python_manifest.test is a test target ensuring that
40
+ # the manifest doesn't need to be updated
41
+ gazelle_python_manifest (
42
+ name = "gazelle_python_manifest" ,
43
+ modules_mapping = ":modules_map" ,
44
+ pip_repository_name = "pip" ,
45
+ requirements = "//:requirements_lock.txt" ,
46
+ )
47
+
33
48
# Our gazelle target points to the python gazelle binary.
34
49
# This is the simple case where we only need one language supported.
35
50
# If you also had proto, go, or other gazelle-supported languages,
0 commit comments