forked from google/containerregistry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
def.bzl
executable file
·90 lines (83 loc) · 2.86 KB
/
def.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def repositories():
"""Load bazel dependencies."""
http_archive(
name = "httplib2",
url = "https://codeload.github.com/httplib2/httplib2/tar.gz/v0.17.0",
sha256 = "556aa045aefeed3fd58a003251c94627e077ab0732758e5178a0074d9c75a68b",
strip_prefix = "httplib2-0.17.0/python3/httplib2/",
type = "tar.gz",
build_file_content = """
py_library(
name = "httplib2",
srcs = glob(["**/*.py"]),
data = ["cacerts.txt"],
visibility = ["//visibility:public"]
)""",
)
# Used by oauth2client
http_archive(
name = "six",
url = "https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz",
sha256 = "e24052411fc4fbd1f672635537c3fc2330d9481b18c0317695b46259512c91d5",
strip_prefix = "six-1.9.0/",
type = "tar.gz",
build_file_content = """
# Rename six.py to __init__.py
genrule(
name = "rename",
srcs = ["six.py"],
outs = ["__init__.py"],
cmd = "cat $< >$@",
)
py_library(
name = "six",
srcs = [":__init__.py"],
visibility = ["//visibility:public"],
)""",
)
# Used for authentication in containerregistry
http_archive(
name = "oauth2client",
url = "https://codeload.github.com/google/oauth2client/tar.gz/v4.0.0",
sha256 = "7230f52f7f1d4566a3f9c3aeb5ffe2ed80302843ce5605853bee1f08098ede46",
strip_prefix = "oauth2client-4.0.0/oauth2client/",
type = "tar.gz",
build_file_content = """
py_library(
name = "oauth2client",
srcs = glob(["**/*.py"]),
visibility = ["//visibility:public"],
deps = [
"@httplib2//:httplib2",
"@six//:six",
]
)""",
)
# For subpar.
http_archive(
name = "rules_python",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.0.1/rules_python-0.0.1.tar.gz",
sha256 = "aa96a691d3a8177f3215b14b0edc9641787abaaa30363a080165d06ab65e1161",
)
# For packaging python tools.
git_repository(
name = "subpar",
remote = "https://github.com/google/subpar",
commit = "9fae6b63cfeace2e0fb93c9c1ebdc28d3991b16f", # 2019-08-14
shallow_since = "1565833028 -0400",
)