load("@rules_python//python:pip.bzl", "compile_pip_requirements") load("@pip//:requirements.bzl", "requirement") load(":defs.bzl", "generate_interface") load("//private:defs.bzl", "py_pytest") package(default_visibility = ["//visibility:public"]) # This rule adds a convenient way to update the requirements file. compile_pip_requirements( name = "requirements", src = "requirements.txt", requirements_txt = "requirements_lock.txt", ) py_binary( name = "interface_generator", srcs = [ "interface_definition.py", "interface_generator.py", "templates.py", ], data = glob(["templates/*"]) + ["LICENSE.md"], main = "interface_generator.py", deps = ["@pip//mako"], ) # interface generator python tests py_test( name = "templates_unittest", srcs = [ "templates.py", "templates_unittest.py", ], data = glob(["templates/*"]), deps = ["@pip//mako"], ) py_pytest( name = "pytest", srcs = [ "interface_definition.py", "interface_generator.py", "templates.py", ], deps = [ requirement("mako"), ], ) # make license available to test package exports_files(["LICENSE.md"])