Skip to content

Commit 5563e69

Browse files
authored
Load py symbols from @rules_python (#2286)
1 parent 7215260 commit 5563e69

File tree

8 files changed

+15
-2
lines changed

8 files changed

+15
-2
lines changed

WORKSPACE

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,8 @@ rbe_autoconfig(
459459
http_archive(
460460
name = "httplib2",
461461
build_file_content = """
462+
load("@rules_python//python:defs.bzl", "py_library")
463+
462464
py_library(
463465
name = "httplib2",
464466
srcs = glob(["**/*.py"]),
@@ -477,6 +479,8 @@ py_library(
477479
http_archive(
478480
name = "six",
479481
build_file_content = """
482+
load("@rules_python//python:defs.bzl", "py_library")
483+
480484
# Rename six.py to __init__.py
481485
genrule(
482486
name = "rename",
@@ -502,6 +506,8 @@ py_library(
502506
http_archive(
503507
name = "oauth2client",
504508
build_file_content = """
509+
load("@rules_python//python:defs.bzl", "py_library")
510+
505511
py_library(
506512
name = "oauth2client",
507513
srcs = glob(["**/*.py"]),

container/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
16+
load("@rules_python//python:defs.bzl", "py_binary", "py_library")
1617

1718
package(default_visibility = ["//visibility:public"])
1819

contrib/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
16+
load("@rules_python//python:defs.bzl", "py_binary", "py_library")
1617

1718
package(default_visibility = ["//visibility:public"])
1819

docker/util/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
16+
load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
1617

1718
package(default_visibility = ["//visibility:public"])
1819

python/image.bzl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ load(
2929
"//repositories:go_repositories.bzl",
3030
_go_deps = "go_deps",
3131
)
32+
load("@rules_python//python:defs.bzl", "py_binary", "py_library")
3233

3334
# Load the resolved digests.
3435
load(":python.bzl", "DIGESTS")
@@ -75,7 +76,7 @@ DEFAULT_BASE = select({
7576

7677
def py_layer(name, deps, filter = "", **kwargs):
7778
binary_name = name + ".layer-binary"
78-
native.py_library(name = binary_name, deps = deps, **kwargs)
79+
py_library(name = binary_name, deps = deps, **kwargs)
7980
filter_layer(name = name, dep = binary_name, filter = filter)
8081

8182
def py_image(name, base = None, deps = [], layers = [], env = {}, **kwargs):
@@ -98,7 +99,7 @@ def py_image(name, base = None, deps = [], layers = [], env = {}, **kwargs):
9899
# TODO(mattmoor): Consider using par_binary instead, so that
99100
# a single target can be used for all three.
100101

101-
native.py_binary(
102+
py_binary(
102103
name = binary_name,
103104
python_version = "PY2",
104105
deps = deps + layers,

testdata/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ load("//python3:image.bzl", "py3_image")
5454
load("//scala:image.bzl", "scala_image")
5555
load("//testdata:utils.bzl", "generate_deb", "rule_with_symlinks")
5656
load(":stamp_info.bzl", "stamp_info")
57+
load("@rules_python//python:defs.bzl", "py_binary", "py_library")
5758

5859
package(default_visibility = ["//visibility:public"])
5960

testdata/test/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
load("@io_bazel_rules_docker//python3:image.bzl", "py3_image")
1616
load("@io_bazel_rules_docker_pip_deps//:requirements.bzl", "all_requirements", "requirement")
17+
load("@rules_python//python:defs.bzl", "py_library")
1718

1819
package(default_visibility = ["//testdata:__subpackages__"])
1920

tests/container/python/BUILD

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

15+
load("@rules_python//python:defs.bzl", "py_library")
1516
load("//contrib:test.bzl", "container_test")
1617
load("//python3:image.bzl", "py3_image")
1718

0 commit comments

Comments
 (0)