Skip to content

Commit 9835856

Browse files
authored
Switch to new http repo rules (bazel-contrib#135)
This upgrades our dependencies to newer versions that are compatible with the new repo rules, and handles the fallout. Also add some comments to WORKSPACE. rules_python now builds under Bazel 0.19.1 with `--incompatible_remove_native_git_repository` and `incompatible_remove_native_http_archive`. Fixes bazel-contrib#105.
1 parent 985ce99 commit 9835856

2 files changed

Lines changed: 65 additions & 24 deletions

File tree

WORKSPACE

Lines changed: 63 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,59 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
1415
workspace(name = "io_bazel_rules_python")
1516

16-
# Skydoc stuff
17+
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
18+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
19+
20+
################################
21+
# Skydoc and its dependencies. #
22+
################################
23+
24+
# Skydoc's sass dependency is not covered by skydoc_repositories(), so we have
25+
# to redeclare it here. Watch that the version matches when updating Skydoc's
26+
# version.
27+
1728
git_repository(
1829
name = "io_bazel_rules_sass",
30+
# Same commit as Skydoc uses in its own WORKSPACE.
31+
commit = "8b61ad6953fde55031658e1731c335220f881369", # 2018-10-26
1932
remote = "https://github.com/bazelbuild/rules_sass.git",
20-
tag = "0.0.3",
2133
)
2234

23-
load("@io_bazel_rules_sass//sass:sass.bzl", "sass_repositories")
35+
load("@io_bazel_rules_sass//:package.bzl", "rules_sass_dependencies")
36+
37+
rules_sass_dependencies()
38+
39+
# Node is used by sass. This weird (anti-?)pattern of initializing a repo we
40+
# didn't directly import is taken from Skydoc's WORKSPACE.
41+
load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories")
42+
43+
node_repositories()
44+
45+
load("@io_bazel_rules_sass//:defs.bzl", "sass_repositories")
2446

2547
sass_repositories()
2648

49+
# We implicitly depend on Skydoc importing Skylib under `@bazel_skylib`.
50+
# We don't redeclare it here in order to avoid repeating a definition that
51+
# could get out of sync with Skydoc.
52+
2753
git_repository(
2854
name = "io_bazel_skydoc",
29-
commit = "e9be81cf5be41e4200749f5d8aa2db7955f8aacc",
55+
commit = "77e5399258f6d91417d23634fce97d73b40cf337", # 2018-10-29
3056
remote = "https://github.com/bazelbuild/skydoc.git",
3157
)
3258

3359
load("@io_bazel_skydoc//skylark:skylark.bzl", "skydoc_repositories")
3460

3561
skydoc_repositories()
3662

37-
# Requirements for building our piptool.
63+
##########################################
64+
# Requirements for building our piptool. #
65+
##########################################
66+
3867
load("//python:pip.bzl", "pip_import")
3968

4069
pip_import(
@@ -51,58 +80,69 @@ _piptool_install()
5180

5281
git_repository(
5382
name = "subpar",
54-
remote = "https://github.com/google/subpar",
5583
# HEAD as of 2018/02/15
5684
commit = "1f695ee5d42585a66d9dd9b71219eb8551e59c89",
85+
remote = "https://github.com/google/subpar",
5786
)
5887

59-
# Test data for WHL tool testing.
88+
###################################
89+
# Test data for WHL tool testing. #
90+
###################################
91+
6092
http_file(
6193
name = "grpc_whl",
94+
downloaded_file_path = "grpcio-1.6.0-cp27-cp27m-manylinux1_i686.whl",
6295
sha256 = "c232d6d168cb582e5eba8e1c0da8d64b54b041dd5ea194895a2fe76050916561",
6396
# From https://pypi.python.org/pypi/grpcio/1.6.0
64-
url = ("https://pypi.python.org/packages/c6/28/" +
65-
"67651b4eabe616b27472c5518f9b2aa3f63beab8f62100b26f05ac428639/" +
66-
"grpcio-1.6.0-cp27-cp27m-manylinux1_i686.whl"),
97+
urls = [("https://pypi.python.org/packages/c6/28/" +
98+
"67651b4eabe616b27472c5518f9b2aa3f63beab8f62100b26f05ac428639/" +
99+
"grpcio-1.6.0-cp27-cp27m-manylinux1_i686.whl")],
67100
)
68101

69102
http_file(
70103
name = "futures_3_1_1_whl",
104+
downloaded_file_path = "futures-3.1.1-py2-none-any.whl",
71105
sha256 = "c4884a65654a7c45435063e14ae85280eb1f111d94e542396717ba9828c4337f",
72106
# From https://pypi.python.org/pypi/futures
73-
url = ("https://pypi.python.org/packages/a6/1c/" +
74-
"72a18c8c7502ee1b38a604a5c5243aa8c2a64f4bba4e6631b1b8972235dd/" +
75-
"futures-3.1.1-py2-none-any.whl"),
107+
urls = [("https://pypi.python.org/packages/a6/1c/" +
108+
"72a18c8c7502ee1b38a604a5c5243aa8c2a64f4bba4e6631b1b8972235dd/" +
109+
"futures-3.1.1-py2-none-any.whl")],
76110
)
77111

78112
http_file(
79113
name = "futures_2_2_0_whl",
114+
downloaded_file_path = "futures-2.2.0-py2.py3-none-any.whl",
80115
sha256 = "9fd22b354a4c4755ad8c7d161d93f5026aca4cfe999bd2e53168f14765c02cd6",
81116
# From https://pypi.python.org/pypi/futures/2.2.0
82-
url = ("https://pypi.python.org/packages/d7/1d/" +
83-
"68874943aa37cf1c483fc61def813188473596043158faa6511c04a038b4/" +
84-
"futures-2.2.0-py2.py3-none-any.whl"),
117+
urls = [("https://pypi.python.org/packages/d7/1d/" +
118+
"68874943aa37cf1c483fc61def813188473596043158faa6511c04a038b4/" +
119+
"futures-2.2.0-py2.py3-none-any.whl")],
85120
)
86121

87122
http_file(
88123
name = "mock_whl",
124+
downloaded_file_path = "mock-2.0.0-py2.py3-none-any.whl",
89125
sha256 = "5ce3c71c5545b472da17b72268978914d0252980348636840bd34a00b5cc96c1",
90126
# From https://pypi.python.org/pypi/mock
91-
url = ("https://pypi.python.org/packages/e6/35/" +
92-
"f187bdf23be87092bd0f1200d43d23076cee4d0dec109f195173fd3ebc79/" +
93-
"mock-2.0.0-py2.py3-none-any.whl"),
127+
urls = [("https://pypi.python.org/packages/e6/35/" +
128+
"f187bdf23be87092bd0f1200d43d23076cee4d0dec109f195173fd3ebc79/" +
129+
"mock-2.0.0-py2.py3-none-any.whl")],
94130
)
95131

96132
http_file(
97133
name = "google_cloud_language_whl",
134+
downloaded_file_path = "google_cloud_language-0.29.0-py2.py3-none-any.whl",
98135
sha256 = "a2dd34f0a0ebf5705dcbe34bd41199b1d0a55c4597d38ed045bd183361a561e9",
99136
# From https://pypi.python.org/pypi/google-cloud-language
100-
url = ("https://pypi.python.org/packages/6e/86/" +
101-
"cae57e4802e72d9e626ee5828ed5a646cf4016b473a4a022f1038dba3460/" +
102-
"google_cloud_language-0.29.0-py2.py3-none-any.whl"),
137+
urls = [("https://pypi.python.org/packages/6e/86/" +
138+
"cae57e4802e72d9e626ee5828ed5a646cf4016b473a4a022f1038dba3460/" +
139+
"google_cloud_language-0.29.0-py2.py3-none-any.whl")],
103140
)
104141

105-
# Imports for examples
142+
#########################
143+
# Imports for examples. #
144+
#########################
145+
106146
pip_import(
107147
name = "examples_helloworld",
108148
requirements = "//examples/helloworld:requirements.txt",

docs/BUILD

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ licenses(["notice"]) # Apache 2.0
1818
# To regenerate html docs, run:
1919
# ./update_docs.sh
2020

21-
load("@io_bazel_skydoc//skylark:skylark.bzl", "skylark_doc", "skylark_library")
21+
load("@bazel_skylib//:skylark_library.bzl", "skylark_library")
22+
load("@io_bazel_skydoc//skylark:skylark.bzl", "skylark_doc")
2223

2324
skylark_library(
2425
name = "whl",

0 commit comments

Comments
 (0)