narrow-activity-17405
01/19/2021, 9:02 AMresources
using a macro? The thing is... In each package within my monorepo, I'm defining two exactly the same resources, like this:
resources(
name = "py.typed",
sources = ["py.typed"],
)
resources(
name = "VERSION",
sources = ["VERSION"],
)
It would be nice if I can simplify this to something like this:
my_standard_resources()
hundreds-father-404
01/20/2021, 2:40 AMA macro can create multiple targets:
def python23_tests(name, **kwargs):
kwargs.pop("interpreter_constraints", None)
python_tests(
name=f"{name}_py2",
interpreter_constraints=["==2.7.*"],
**kwargs,
)
python_tests(
name=f"{name}_py3",
interpreter_constraints=[">=3.5"],
**kwargs,
)
narrow-activity-17405
01/20/2021, 7:42 AMnarrow-activity-17405
01/21/2021, 1:09 PM