Add a macro for py.typed file resources
This is just a convenience method to create a resource to represent
`py.typed` files. It's easier to write:
py_typed()
than it is to write:
resources(
name = "py_typed",
sources = [ "py.typed" ]
)
@@ -9,3 +9,15 @@ def grapl_python_distribution(**kwargs):
kwargs["setup_py_commands"] = [ "sdist", "bdist_wheel" ]
python_distribution(**kwargs)
+
+
+def py_typed(**kwargs):
+ """ Creates a `resources` target for the `py.typed` file in this directory.
+ """
+ if "name" not in kwargs:
+ kwargs["name"] = "py_typed"
+
+ if "sources" not in kwargs:
+ kwargs["sources"] = [ "py.typed" ]
+
+ resources(**kwargs)
