Skip to content

Commit 6baf990

Browse files
committed
Fix visibility
1 parent fdc5f73 commit 6baf990

File tree

9 files changed

+20
-22
lines changed

9 files changed

+20
-22
lines changed

.bazelignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
examples/
2-
bazel-*/
2+
bazel-*

MODULE.bazel

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,24 @@ module(
88
bazel_dep(name = "bazel_skylib", version = "1.4.1")
99
bazel_dep(name = "buildifier_prebuilt", version = "7.3.1")
1010
bazel_dep(name = "platforms", version = "0.0.8")
11-
bazel_dep(name = "rules_python", version = "0.40.0")
12-
bazel_dep(name = "rules_uv", version = "0.21.0")
11+
bazel_dep(name = "rules_python", version = "1.0.0")
12+
bazel_dep(name = "rules_uv", version = "0.44.0")
1313

1414
# configuration
1515
PYTHON_VERSION = "3.12"
1616

1717
PYTHON_VERSION_SNAKE = PYTHON_VERSION.replace(".", "_")
1818

1919
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
20-
python.toolchain(
21-
is_default = True,
22-
python_version = PYTHON_VERSION,
23-
)
24-
use_repo(python, "python_" + PYTHON_VERSION_SNAKE, "python_versions")
20+
python.toolchain(python_version = PYTHON_VERSION)
21+
use_repo(python, "python_versions")
2522

2623
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
2724
pip.parse(
2825
enable_implicit_namespace_pkgs = True,
2926
experimental_index_url = "https://pypi.org/simple", # use Bazel downloader
3027
hub_name = "rules_pydeps_pip",
3128
python_version = PYTHON_VERSION,
32-
requirements_by_platform = {
33-
"//pydeps/private:requirements.txt": "*",
34-
},
29+
requirements_by_platform = {"//pydeps/private:requirements.txt": "*"},
3530
)
3631
use_repo(pip, "rules_pydeps_pip")

examples/demo/MODULE.bazel

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@ local_path_override(
2020
# configuration
2121
PYTHON_VERSION = "3.12"
2222

23-
PYTHON_VERSION_SNAKE = PYTHON_VERSION.replace(".", "_")
24-
2523
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
2624
python.toolchain(python_version = PYTHON_VERSION)
27-
use_repo(python, "python_" + PYTHON_VERSION_SNAKE, "python_versions")
25+
use_repo(python, "python_versions")
2826

2927
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
3028
pip.parse(

pydeps/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
22

33
bzl_library(
4-
name = "pydeps]",
4+
name = "pydeps",
55
srcs = ["pydeps.bzl"],
66
visibility = ["//visibility:public"],
77
)

pydeps/private/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ pip_compile(
55
name = "generate_requirements_lock",
66
requirements_in = "requirements.in",
77
requirements_txt = "requirements.txt",
8+
universal = True,
89
)
910

1011
create_venv(

pydeps/private/enforcer/enforcer.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"Implement a deps/bazel consistency checking aspect."
22

3-
load("@rules_python//python:py_info.bzl", "PyInfo")
3+
load("@rules_python//python:py_info.bzl", RulesPythonPyInfo = "PyInfo")
44

55
_EMPTY_DEPSET = depset()
66

@@ -94,7 +94,7 @@ def _deps_aspect_impl(target, ctx):
9494
if dep.label.name in ctx.attr._ignored_names:
9595
continue
9696

97-
if PyInfo in dep:
97+
if PyInfo in dep or RulesPythonPyInfo in dep:
9898
dep_str = str(dep.label)
9999
referenced_deps.append(dep_str)
100100

pydeps/private/index/BUILD.bazel

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ py_312_binary(
1010
include = ["*.py"],
1111
exclude = ["test_*.py"],
1212
),
13-
visibility = [
14-
"//pydeps/private:__subpackages__",
15-
],
13+
visibility = ["//visibility:public"],
1614
deps = [
1715
"//pydeps/private/py",
1816
requirement("click"),

pydeps/private/index/deps_index.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"Rules to build a module index for rules_python pip deps."
22

3-
load("@rules_python//python:py_info.bzl", "PyInfo")
3+
load("@rules_python//python:py_info.bzl", RulesPythonPyInfo = "PyInfo")
44

55
def _map_dependency_file(item):
66
file = item[0]
@@ -19,7 +19,7 @@ def _deps_index_impl(ctx):
1919
modules = {}
2020
dependency_files = {}
2121
for dep, module in ctx.attr.label_to_requirement.items():
22-
if PyInfo in dep:
22+
if PyInfo in dep or RulesPythonPyInfo in dep:
2323
modules[dep.label] = module
2424

2525
for file in dep.files.to_list():

pydeps/private/requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ click==8.1.7 \
66
--hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \
77
--hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de
88
# via -r pydeps/private/requirements.in
9+
colorama==0.4.6 ; sys_platform == 'win32' or platform_system == 'Windows' \
10+
--hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \
11+
--hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6
12+
# via
13+
# click
14+
# pytest
915
iniconfig==2.0.0 \
1016
--hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \
1117
--hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374

0 commit comments

Comments
 (0)