Skip to content

Commit 7c0abe5

Browse files
authored
Move load statements to the top to remove the Buildifier warnings (bazel-contrib#277)
Also fix a dict ordering issue
1 parent 38f86fb commit 7c0abe5

File tree

10 files changed

+33
-27
lines changed

10 files changed

+33
-27
lines changed

distro/BUILD

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
package(
2-
default_visibility = ["//visibility:private"],
3-
)
4-
51
load("@rules_pkg//:pkg.bzl", "pkg_tar")
62
load("@rules_pkg//releasing:defs.bzl", "print_rel_notes")
73
load("@rules_python//:version.bzl", "version")
84

5+
package(
6+
default_visibility = ["//visibility:private"],
7+
)
8+
99
# Build the artifact to put on the github release page.
1010
pkg_tar(
1111
name = "rules_python-%s" % version,

docs/BUILD

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
# To regenerate documentation, run the top-level update_docs.sh script. #
1717
###############################################################################
1818

19+
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
20+
load("@io_bazel_skydoc//stardoc:stardoc.bzl", "stardoc")
21+
1922
package(default_visibility = ["//visibility:public"])
2023

2124
licenses(["notice"]) # Apache 2.0
2225

23-
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
24-
load("@io_bazel_skydoc//stardoc:stardoc.bzl", "stardoc")
25-
2626
# We define these bzl_library targets here rather than in the //python package
2727
# because they're only used for doc generation. This way, we avoid requiring
2828
# our users to depend on Skylib.

examples/boto/BUILD

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
package(default_visibility = ["//visibility:public"])
15-
16-
licenses(["notice"]) # Apache 2.0
1714

1815
load("@examples_boto//:requirements.bzl", "requirement")
1916
load("//python:defs.bzl", "py_test")
2017

18+
package(default_visibility = ["//visibility:public"])
19+
20+
licenses(["notice"]) # Apache 2.0
21+
2122
py_test(
2223
name = "boto_test",
2324
srcs = ["boto_test.py"],

examples/extras/BUILD

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
package(default_visibility = ["//visibility:public"])
15-
16-
licenses(["notice"]) # Apache 2.0
1714

1815
load("@examples_extras//:requirements.bzl", "requirement")
1916
load("//python:defs.bzl", "py_test")
2017

18+
package(default_visibility = ["//visibility:public"])
19+
20+
licenses(["notice"]) # Apache 2.0
21+
2122
py_test(
2223
name = "extras_test",
2324
srcs = ["extras_test.py"],

examples/helloworld/BUILD

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
package(default_visibility = ["//visibility:public"])
15-
16-
licenses(["notice"]) # Apache 2.0
1714

1815
load("@examples_helloworld//:requirements.bzl", "requirement")
1916
load("//python:defs.bzl", "py_library", "py_test")
2017

18+
package(default_visibility = ["//visibility:public"])
19+
20+
licenses(["notice"]) # Apache 2.0
21+
2122
py_library(
2223
name = "helloworld",
2324
srcs = ["helloworld.py"],

examples/version/BUILD

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
package(default_visibility = ["//visibility:public"])
15-
16-
licenses(["notice"]) # Apache 2.0
1714

1815
load("@examples_version//:requirements.bzl", "requirement")
1916
load("//python:defs.bzl", "py_test")
2017

18+
package(default_visibility = ["//visibility:public"])
19+
20+
licenses(["notice"]) # Apache 2.0
21+
2122
py_test(
2223
name = "version_test",
2324
srcs = ["version_test.py"],

experimental/examples/wheel/BUILD

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
package(default_visibility = ["//visibility:public"])
15-
16-
licenses(["notice"]) # Apache 2.0
1714

1815
load("//experimental/python:wheel.bzl", "py_package", "py_wheel")
1916
load("//python:defs.bzl", "py_library", "py_test")
2017

18+
package(default_visibility = ["//visibility:public"])
19+
20+
licenses(["notice"]) # Apache 2.0
21+
2122
py_library(
2223
name = "main",
2324
srcs = ["main.py"],

experimental/examples/wheel/lib/BUILD

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
15+
load("//python:defs.bzl", "py_library")
16+
1417
package(default_visibility = ["//visibility:public"])
1518

1619
licenses(["notice"]) # Apache 2.0
1720

18-
load("//python:defs.bzl", "py_library")
19-
2021
py_library(
2122
name = "simple_module",
2223
srcs = ["simple_module.py"],

experimental/python/wheel.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ belong to given set of Python packages.
6969
This rule is intended to be used as data dependency to py_wheel rule
7070
""",
7171
attrs = {
72+
"deps": attr.label_list(),
7273
"packages": attr.string_list(
7374
mandatory = False,
7475
allow_empty = True,
@@ -77,7 +78,6 @@ List of Python packages to include in the distribution.
7778
Sub-packages are automatically included.
7879
""",
7980
),
80-
"deps": attr.label_list(),
8181
},
8282
)
8383

packaging/BUILD

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
licenses(["notice"]) # Apache 2.0
16-
1715
load("@piptool_deps//:requirements.bzl", "requirement")
1816
load("@subpar//:subpar.bzl", "par_binary")
1917
load("//python:defs.bzl", "py_library", "py_test")
2018

19+
licenses(["notice"]) # Apache 2.0
20+
2121
py_library(
2222
name = "whl",
2323
srcs = ["whl.py"],

0 commit comments

Comments
 (0)