Skip to content

Commit 1d6cd38

Browse files
hofbialexeagle
andauthored
chore: Autoformat with buildifier (#480)
Follow up of #474 running buildifier on all files. A follow up PR will fix the remaining `buildifier-lint` warnings and add pre-commit to CI similar to bazel-contrib/rules-template#130. Co-authored-by: Alex Eagle <[email protected]>
1 parent e618b75 commit 1d6cd38

File tree

23 files changed

+45
-46
lines changed

23 files changed

+45
-46
lines changed

BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_binary")
22
load("@pypi//:requirements.bzl", "all_whl_requirements")
3+
load("@rules_python//python:defs.bzl", "py_runtime", "py_runtime_pair")
4+
load("@rules_python//python/pip_install:requirements.bzl", "compile_pip_requirements")
35
load("@rules_python_gazelle_plugin//:def.bzl", "GAZELLE_PYTHON_RUNTIME_DEPS")
46
load("@rules_python_gazelle_plugin//manifest:defs.bzl", "gazelle_python_manifest")
57
load("@rules_python_gazelle_plugin//modules_mapping:def.bzl", "modules_mapping")
6-
load("@rules_python//python:defs.bzl", "py_runtime", "py_runtime_pair")
7-
load("@rules_python//python/pip_install:requirements.bzl", "compile_pip_requirements")
88

99
# gazelle:exclude internal_python_deps.bzl
1010
# gazelle:exclude internal_deps.bzl

MODULE.bazel

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
module(
44
name = "aspect_rules_py",
5-
compatibility_level = 1,
65
version = "0.0.0",
6+
compatibility_level = 1,
77
)
88

99
# Lower-bound versions of direct dependencies.
@@ -53,7 +53,6 @@ rust = use_extension(
5353
"rust",
5454
# In released versions: dev_dependency = True
5555
)
56-
5756
rust.toolchain(
5857
edition = "2021",
5958
versions = ["1.81.0"],
@@ -70,7 +69,6 @@ crate = use_extension(
7069
"crate",
7170
# In released versions: dev_dependency = True
7271
)
73-
7472
crate.from_cargo(
7573
name = "crate_index",
7674
cargo_lockfile = "//:Cargo.lock",
@@ -83,5 +81,4 @@ crate.from_cargo(
8381
"//py/tools/unpack_bin:Cargo.toml",
8482
],
8583
)
86-
8784
use_repo(crate, "crate_index")

WORKSPACE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,11 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
115115

116116
bazel_skylib_workspace()
117117

118+
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
119+
118120
############################################
119121
# Gazelle, for generating bzl_library targets
120122
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
121-
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
122123

123124
go_rules_dependencies()
124125

e2e/smoke/MODULE.bazel

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"Bazel dependencies"
2-
bazel_dep(name = "aspect_rules_py", dev_dependency = True, version = "0.0.0")
32

3+
bazel_dep(name = "aspect_rules_py", version = "0.0.0", dev_dependency = True)
44
local_path_override(
55
module_name = "aspect_rules_py",
66
path = "../..",
@@ -15,12 +15,13 @@ rust.toolchain(
1515
versions = ["1.81.0"],
1616
)
1717
use_repo(rust, "rust_toolchains")
18+
1819
register_toolchains("@rust_toolchains//:all")
1920

2021
#---SNIP--- Below here is re-used in the snippet published on releases
2122
# Minimum version needs:
2223
# feat: add interpreter_version_info to py_runtime by @mattem in #1671
23-
bazel_dep(name = "rules_python", dev_dependency = True, version = "0.29.0")
24+
bazel_dep(name = "rules_python", version = "0.29.0", dev_dependency = True)
2425

2526
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
2627
python.toolchain(

e2e/system-interpreter/MODULE.bazel

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"Bazel dependencies"
2-
bazel_dep(name = "aspect_rules_py", dev_dependency = True, version = "0.0.0")
32

3+
bazel_dep(name = "aspect_rules_py", version = "0.0.0", dev_dependency = True)
44
local_path_override(
55
module_name = "aspect_rules_py",
66
path = "../..",
@@ -15,11 +15,12 @@ rust.toolchain(
1515
versions = ["1.81.0"],
1616
)
1717
use_repo(rust, "rust_toolchains")
18+
1819
register_toolchains("@rust_toolchains//:all")
1920

2021
#---SNIP--- Below here is re-used in the snippet published on releases
2122
# Minimum version needs:
2223
# feat: add interpreter_version_info to py_runtime by @mattem in #1671
23-
bazel_dep(name = "rules_python", dev_dependency = True, version = "0.29.0")
24+
bazel_dep(name = "rules_python", version = "0.29.0", dev_dependency = True)
2425

2526
register_toolchains("//:default")

examples/multi_version/BUILD.bazel

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ load("@aspect_rules_py//py:defs.bzl", "py_binary", "py_pytest_main", "py_test")
33
py_binary(
44
name = "multi_version",
55
srcs = ["say.py"],
6+
python_version = "3.8.12",
67
deps = [
78
"@pypi_cowsay//:pkg",
89
],
9-
python_version = "3.8.12"
1010
)
11+
1112
py_pytest_main(
1213
name = "__test__",
1314
deps = ["@pypi_pytest//:pkg"],
@@ -20,11 +21,12 @@ py_test(
2021
":__test__",
2122
],
2223
main = ":__test__.py",
24+
python_version = "3.8.12",
2325
deps = [
2426
":__test__",
2527
],
26-
python_version = "3.8.12"
2728
)
29+
2830
py_test(
2931
name = "py_version_default_test",
3032
srcs = [
@@ -35,4 +37,4 @@ py_test(
3537
deps = [
3638
":__test__",
3739
],
38-
)
40+
)

examples/py_pex_binary/BUILD.bazel

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ py_binary(
55
srcs = ["say.py"],
66
data = ["data.txt"],
77
env = {
8-
"TEST": "1"
8+
"TEST": "1",
99
},
1010
deps = [
11-
"@pypi_cowsay//:pkg",
1211
"@bazel_tools//tools/python/runfiles",
12+
"@pypi_cowsay//:pkg",
1313
],
1414
)
1515

1616
py_pex_binary(
1717
name = "py_pex_binary",
1818
binary = ":binary",
1919
inject_env = {
20-
"TEST": "1"
21-
}
20+
"TEST": "1",
21+
},
2222
)

examples/uv_pip_compile/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
load("@rules_uv//uv:pip.bzl", "pip_compile")
22

3-
pip_compile(name = "generate_requirements_txt")
3+
pip_compile(name = "generate_requirements_txt")

examples/uv_pip_compile/MODULE.bazel

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
"uv pip compile example with py"
22

33
bazel_dep(name = "rules_uv", version = "0.14.0", dev_dependency = True)
4+
45
bazel_dep(name = "rules_python", version = "0.34.0")
5-
bazel_dep(name = "aspect_rules_py", version = "0.7.4", dev_dependency = True)
6+
7+
bazel_dep(name = "aspect_rules_py", version = "0.7.4", dev_dependency = True)
68

79
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
810
python.toolchain(python_version = "3.9.13")
9-
1011
use_repo(python, "python_3_9_13")
1112

1213
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")

py/BUILD.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
44
# For stardoc to reference the files
55
exports_files(["defs.bzl"])
66

7-
# For Bazel 6.x compatibility, since
7+
# For Bazel 6.x compatibility, since
88
# PyRuntimeInfo shipped only with Bazel 7
99
# Users can set, e.g. --@aspect_rules_py//py:interpreter_version=3.9.18
1010
string_flag(
@@ -31,14 +31,14 @@ bzl_library(
3131
deps = [
3232
"//py/private:py_binary",
3333
"//py/private:py_executable",
34+
"//py/private:py_image_layer",
3435
"//py/private:py_library",
36+
"//py/private:py_pex_binary",
3537
"//py/private:py_pytest_main",
3638
"//py/private:py_unpacked_wheel",
3739
"//py/private:py_venv",
3840
"//py/private:py_wheel",
3941
"//py/private:virtual",
40-
"//py/private:py_pex_binary",
41-
"//py/private:py_image_layer",
4242
"@aspect_bazel_lib//lib:utils",
4343
],
4444
)

0 commit comments

Comments
 (0)