8000 Turn `//python/private` into a package. (#555) · axivion/rules_python@2c96d82 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2c96d82

Browse files
authored
Turn //python/private into a package. (bazel-contrib#555)
1 parent b111e56 commit 2c96d82

File tree

4 files changed

+45
-11
lines changed

4 files changed

+45
-11
lines changed

docs/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ bzl_library(
5454
name = "defs",
5555
srcs = [
5656
"//python:defs.bzl",
57-
"//python:private/reexports.bzl",
57+
"//python/private:reexports.bzl",
5858
],
5959
deps = [":bazel_python_tools"],
6060
)

python/BUILD

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ filegroup(
3636
"//python/constraints:distribution",
3737
"//python/legacy_pip_import:distribution",
3838
"//python/runfiles:distribution",
39+
"//python/private:distribution",
3940
],
4041
visibility = ["//:__pkg__"],
4142
)
@@ -48,8 +49,8 @@ filegroup(
4849
"defs.bzl",
4950
"packaging.bzl",
5051
"pip.bzl",
51-
"private/reexports.bzl",
5252
"whl.bzl",
53+
"//python/private:bzl",
5354
],
5455
visibility = ["//:__pkg__"],
5556
)
@@ -61,14 +62,6 @@ exports_files([
6162
"python.bzl", # Deprecated, please use defs.bzl
6263
])
6364

64-
# Needed to define bzl_library targets for docgen. (We don't define the
65-
# bzl_library target here because it'd give our users a transitive dependency
66-
# on Skylib.)
67-
exports_files(
68-
["private/reexports.bzl"],
69-
visibility = ["//docs:__pkg__"],
70-
)
71-
7265
# This target can be used to inspect the current Python major version. To use,
7366
# put it in the `flag_values` attribute of a `config_setting` and test it
7467
# against the values "PY2" or "PY3". It will always match one or the other.

python/defs.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ migrated to Starlark, their implementations will be moved here.
2121

2222
load("@bazel_tools//tools/python:srcs_version.bzl", _find_requirements = "find_requirements")
2323
load("@bazel_tools//tools/python:toolchain.bzl", _py_runtime_pair = "py_runtime_pair")
24-
load(":private/reexports.bzl", "internal_PyInfo", "internal_PyRuntimeInfo")
24+
load("//python/private:reexports.bzl", "internal_PyInfo", "internal_PyRuntimeInfo")
2525

2626
# Exports of native-defined providers.
2727

python/private/BUILD

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright 2021 The Bazel Authors. 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+
licenses(["notice"]) # Apache 2.0
16+
17+
filegroup(
18+
name = "distribution",
19+
srcs = glob(["**"]),
20+
visibility = ["//python:__pkg__"],
21+
)
22+
23+
# Filegroup of bzl files that can be used by downstream rules for documentation generation
24+
# Using a filegroup rather than bzl_library to not give a transitive dependency on Skylib
25+
filegroup(
26+
name = "bzl",
27+
srcs = [
28+
"reexports.bzl",
29+
],
30+
visibility = ["//python:__pkg__"],
31+
)
32+
33+
# Needed to define bzl_library targets for docgen. (We don't define the
34+
# bzl_library target here because it'd give our users a transitive dependency
35+
# on Skylib.)
36+
exports_files(
37+
[
38+
"reexports.bzl",
39+
],
40+
visibility = ["//docs:__pkg__"],
41+
)

0 commit comments

Comments
 (0)
0