Make data and srcs additive

This commit is contained in:
Reid 'arrdem' McKenzie 2023-06-03 01:34:57 -06:00
parent 5c7badf7e5
commit 6994959680

View file

@ -160,6 +160,7 @@ def py_project(name=None,
main_deps=None, main_deps=None,
main_data=None, main_data=None,
shebang=None, shebang=None,
zip_safe=True,
lib_srcs=None, lib_srcs=None,
lib_deps=None, lib_deps=None,
lib_data=None, lib_data=None,
@ -177,26 +178,33 @@ def py_project(name=None,
""" """
lib_srcs = lib_srcs or native.glob(["src/python/**/*.py"], lib_srcs = (lib_srcs or []) + \
exclude=[ native.glob(["src/python/**/*.py"],
"**/*.pyc", exclude=[
]) "**/*.pyc",
lib_data = lib_data or native.glob(["src/resources/**/*", ])
"src/python/**/*"],
exclude=[ lib_data = (lib_data or []) + \
"**/*.py", native.glob(["src/resources/**/*",
"**/*.pyc", "src/python/**/*"],
]) exclude=[
test_srcs = test_srcs or native.glob(["test/python/**/*.py"], "**/*.py",
exclude=[ "**/*.pyc",
"**/*.pyc", ])
])
test_data = test_data or native.glob(["test/resources/**/*", test_srcs = (test_srcs or []) + \
"test/python/**/*"], native.glob(["test/python/**/*.py"],
exclude=[ exclude=[
"**/*.py", "**/*.pyc",
"**/*.pyc", ])
])
test_data = (test_data or []) + \
native.glob(["test/resources/**/*",
"test/python/**/*"],
exclude=[
"**/*.py",
"**/*.pyc",
])
lib_name = name if not main else "lib" lib_name = name if not main else "lib"
@ -242,6 +250,7 @@ def py_project(name=None,
"//visibility:public", "//visibility:public",
], ],
shebang = shebang, shebang = shebang,
zip_safe=zip_safe,
) )
for src in test_srcs: for src in test_srcs: