Skip to content

Commit 4b84ad2

Browse files
authored
Ensure all core Python rules are loaded from defs.bzl (bazel-contrib#219)
This migrates rules_python itself for bazelbuild/bazel#9006. This entails adding or updating load() statements to refer to //python:defs.bzl (not //python:python.bzl), and updating whl.py so the generated repos refer to @rules_python. Also updated the dependency on subpar for compatibility with the flag. Par files are regenerated.
1 parent 6c5f479 commit 4b84ad2

File tree

12 files changed

+11
-11
lines changed

12 files changed

+11
-11
lines changed

WORKSPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ _piptool_install()
6363
git_repository(
6464
name = "subpar",
6565
remote = "https://github.com/google/subpar",
66-
tag = "2.0.0",
66+
commit = "2917d275ee27d7935f7809413c74eddf71a46e5c", # 2019-08-02
6767
)
6868

6969
###################################

examples/boto/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ package(default_visibility = ["//visibility:public"])
1616
licenses(["notice"]) # Apache 2.0
1717

1818
load("@examples_boto//:requirements.bzl", "requirement")
19-
load("//python:python.bzl", "py_test")
19+
load("//python:defs.bzl", "py_test")
2020

2121
py_test(
2222
name = "boto_test",

examples/extras/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ package(default_visibility = ["//visibility:public"])
1616
licenses(["notice"]) # Apache 2.0
1717

1818
load("@examples_extras//:requirements.bzl", "requirement")
19-
load("//python:python.bzl", "py_test")
19+
load("//python:defs.bzl", "py_test")
2020

2121
py_test(
2222
name = "extras_test",

examples/helloworld/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ package(default_visibility = ["//visibility:public"])
1616
licenses(["notice"]) # Apache 2.0
1717

1818
load("@examples_helloworld//:requirements.bzl", "requirement")
19-
load("//python:python.bzl", "py_library", "py_test")
19+
load("//python:defs.bzl", "py_library", "py_test")
2020

2121
py_library(
2222
name = "helloworld",

examples/version/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ package(default_visibility = ["//visibility:public"])
1616
licenses(["notice"]) # Apache 2.0
1717

1818
load("@examples_version//:requirements.bzl", "requirement")
19-
load("//python:python.bzl", "py_test")
19+
load("//python:defs.bzl", "py_test")
2020

2121
py_test(
2222
name = "version_test",

experimental/examples/wheel/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ package(default_visibility = ["//visibility:public"])
1515

1616
licenses(["notice"]) # Apache 2.0
1717

18-
load("//python:python.bzl", "py_library", "py_test")
18+
load("//python:defs.bzl", "py_library", "py_test")
1919
load("//experimental/python:wheel.bzl", "py_package", "py_wheel")
2020

2121
py_library(

experimental/examples/wheel/lib/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ package(default_visibility = ["//visibility:public"])
1515

1616
licenses(["notice"]) # Apache 2.0
1717

18-
load("//python:python.bzl", "py_library")
18+
load("//python:defs.bzl", "py_library")
1919

2020
py_library(
2121
name = "simple_module",

experimental/rules_python/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
load("//python:python.bzl", "py_binary")
15+
load("//python:defs.bzl", "py_binary")
1616

1717
py_binary(
1818
name = "wheelmaker",

rules_python/BUILD

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ package(default_visibility = ["//visibility:public"])
1515

1616
licenses(["notice"]) # Apache 2.0
1717

18-
load("//python:python.bzl", "py_binary", "py_library", "py_test")
18+
load("//python:defs.bzl", "py_library", "py_test")
19+
load("@subpar//:subpar.bzl", "par_binary")
1920
load("@piptool_deps//:requirements.bzl", "requirement")
2021

2122
py_library(
@@ -42,8 +43,6 @@ py_test(
4243
],
4344
)
4445

45-
load("@subpar//:subpar.bzl", "par_binary")
46-
4746
par_binary(
4847
name = "piptool",
4948
srcs = ["piptool.py"],

rules_python/whl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ def main():
142142
f.write("""
143143
package(default_visibility = ["//visibility:public"])
144144
145+
load("@rules_python//python:defs.bzl", "py_library")
145146
load("{requirements}", "requirement")
146147
147148
py_library(

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy