@@ -398,6 +398,7 @@ py_runtime(
398
398
name = "py3_runtime",
399
399
files = [":files"],
400
400
{coverage_attr}
401
+ coverage_rc = "{coverage_rc}",
401
402
interpreter = "{python_path}",
402
403
interpreter_version_info = {{
403
404
"major": "{interpreter_version_info_major}",
@@ -433,6 +434,7 @@ py_exec_tools_toolchain(
433
434
python_version = python_short_version ,
434
435
python_version_nodot = python_short_version .replace ("." , "" ),
435
436
coverage_attr = coverage_attr_text ,
437
+ coverage_rc = rctx .attr .coverage_rc ,
436
438
interpreter_version_info_major = python_version_info [0 ],
437
439
interpreter_version_info_minor = python_version_info [1 ],
438
440
interpreter_version_info_micro = python_version_info [2 ],
@@ -445,6 +447,7 @@ py_exec_tools_toolchain(
445
447
attrs = {
446
448
"auth_patterns" : rctx .attr .auth_patterns ,
447
449
"coverage_tool" : rctx .attr .coverage_tool ,
450
+ "coverage_rc" : rctx .attr .coverage_rc ,
448
451
"distutils" : rctx .attr .distutils ,
449
452
"distutils_content" : rctx .attr .distutils_content ,
450
453
"ignore_root_user_error" : rctx .attr .ignore_root_user_error ,
@@ -496,6 +499,12 @@ For more information see the official bazel docs
496
499
(https://bazel.build/reference/be/python#py_runtime.coverage_tool).
497
500
""" ,
498
501
),
502
+ "coverage_rc" : attr .label (
503
+ allow_single_file = True ,
504
+ doc = ".converage or pyproject.toml or " +
505
+ "for configure coverage tool" ,
506
+ mandatory = False ,
507
+ ),
499
508
"distutils" : attr .label (
500
509
allow_single_file = True ,
501
510
doc = "A distutils.cfg file to be included in the Python installation. " +
@@ -567,6 +576,7 @@ def python_register_toolchains(
567
576
distutils_content = None ,
568
577
register_toolchains = True ,
569
578
register_coverage_tool = False ,
579
+ coverage_rc = None ,
570
580
set_python_version_constraint = False ,
571
581
tool_versions = TOOL_VERSIONS ,
572
582
** kwargs ):
@@ -660,6 +670,7 @@ def python_register_toolchains(
660
670
distutils_content = distutils_content ,
661
671
strip_prefix = strip_prefix ,
662
672
coverage_tool = coverage_tool ,
673
+ coverage_rc = coverage_rc ,
663
674
** kwargs
664
675
)
665
676
if register_toolchains :
0 commit comments