Skip to content

Commit

Permalink
Let bazel py_test use the local pyproject.toml
Browse files Browse the repository at this point in the history
CMK-19117

Change-Id: I198cd0d78324f1e488e78511e412389b7f3f70e8
  • Loading branch information
Synss committed Sep 26, 2024
1 parent e85a597 commit ba82c4e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 4 additions & 5 deletions packages/cmk-agent-based/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ load("@omd_packages//omd/packages/rules:package_wheel.bzl", "package_wheel")
load("@rules_python//python:packaging.bzl", "py_wheel")
load("@rules_python//python:pip.bzl", "compile_pip_requirements")

exports_files(["pyproject.toml"])

compile_pip_requirements(
name = "requirements",
requirements_in = "pyproject.toml",
Expand Down Expand Up @@ -49,11 +51,8 @@ py_pytest_main(
py_test(
name = "unit",
srcs = glob(["tests/**/*.py"]) + [":__test__.py"],
# TODO: Duplicated from pyproject.toml
args = [
"--import-mode=importlib",
"--doctest-modules",
],
args = ["--config-file=$(location pyproject.toml)"],
data = ["pyproject.toml"],
imports = ["."],
main = ":__test__.py",
deps = [
Expand Down
9 changes: 4 additions & 5 deletions packages/cmk-werks/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ load("@omd_packages//omd/packages/rules:package_wheel.bzl", "package_wheel")
load("@rules_python//python:packaging.bzl", "py_wheel")
load("@rules_python//python:pip.bzl", "compile_pip_requirements")

exports_files(["pyproject.toml"])

compile_pip_requirements(
name = "requirements",
requirements_in = "pyproject.toml",
Expand Down Expand Up @@ -43,11 +45,8 @@ py_pytest_main(
py_test(
name = "unit",
srcs = glob(["tests/**/*.py"]) + [":__test__.py"],
# TODO: Duplicated from pyproject.toml
args = [
"--import-mode=importlib",
"--doctest-modules",
],
args = ["--config-file=$(location pyproject.toml)"],
data = ["pyproject.toml"],
imports = ["."],
main = ":__test__.py",
deps = [
Expand Down

0 comments on commit ba82c4e

Please sign in to comment.