Skip to content

Commit f044f34

Browse files
committed
add repro case from issue
1 parent 38fab50 commit f044f34

File tree

9 files changed

+1142
-0
lines changed

9 files changed

+1142
-0
lines changed

.bazelignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ examples/pip_parse/bazel-pip_parse
2525
examples/pip_parse_vendored/bazel-pip_parse_vendored
2626
examples/pip_repository_annotations/bazel-pip_repository_annotations
2727
examples/py_proto_library/bazel-py_proto_library
28+
examples/site-packages/bazel-bin
29+
examples/site-packages/bazel-out
30+
examples/site-packages/bazel-testlogs
2831
gazelle/bazel-gazelle
2932
tests/integration/compile_pip_requirements/bazel-compile_pip_requirements
3033
tests/integration/ignore_root_user_error/bazel-ignore_root_user_error

.bazelrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
build --deleted_packages=examples/build_file_generation,examples/build_file_generation/random_number_generator,examples/bzlmod,examples/bzlmod_build_file_generation,examples/bzlmod_build_file_generation/other_module/other_module/pkg,examples/bzlmod_build_file_generation/runfiles,examples/bzlmod/entry_points,examples/bzlmod/entry_points/tests,examples/bzlmod/libs/my_lib,examples/bzlmod/other_module,examples/bzlmod/other_module/other_module/pkg,examples/bzlmod/patches,examples/bzlmod/py_proto_library,examples/bzlmod/py_proto_library/example.com/another_proto,examples/bzlmod/py_proto_library/example.com/proto,examples/bzlmod/runfiles,examples/bzlmod/tests,examples/bzlmod/tests/other_module,examples/bzlmod/whl_mods,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_proto_library,examples/py_proto_library/example.com/another_proto,examples/py_proto_library/example.com/proto,gazelle,gazelle/manifest,gazelle/manifest/generate,gazelle/manifest/hasher,gazelle/manifest/test,gazelle/modules_mapping,gazelle/python,gazelle/pythonconfig,gazelle/python/private,rules_python-repro,tests/integration/compile_pip_requirements,tests/integration/compile_pip_requirements_test_from_external_repo,tests/integration/custom_commands,tests/integration/ignore_root_user_error,tests/integration/ignore_root_user_error/submodule,tests/integration/local_toolchains,tests/integration/pip_parse,tests/integration/pip_parse/empty,tests/integration/py_cc_toolchain_registered,tests/modules/another_module,tests/modules/other,tests/modules/other/nspkg_delta,tests/modules/other/nspkg_gamma,tests/modules/other/nspkg_single,tests/modules/other/simple_v1,tests/modules/other/simple_v2,tests/modules/other/with_external_data,tests/whl_with_build_files/testdata,tests/whl_with_build_files/testdata/somepkg,tests/whl_with_build_files/testdata/somepkg-1.0.dist-info,tests/whl_with_build_files/testdata/somepkg/subpkg
88
query --deleted_packages=examples/build_file_generation,examples/build_file_generation/random_number_generator,examples/bzlmod,examples/bzlmod_build_file_generation,examples/bzlmod_build_file_generation/other_module/other_module/pkg,examples/bzlmod_build_file_generation/runfiles,examples/bzlmod/entry_points,examples/bzlmod/entry_points/tests,examples/bzlmod/libs/my_lib,examples/bzlmod/other_module,examples/bzlmod/other_module/other_module/pkg,examples/bzlmod/patches,examples/bzlmod/py_proto_library,examples/bzlmod/py_proto_library/example.com/another_proto,examples/bzlmod/py_proto_library/example.com/proto,examples/bzlmod/runfiles,examples/bzlmod/tests,examples/bzlmod/tests/other_module,examples/bzlmod/whl_mods,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_proto_library,examples/py_proto_library/example.com/another_proto,examples/py_proto_library/example.com/proto,gazelle,gazelle/manifest,gazelle/manifest/generate,gazelle/manifest/hasher,gazelle/manifest/test,gazelle/modules_mapping,gazelle/python,gazelle/pythonconfig,gazelle/python/private,rules_python-repro,tests/integration/compile_pip_requirements,tests/integration/compile_pip_requirements_test_from_external_repo,tests/integration/custom_commands,tests/integration/ignore_root_user_error,tests/integration/ignore_root_user_error/submodule,tests/integration/local_toolchains,tests/integration/pip_parse,tests/integration/pip_parse/empty,tests/integration/py_cc_toolchain_registered,tests/modules/another_module,tests/modules/other,tests/modules/other/nspkg_delta,tests/modules/other/nspkg_gamma,tests/modules/other/nspkg_single,tests/modules/other/simple_v1,tests/modules/other/simple_v2,tests/modules/other/with_external_data,tests/whl_with_build_files/testdata,tests/whl_with_build_files/testdata/somepkg,tests/whl_with_build_files/testdata/somepkg-1.0.dist-info,tests/whl_with_build_files/testdata/somepkg/subpkg
99

10+
build --deleted_packages=examples/site-packages
11+
1012
test --test_output=errors
1113

1214
# Do NOT implicitly create empty __init__.py files in the runfiles tree.

examples/site-packages/.bazelrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
common --@rules_python//python/config_settings:bootstrap_impl=script
2+
common --@rules_python//python/config_settings:venvs_site_packages=yes
3+
# See https://github.com/bazel-contrib/rules_python/issues/2864#issuecomment-2859325467
4+
# common --@rules_python//python/config_settings:venvs_use_declare_symlink=no
5+
6+
build --incompatible_default_to_explicit_init_py=true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
8.2.1

examples/site-packages/BUILD.bazel

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
load("@rules_python//python:defs.bzl", "py_test")
2+
3+
py_test(
4+
name = "test",
5+
srcs = ["test.py"],
6+
deps = [
7+
"@pypi//mujoco",
8+
# "@pypi//mujoco_mjx",
9+
# "@pypi//tensorflow",
10+
# "@pypi//importlib_resources",
11+
"@pypi//typing_extensions", # ModuleNotFoundError: No module named 'typing_extensions'
12+
"@pypi//jax",
13+
"@pypi//jax_cuda12_pjrt",
14+
"@pypi//jax_cuda12_plugin",
15+
"@pypi//nvidia_cublas_cu12",
16+
"@pypi//nvidia_cuda_cupti_cu12",
17+
"@pypi//nvidia_cuda_nvcc_cu12",
18+
"@pypi//nvidia_cuda_nvrtc_cu12",
19+
"@pypi//nvidia_cuda_runtime_cu12",
20+
"@pypi//nvidia_cudnn_cu12",
21+
"@pypi//nvidia_cufft_cu12",
22+
"@pypi//nvidia_cusolver_cu12",
23+
"@pypi//nvidia_cusparse_cu12",
24+
"@pypi//nvidia_nccl_cu12",
25+
"@pypi//nvidia_nvjitlink_cu12",
26+
"@pypi//nvidia_nvshmem_cu12",
27+
],
28+
)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
"""Site-packages example."""
2+
3+
module(
4+
name = "site-packages-example",
5+
version = "0.0.1",
6+
)
7+
8+
bazel_dep(name = "rules_python", version = "0.0.0")
9+
bazel_dep(name = "platforms", version = "0.0.11")
10+
11+
local_path_override(
12+
module_name = "rules_python",
13+
path = "../..",
14+
)
15+
16+
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
17+
python.toolchain(
18+
is_default = True,
19+
python_version = "3.12",
20+
)
21+
python.override(minor_mapping = {"3.12": "3.12.7"})
22+
23+
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
24+
pip.parse(
25+
experimental_index_url = "https://pypi.org/simple",
26+
hub_name = "pypi",
27+
python_version = "3.12",
28+
requirements_lock = "requirements.txt",
29+
# enable_implicit_namespace_pkgs = False,
30+
)
31+
32+
use_repo(pip, "pypi")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
mujoco
2+
# mujoco-mjx
3+
jax[cuda12]==0.7.1
4+
jaxlib==0.7.1
5+
tensorflow

0 commit comments

Comments
 (0)