From 53a0645701ce48c19b9f12f94e61e2e8bd4f7128 Mon Sep 17 00:00:00 2001 From: Tony Aiuto Date: Wed, 14 Jun 2023 13:11:37 -0400 Subject: [PATCH 1/3] be more restrictive on what is in the distribution --- rules/BUILD | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rules/BUILD b/rules/BUILD index 2f510f4..387019a 100644 --- a/rules/BUILD +++ b/rules/BUILD @@ -35,7 +35,10 @@ trace( filegroup( name = "standard_package", - srcs = glob(["**"]), + srcs = glob([ + "**/BUILD", + "**/*.bzl", + ]), ) # Do not create a bzl_library(). That would create a dependency loop back From 057b0f5cdd113a01526d7a2552a688ffbc8ee734 Mon Sep 17 00:00:00 2001 From: Tony Aiuto Date: Wed, 14 Jun 2023 13:18:03 -0400 Subject: [PATCH 2/3] fix python with bzlmod --- MODULE.bazel | 2 +- tests/apps/BUILD | 3 ++- tools/BUILD | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index e2d3917..7b3dc47 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -13,5 +13,5 @@ module( # Only for development bazel_dep(name = "rules_pkg", version = "0.7.0", dev_dependency = True) -bazel_dep(name = "rules_python", version = "0.19.0", dev_dependency = True) +bazel_dep(name = "rules_python", version = "0.23.0", dev_dependency = True) bazel_dep(name = "stardoc", version = "0.5.3", dev_dependency = True) diff --git a/tests/apps/BUILD b/tests/apps/BUILD index b5fd1bb..fe4846b 100644 --- a/tests/apps/BUILD +++ b/tests/apps/BUILD @@ -1,6 +1,7 @@ # Test cases for license rules: Sample app load("@rules_license//sample_reports:licenses_used.bzl", "licenses_used") +load("@rules_python//python:defs.bzl", "py_test") package(default_visibility = ["//examples:__subpackages__"]) @@ -63,7 +64,7 @@ py_test( name = "an_app_licenses_test", srcs = ["an_app_licenses_test.py"], data = [":an_app_licenses.json"], - python_version = "PY3", + # python_version = "PY3", deps = [ "@rules_license//tests:license_test_utils", ], diff --git a/tools/BUILD b/tools/BUILD index 2b56a34..4422ca0 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -14,6 +14,8 @@ """License declaration and compliance checking tools.""" +load("@rules_python//python:defs.bzl", "py_binary") + package( default_applicable_licenses = ["//:license", "//:package_info"], default_visibility = ["//visibility:public"], From cf005008ba48bbf56cbe6c28c8023246b78f02a7 Mon Sep 17 00:00:00 2001 From: Tony Aiuto Date: Wed, 14 Jun 2023 13:20:19 -0400 Subject: [PATCH 3/3] fix py3 --- tests/apps/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/apps/BUILD b/tests/apps/BUILD index fe4846b..c8b59df 100644 --- a/tests/apps/BUILD +++ b/tests/apps/BUILD @@ -64,7 +64,7 @@ py_test( name = "an_app_licenses_test", srcs = ["an_app_licenses_test.py"], data = [":an_app_licenses.json"], - # python_version = "PY3", + python_version = "PY3", deps = [ "@rules_license//tests:license_test_utils", ],