|
| 1 | +# Copyright 2017 Google Inc. All Rights Reserved. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +def repositories(): |
| 16 | + native.new_http_archive( |
| 17 | + name = "httplib2", |
| 18 | + url = "https://codeload.github.com/httplib2/httplib2/tar.gz/v0.10.3", |
| 19 | + sha256 = "d1bee28a68cc665c451c83d315e3afdbeb5391f08971dcc91e060d5ba16986f1", |
| 20 | + strip_prefix = "httplib2-0.10.3/python2/httplib2/", |
| 21 | + type = "tar.gz", |
| 22 | + build_file_content = """ |
| 23 | +py_library( |
| 24 | + name = "httplib2", |
| 25 | + srcs = glob(["**/*.py"]), |
| 26 | + data = ["cacerts.txt"], |
| 27 | + visibility = ["//visibility:public"] |
| 28 | +)""", |
| 29 | + ) |
| 30 | + |
| 31 | + # Used by oauth2client |
| 32 | + native.new_http_archive( |
| 33 | + name = "six", |
| 34 | + url = "https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz", |
| 35 | + sha256 = "e24052411fc4fbd1f672635537c3fc2330d9481b18c0317695b46259512c91d5", |
| 36 | + strip_prefix = "six-1.9.0/", |
| 37 | + type = "tar.gz", |
| 38 | + build_file_content = """ |
| 39 | +# Rename six.py to __init__.py |
| 40 | +genrule( |
| 41 | + name = "rename", |
| 42 | + srcs = ["six.py"], |
| 43 | + outs = ["__init__.py"], |
| 44 | + cmd = "cat $< >$@", |
| 45 | +) |
| 46 | +py_library( |
| 47 | + name = "six", |
| 48 | + srcs = [":__init__.py"], |
| 49 | + visibility = ["//visibility:public"], |
| 50 | +)""" |
| 51 | + ) |
| 52 | + |
| 53 | + # Used for authentication in containerregistry |
| 54 | + native.new_http_archive( |
| 55 | + name = "oauth2client", |
| 56 | + url = "https://codeload.github.com/google/oauth2client/tar.gz/v4.0.0", |
| 57 | + sha256 = "7230f52f7f1d4566a3f9c3aeb5ffe2ed80302843ce5605853bee1f08098ede46", |
| 58 | + strip_prefix = "oauth2client-4.0.0/oauth2client/", |
| 59 | + type = "tar.gz", |
| 60 | + build_file_content = """ |
| 61 | +py_library( |
| 62 | + name = "oauth2client", |
| 63 | + srcs = glob(["**/*.py"]), |
| 64 | + visibility = ["//visibility:public"], |
| 65 | + deps = [ |
| 66 | + "@httplib2//:httplib2", |
| 67 | + "@six//:six", |
| 68 | + ] |
| 69 | +)""" |
| 70 | + ) |
| 71 | + |
| 72 | + # Used for parallel execution in containerregistry |
| 73 | + native.new_http_archive( |
| 74 | + name = "concurrent", |
| 75 | + url = "https://codeload.github.com/agronholm/pythonfutures/tar.gz/3.0.5", |
| 76 | + sha256 = "a7086ddf3c36203da7816f7e903ce43d042831f41a9705bc6b4206c574fcb765", |
| 77 | + strip_prefix = "pythonfutures-3.0.5/concurrent/", |
| 78 | + type = "tar.gz", |
| 79 | + build_file_content = """ |
| 80 | +py_library( |
| 81 | + name = "concurrent", |
| 82 | + srcs = glob(["**/*.py"]), |
| 83 | + visibility = ["//visibility:public"] |
| 84 | +)""" |
| 85 | + ) |
| 86 | + |
| 87 | + # For packaging python tools. |
| 88 | + native.git_repository( |
| 89 | + name = "subpar", |
| 90 | + remote = "https://github.com/google/subpar", |
| 91 | + commit = "7e12cc130eb8f09c8cb02c3585a91a4043753c56", |
| 92 | + ) |
0 commit comments