File tree Expand file tree Collapse file tree 4 files changed +20
-0
lines changed Expand file tree Collapse file tree 4 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 1
1
load ("@bazel_tools//tools/build_defs/repo:git.bzl" , "git_repository" )
2
2
load ("@bazel_tools//tools/build_defs/repo:http.bzl" , "http_archive" )
3
3
4
+ # Load the main dependencies from platformio_rules
5
+ #
6
+ # This cannot load all the dependencies, as some load()s are needed from these,
7
+ # which cannot be done in a function, but this is the first step of the process
4
8
def platformio_rules_dependencies ():
9
+ # Import Stardoc, to write the documentation to our Starlark rules
5
10
git_repository (
6
11
name = "io_bazel_stardoc" ,
7
12
remote = "https://github.com/bazelbuild/stardoc.git" ,
8
13
tag = "0.5.3" ,
9
14
)
15
+ # Import python, this is the first step to get pip_parse() dependencies to
16
+ # be corrently imported
10
17
http_archive (
11
18
name = "rules_python" ,
12
19
sha256 = "81cbfc16dd1c022c4761267fa8b2feb881aaea9c3e1143f2e64630a1ad18c347" ,
Original file line number Diff line number Diff line change 1
1
load ("@py_deps//:requirements.bzl" , "install_deps" )
2
2
3
+ # Finally, now that pip_parse() has been executed, install the pip dependencies
3
4
def platformio_rules_pip_install_dependencies ():
5
+ # Install all pip dependencies
4
6
install_deps ()
Original file line number Diff line number Diff line change 1
1
load ("@python3_10_8//:defs.bzl" , "interpreter" )
2
2
load ("@rules_python//python:pip.bzl" , "pip_parse" )
3
3
4
+ # Now that Python has been registered, load the pip packages that are required
5
+ # for template rendering
4
6
def platformio_rules_pip_parse_dependencies ():
7
+ # Load the pip packages needed
5
8
pip_parse (
6
9
name = "py_deps" ,
7
10
python_interpreter_target = interpreter ,
Original file line number Diff line number Diff line change 1
1
load ("@io_bazel_stardoc//:setup.bzl" , "stardoc_repositories" )
2
2
load ("@rules_python//python:repositories.bzl" , "python_register_toolchains" )
3
3
4
+ # Load the first level of dependencies that are based on the ones imported in
5
+ # platformio_rules_dependencies(), as these imports depend on load() commands
6
+ # that come from those imports
4
7
def platformio_rules_transitive_dependencies ():
8
+ # Import all the dependencies for Stardoc, so we can write documentation for
9
+ # our Starlark rules
5
10
stardoc_repositories ()
11
+
12
+ # Select the Python toolchain that will be used for template rendering. This
13
+ # is required for pip_parse() to be executed
6
14
python_register_toolchains (
7
15
name = "python3_10_8" ,
8
16
# Available versions are listed in @rules_python//python:versions.bzl.
You can’t perform that action at this time.
0 commit comments