diff --git a/WORKSPACE b/WORKSPACE index 3a30f99..24dc796 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -127,3 +127,12 @@ http_archive( build_file = "@pybind11_bazel//:pybind11.BUILD", ) +# License rules. +http_archive( + name = "rules_license", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/rules_license/releases/download/0.0.7/rules_license-0.0.7.tar.gz", + "https://github.com/bazelbuild/rules_license/releases/download/0.0.7/rules_license-0.0.7.tar.gz", + ], + sha256 = "4531deccb913639c30e5c7512a054d5d875698daeb75d8cf90f284375fe7c360", +) diff --git a/neural_structured_learning/BUILD b/neural_structured_learning/BUILD index f439c8d..eda5fd8 100644 --- a/neural_structured_learning/BUILD +++ b/neural_structured_learning/BUILD @@ -17,8 +17,17 @@ # Placeholder for internal Python strict compatibility macro. # Internal annotation for sync +load("@rules_license//rules:license.bzl", "license") -package(default_visibility = ["//visibility:public"]) +package( + default_applicable_licenses = [":license"], + default_visibility = ["//visibility:public"], +) + +license( + name = "license", + package_name = "neural_structured_learning", +) licenses(["notice"]) diff --git a/neural_structured_learning/configs/BUILD b/neural_structured_learning/configs/BUILD index 0a0b531..af41302 100644 --- a/neural_structured_learning/configs/BUILD +++ b/neural_structured_learning/configs/BUILD @@ -18,10 +18,12 @@ # Placeholder for internal Python strict compatibility macro. package( + default_applicable_licenses = ["//neural_structured_learning:license"], default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 ) +licenses(["notice"]) + py_library( name = "configs", srcs = [ diff --git a/neural_structured_learning/estimator/BUILD b/neural_structured_learning/estimator/BUILD index 28dd69d..e9ab945 100644 --- a/neural_structured_learning/estimator/BUILD +++ b/neural_structured_learning/estimator/BUILD @@ -18,10 +18,12 @@ # Placeholder for internal Python strict & test compatibility macro. package( + default_applicable_licenses = ["//neural_structured_learning:license"], default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 ) +licenses(["notice"]) + py_library( name = "estimator", srcs = ["__init__.py"], diff --git a/neural_structured_learning/examples/BUILD b/neural_structured_learning/examples/BUILD index 583c762..2c55290 100644 --- a/neural_structured_learning/examples/BUILD +++ b/neural_structured_learning/examples/BUILD @@ -1,7 +1,10 @@ package( - licenses = ["notice"], # Apache 2.0 + default_applicable_licenses = ["//neural_structured_learning:license"], + default_visibility = ["//visibility:public"], ) +licenses(["notice"]) + py_binary( name = "graph_keras_mlp_cora", srcs = ["graph_keras_mlp_cora.py"], diff --git a/neural_structured_learning/experimental/BUILD b/neural_structured_learning/experimental/BUILD index a1151fb..09f6c73 100644 --- a/neural_structured_learning/experimental/BUILD +++ b/neural_structured_learning/experimental/BUILD @@ -2,10 +2,12 @@ # Placeholder for internal Python strict compatibility macro. package( + default_applicable_licenses = ["//neural_structured_learning:license"], default_visibility = ["//neural_structured_learning:__subpackages__"], - licenses = ["notice"], # Apache 2.0 ) +licenses(["notice"]) + py_library( name = "experimental", srcs = ["__init__.py"], diff --git a/neural_structured_learning/keras/BUILD b/neural_structured_learning/keras/BUILD index fbee86d..a6fd0d3 100644 --- a/neural_structured_learning/keras/BUILD +++ b/neural_structured_learning/keras/BUILD @@ -18,10 +18,12 @@ # Build rules for Keras APIs in Neural Structured Learning. package( + default_applicable_licenses = ["//neural_structured_learning:license"], default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 ) +licenses(["notice"]) + py_library( name = "keras", srcs = ["__init__.py"], diff --git a/neural_structured_learning/keras/layers/BUILD b/neural_structured_learning/keras/layers/BUILD index 55cb6d2..d92306b 100644 --- a/neural_structured_learning/keras/layers/BUILD +++ b/neural_structured_learning/keras/layers/BUILD @@ -18,9 +18,12 @@ # Build rules for custom Keras layers in Neural Structured Learning. package( - licenses = ["notice"], # Apache 2.0 + default_applicable_licenses = ["//neural_structured_learning:license"], + default_visibility = ["//visibility:public"], ) +licenses(["notice"]) + py_library( name = "layers", srcs = ["__init__.py"], diff --git a/neural_structured_learning/lib/BUILD b/neural_structured_learning/lib/BUILD index 927b457..aa179b7 100644 --- a/neural_structured_learning/lib/BUILD +++ b/neural_structured_learning/lib/BUILD @@ -18,10 +18,12 @@ # Build rules for libraries and ops in Neural Structured Learning. package( + default_applicable_licenses = ["//neural_structured_learning:license"], default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 ) +licenses(["notice"]) + py_library( name = "lib", srcs = ["__init__.py"], diff --git a/neural_structured_learning/tools/BUILD b/neural_structured_learning/tools/BUILD index 1aeba3f..b00b7aa 100644 --- a/neural_structured_learning/tools/BUILD +++ b/neural_structured_learning/tools/BUILD @@ -18,10 +18,12 @@ # Build rules for tools in Neural Structured Learning. package( + default_applicable_licenses = ["//neural_structured_learning:license"], default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 ) +licenses(["notice"]) + py_library( name = "tools", srcs = ["__init__.py"], diff --git a/research/carls/util/BUILD b/research/carls/util/BUILD index 7e2396d..bd4cebe 100644 --- a/research/carls/util/BUILD +++ b/research/carls/util/BUILD @@ -18,10 +18,12 @@ # Placeholder for internal Python strict & test compatibility macro. package( + default_applicable_licenses = ["//neural_structured_learning:license"], default_visibility = ["//research/carls:internal"], - licenses = ["notice"], # Apache 2.0 ) +licenses(["notice"]) + py_library( name = "array_ops", srcs = ["array_ops.py"], diff --git a/research/meo/linear_finetuning/BUILD b/research/meo/linear_finetuning/BUILD index f1af79e..d4b342b 100644 --- a/research/meo/linear_finetuning/BUILD +++ b/research/meo/linear_finetuning/BUILD @@ -15,10 +15,12 @@ load("//devtools/python/blaze:pytype.bzl", "pytype_strict_binary", "pytype_strict_library") package( + default_applicable_licenses = ["//neural_structured_learning:license"], default_visibility = ["//research/meo:__subpackages__"], - licenses = ["notice"], # Apache 2.0 ) +licenses(["notice"]) + pytype_strict_library( name = "linear_finetuning_lib", srcs = [ diff --git a/research/meo/mlp_baseline/BUILD b/research/meo/mlp_baseline/BUILD index 4caeec8..17194c8 100644 --- a/research/meo/mlp_baseline/BUILD +++ b/research/meo/mlp_baseline/BUILD @@ -15,10 +15,12 @@ load("//devtools/python/blaze:pytype.bzl", "pytype_strict_binary", "pytype_strict_library") package( + default_applicable_licenses = ["//neural_structured_learning:license"], default_visibility = ["//research/meo:__subpackages__"], - licenses = ["notice"], # Apache 2.0 ) +licenses(["notice"]) + pytype_strict_library( name = "mlp_baseline_lib", srcs = [ diff --git a/research/meo/parameter_generator_generation/BUILD b/research/meo/parameter_generator_generation/BUILD index 4bc8176..e281b87 100644 --- a/research/meo/parameter_generator_generation/BUILD +++ b/research/meo/parameter_generator_generation/BUILD @@ -15,10 +15,12 @@ load("//devtools/python/blaze:pytype.bzl", "pytype_strict_binary", "pytype_strict_library") package( + default_applicable_licenses = ["//neural_structured_learning:license"], default_visibility = ["//research/meo:__subpackages__"], - licenses = ["notice"], # Apache 2.0 ) +licenses(["notice"]) + pytype_strict_library( name = "parameter_generator_lib", srcs = [ diff --git a/research/neural_clustering/BUILD b/research/neural_clustering/BUILD index 8ed64d1..f290fec 100644 --- a/research/neural_clustering/BUILD +++ b/research/neural_clustering/BUILD @@ -18,10 +18,12 @@ # Build rules for Neural Clustering. package( + default_applicable_licenses = ["//neural_structured_learning:license"], default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 ) +licenses(["notice"]) + py_library( name = "neural_clustering", srcs = ["__init__.py"], diff --git a/research/neural_clustering/data_generators/BUILD b/research/neural_clustering/data_generators/BUILD index 52c99f3..69f8ccb 100644 --- a/research/neural_clustering/data_generators/BUILD +++ b/research/neural_clustering/data_generators/BUILD @@ -18,10 +18,12 @@ # Build rules for data modules in Neural Clustering. package( + default_applicable_licenses = ["//neural_structured_learning:license"], default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 ) +licenses(["notice"]) + py_library( name = "data_generators", srcs = ["__init__.py"], diff --git a/research/neural_clustering/models/BUILD b/research/neural_clustering/models/BUILD index b86ed0f..a98b1fa 100644 --- a/research/neural_clustering/models/BUILD +++ b/research/neural_clustering/models/BUILD @@ -18,10 +18,12 @@ # Build rules for models in Neural Clustering. package( + default_applicable_licenses = ["//neural_structured_learning:license"], default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 ) +licenses(["notice"]) + py_library( name = "models", srcs = ["__init__.py"], diff --git a/research/neural_clustering/utils/BUILD b/research/neural_clustering/utils/BUILD index 98b13c1..203998d 100644 --- a/research/neural_clustering/utils/BUILD +++ b/research/neural_clustering/utils/BUILD @@ -18,10 +18,12 @@ # Build rules for utils in Neural Clustering. package( + default_applicable_licenses = ["//neural_structured_learning:license"], default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 ) +licenses(["notice"]) + py_library( name = "utils", srcs = ["__init__.py"],