File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ bazel_dep(name = "rules_pkg", version = "1.1.0")
2929# Python version
3030#
3131###############################################################################
32- bazel_dep (name = "rules_python" , version = "1.4.1 " )
32+ bazel_dep (name = "rules_python" , version = "1.5.0 " )
3333
3434PYTHON_VERSION = "3.12"
3535
Original file line number Diff line number Diff line change @@ -20,4 +20,8 @@ py_library(
2020 srcs = ["@score_docs_as_code//src/extensions:score_plantuml.py" ],
2121 imports = ["." ],
2222 visibility = ["//visibility:public" ],
23+ deps = [
24+ "@rules_python//python/runfiles" ,
25+ "@score_docs_as_code//src:plantuml_for_python" ,
26+ ],
2327)
Original file line number Diff line number Diff line change 2424In addition it sets common PlantUML options, like output to svg_obj.
2525"""
2626
27- import os
2827import sys
2928from pathlib import Path
3029
30+ from python .runfiles import Runfiles
3131from sphinx .application import Sphinx
3232from sphinx .util import logging
3333
3434logger = logging .getLogger (__name__ )
3535
3636
3737def get_runfiles_dir () -> Path :
38- if r := os . getenv ( "RUNFILES_DIR" ):
38+ if ( r := Runfiles . Create ()) and ( rd := r . EnvVars (). get ( "RUNFILES_DIR" ) ):
3939 # Runfiles are only available when running in Bazel.
4040 # bazel build and bazel run are both supported.
4141 # i.e. `bazel build //:docs` and `bazel run //:docs`.
4242 logger .debug ("Using runfiles to determine plantuml path." )
4343
44- runfiles_dir = Path (r )
44+ runfiles_dir = Path (rd )
4545
4646 else :
4747 # The only way to land here is when running from within the virtual
You can’t perform that action at this time.
0 commit comments