3
3
# The `load` statement imports the symbol for the rule, in the defined
4
4
# ruleset. When the symbol is loaded you can use the rule.
5
5
load ("@gazelle//:def.bzl" , "gazelle" )
6
+ load ("@pip//:requirements.bzl" , "all_whl_requirements" )
6
7
load ("@rules_python//gazelle:def.bzl" , "GAZELLE_PYTHON_RUNTIME_DEPS" )
8
+ load ("@rules_python//gazelle/modules_mapping:def.bzl" , "modules_mapping" )
7
9
load ("@rules_python//python:defs.bzl" , "py_binary" , "py_library" , "py_test" )
8
10
load ("@rules_python//python:pip.bzl" , "compile_pip_requirements" )
9
11
@@ -15,6 +17,19 @@ compile_pip_requirements(
15
17
requirements_windows = "requirements_windows.txt" ,
16
18
)
17
19
20
+ # This repository rule fetches the metadata for python packages we
21
+ # depend on. That data is required for the gazelle_python_manifest
22
+ # rule to update our manifest file.
23
+ # To see what this rule does, try `bazel run @modules_map//:print`
24
+ modules_mapping (
25
+ name = "modules_map" ,
26
+ exclude_patterns = [
27
+ "^_|(\\ ._)+" , # This is the default.
28
+ "(\\ .tests)+" , # Add a custom one to get rid of the psutil tests.
29
+ ],
30
+ wheels = all_whl_requirements ,
31
+ )
32
+
18
33
# Our gazelle target points to the python gazelle binary.
19
34
# This is the simple case where we only need one language supported.
20
35
# If you also had proto, go, or other gazelle-supported languages,
@@ -69,17 +84,3 @@ py_test(
69
84
main = "__test__.py" ,
70
85
deps = [":bzlmod_build_file_generation" ],
71
86
)
72
-
73
- # This repository rule fetches the metadata for python packages we
74
- # depend on. That data is required for the gazelle_python_manifest
75
- # rule to update our manifest file.
76
- # To see what this rule does, try `bazel run @modules_map//:print`
77
- modules_mapping (
78
- name = "modules_map" ,
79
- exclude_patterns = [
80
- "^_|(\\ ._)+" , # This is the default.
81
- "(\\ .tests)+" , # Add a custom one to get rid of the psutil tests.
82
- ],
83
- # TODO @aignas 2023-01-02: Think of a better way to do this
84
- wheels = [r .replace ("@pip_" , "@pip//:" ).replace ("//:whl" , "_whl" ) for r in all_whl_requirements ],
85
- )
0 commit comments