Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bdc87bd

Browse filesBrowse files
authored
Merge branch 'master' into dslomov-patch-1
2 parents 8aaddbf + 93d8b0a commit bdc87bd
Copy full SHA for bdc87bd

File tree

Expand file treeCollapse file tree

30 files changed

+1099
-1060
lines changed
Filter options
Expand file treeCollapse file tree

30 files changed

+1099
-1060
lines changed

‎.bazelci/presubmit.yml

Copy file name to clipboard
+22-3Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,36 @@
1+
# We exclude docs/ from build_targets. Since we can't blacklist specific target
2+
# patterns (bazelbuild/continuous-integration#779), we have to explicitly
3+
# list every other top-level package in build_targets.
4+
# TODO(#144): When Bazel 0.29 is released, the docgen workflow will work, and
5+
# we can go back to using `...` for build_targets.
16
---
27
platforms:
38
ubuntu1604:
9+
# I don't trust my knowledge of YAML enough to factor this list into an
10+
# anchor.
411
build_targets:
5-
- "..."
12+
- "//examples/..."
13+
- "//experimental/..."
14+
- "//python/..."
15+
- "//rules_python/..."
16+
- "//tools/..."
617
test_targets:
718
- "..."
819
ubuntu1804:
920
build_targets:
10-
- "..."
21+
- "//examples/..."
22+
- "//experimental/..."
23+
- "//python/..."
24+
- "//rules_python/..."
25+
- "//tools/..."
1126
test_targets:
1227
- "..."
1328
macos:
1429
build_targets:
15-
- "..."
30+
- "//examples/..."
31+
- "//experimental/..."
32+
- "//python/..."
33+
- "//rules_python/..."
34+
- "//tools/..."
1635
test_targets:
1736
- "..."

‎README.md

Copy file name to clipboardExpand all lines: README.md
+8-4Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Status: This is **ALPHA** software.
44

55
[![Build status](https://badge.buildkite.com/0bcfe58b6f5741aacb09b12485969ba7a1205955a45b53e854.svg)](https://buildkite.com/bazel/python-rules-python-postsubmit)
66

7+
## Recent updates
8+
9+
* 2019-07-26: The canonical name of this repo has been changed from `@io_bazel_rules_python` to just `@rules_python`, in accordance with [convention](https://docs.bazel.build/versions/master/skylark/deploying.html#workspace). Please update your WORKSPACE file and labels that reference this repo accordingly.
10+
711
## Rules
812

913
* [pip_import](docs/python/pip.md#pip_import)
@@ -26,14 +30,14 @@ Add the following to your `WORKSPACE` file to add the external repositories:
2630
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
2731

2832
git_repository(
29-
name = "io_bazel_rules_python",
33+
name = "rules_python",
3034
remote = "https://github.com/bazelbuild/rules_python.git",
3135
# NOT VALID! Replace this with a Git commit SHA.
3236
commit = "{HEAD}",
3337
)
3438

3539
# Only needed for PIP support:
36-
load("@io_bazel_rules_python//python:pip.bzl", "pip_repositories")
40+
load("@rules_python//python:pip.bzl", "pip_repositories")
3741

3842
pip_repositories()
3943
```
@@ -42,7 +46,7 @@ Then in your `BUILD` files load the python rules with:
4246

4347
``` python
4448
load(
45-
"@io_bazel_rules_python//python:python.bzl",
49+
"@rules_python//python:defs.bzl",
4650
"py_binary", "py_library", "py_test",
4751
)
4852

@@ -60,7 +64,7 @@ are imported into the Bazel dependency graph via a two-phased process in
6064
`WORKSPACE`:
6165

6266
```python
63-
load("@io_bazel_rules_python//python:pip.bzl", "pip_import")
67+
load("@rules_python//python:pip.bzl", "pip_import")
6468

6569
# This rule translates the specified requirements.txt into
6670
# @my_deps//:requirements.bzl, which itself exposes a pip_install method.

‎WORKSPACE

Copy file name to clipboardExpand all lines: WORKSPACE
+12-30Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,54 +12,36 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
workspace(name = "io_bazel_rules_python")
15+
workspace(name = "rules_python")
1616

1717
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
1818
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
1919

20-
################################
21-
# Skydoc and its dependencies. #
22-
################################
20+
#################################
21+
# Stardoc and its dependencies. #
22+
#################################
2323

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.
24+
# Initialization taken from:
25+
# https://skydoc.bazel.build/docs/getting_started_stardoc.html
2726

2827
git_repository(
29-
name = "io_bazel_rules_sass",
30-
# Same commit as Skydoc uses in its own WORKSPACE.
31-
commit = "8ccf4f1c351928b55d5dddf3672e3667f6978d60", # 2018-11-23
32-
remote = "https://github.com/bazelbuild/rules_sass.git",
28+
name = "io_bazel_skydoc",
29+
remote = "https://github.com/bazelbuild/skydoc.git",
30+
tag = "0.3.0",
3331
)
3432

35-
load("@io_bazel_rules_sass//:package.bzl", "rules_sass_dependencies")
33+
load("@io_bazel_skydoc//:setup.bzl", "skydoc_repositories")
34+
skydoc_repositories()
3635

36+
load("@io_bazel_rules_sass//:package.bzl", "rules_sass_dependencies")
3737
rules_sass_dependencies()
3838

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.
4139
load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories")
42-
4340
node_repositories()
4441

4542
load("@io_bazel_rules_sass//:defs.bzl", "sass_repositories")
46-
4743
sass_repositories()
4844

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-
53-
git_repository(
54-
name = "io_bazel_skydoc",
55-
commit = "1cdb612e31448c2f6eb25b8aa67d406152275482", # 2018-11-27
56-
remote = "https://github.com/bazelbuild/skydoc.git",
57-
)
58-
59-
load("@io_bazel_skydoc//skylark:skylark.bzl", "skydoc_repositories")
60-
61-
skydoc_repositories()
62-
6345
##########################################
6446
# Requirements for building our piptool. #
6547
##########################################

‎docs/BUILD

Copy file name to clipboardExpand all lines: docs/BUILD
+42-33Lines changed: 42 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -11,51 +11,60 @@
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+
15+
###############################################################################
16+
# To regenerate documentation, run the top-level update_docs.sh script. #
17+
###############################################################################
18+
1419
package(default_visibility = ["//visibility:public"])
1520

1621
licenses(["notice"]) # Apache 2.0
1722

18-
# To regenerate html docs, run:
19-
# ./update_docs.sh
23+
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
24+
load("@io_bazel_skydoc//stardoc:stardoc.bzl", "stardoc")
2025

21-
load("@bazel_skylib//:skylark_library.bzl", "skylark_library")
22-
load("@io_bazel_skydoc//skylark:skylark.bzl", "skylark_doc")
26+
# We define these bzl_library targets here rather than in the //python package
27+
# because they're only used for doc generation. This way, we avoid requiring
28+
# our users to depend on Skylib.
2329

24-
skylark_library(
25-
name = "whl",
26-
srcs = ["//python:whl.bzl"],
30+
# Requires Bazel 0.29 onward for public visibility of these .bzl files.
31+
bzl_library(
32+
name = "bazel_python_tools",
33+
srcs = [
34+
"@bazel_tools//tools/python:srcs_version.bzl",
35+
"@bazel_tools//tools/python:toolchain.bzl",
36+
"@bazel_tools//tools/python:utils.bzl",
37+
],
2738
)
2839

29-
skylark_library(
30-
name = "pip",
31-
srcs = ["//python:pip.bzl"],
40+
bzl_library(
41+
name = "defs",
42+
srcs = [
43+
"//python:defs.bzl",
44+
"//python:private/reexports.bzl",
45+
],
46+
deps = [":bazel_python_tools"],
3247
)
3348

34-
skylark_library(
35-
name = "python",
36-
srcs = ["//python:python.bzl"],
49+
stardoc(
50+
name = "core-docs",
51+
input = "//python:defs.bzl",
52+
out = "python.md",
53+
deps = [":defs"],
3754
)
3855

39-
skylark_doc(
40-
name = "docs-md",
41-
format = "markdown",
42-
overview = True,
43-
site_root = ".",
44-
deps = [
45-
":pip",
46-
":python",
47-
":whl",
48-
],
56+
# TODO: Consider merging documentation pages for whl and pip. This would
57+
# require re-exporting their symbols from a common .bzl; see
58+
# https://github.com/bazelbuild/skydoc/issues/208.
59+
60+
stardoc(
61+
name = "pip-docs",
62+
input = "//python:pip.bzl",
63+
out = "pip.md",
4964
)
5065

51-
skylark_doc(
52-
name = "docs-html",
53-
format = "html",
54-
overview = True,
55-
site_root = ".",
56-
deps = [
57-
":pip",
58-
":python",
59-
":whl",
60-
],
66+
stardoc(
67+
name = "whl-docs",
68+
input = "//python:whl.bzl",
69+
out = "whl.md",
6170
)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.