Skip to content

Commit 6de62c0

Browse files
committed
Import rules pycross as part of bazel-contrib#1360
1 parent a124c84 commit 6de62c0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+10372
-2
lines changed

.bazelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# (Note, we cannot use `common --deleted_packages` because the bazel version command doesn't support it)
55
# To update these lines, execute
66
# `bazel run @rules_bazel_integration_test//tools:update_deleted_packages`
7-
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/dupe_requirements,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,tests/integration/compile_pip_requirements,tests/integration/compile_pip_requirements_test_from_external_repo,tests/integration/ignore_root_user_error,tests/integration/ignore_root_user_error/submodule,tests/integration/pip_parse,tests/integration/pip_parse/empty,tests/integration/pip_repository_entry_points,tests/integration/py_cc_toolchain_registered
8-
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/dupe_requirements,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,tests/integration/compile_pip_requirements,tests/integration/compile_pip_requirements_test_from_external_repo,tests/integration/ignore_root_user_error,tests/integration/ignore_root_user_error/submodule,tests/integration/pip_parse,tests/integration/pip_parse/empty,tests/integration/pip_repository_entry_points,tests/integration/py_cc_toolchain_registered
7+
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,tests/integration/compile_pip_requirements,tests/integration/compile_pip_requirements_test_from_external_repo,tests/integration/ignore_root_user_error,tests/integration/ignore_root_user_error/submodule,tests/integration/pip_parse,tests/integration/pip_parse/empty,tests/integration/pip_repository_entry_points,tests/integration/py_cc_toolchain_registered
8+
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,tests/integration/compile_pip_requirements,tests/integration/compile_pip_requirements_test_from_external_repo,tests/integration/ignore_root_user_error,tests/integration/ignore_root_user_error/submodule,tests/integration/pip_parse,tests/integration/pip_parse/empty,tests/integration/pip_repository_entry_points,tests/integration/py_cc_toolchain_registered
99

1010
test --test_output=errors
1111

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
2+
3+
# For stardoc to reference the files
4+
exports_files([
5+
"defs.bzl",
6+
"workspace.bzl",
7+
])
8+
9+
toolchain_type(
10+
name = "toolchain_type",
11+
visibility = ["//visibility:public"],
12+
)
13+
14+
bzl_library(
15+
name = "repositories",
16+
srcs = ["repositories.bzl"],
17+
visibility = ["//visibility:public"],
18+
deps = [
19+
"//pycross/private:internal_repo",
20+
"//pycross/private:pycross_deps_core_lock",
21+
"//pycross/private:pycross_deps_lock",
22+
"@bazel_tools//tools/build_defs/repo:http.bzl",
23+
"@bazel_tools//tools/build_defs/repo:utils.bzl",
24+
],
25+
)
26+
27+
bzl_library(
28+
name = "defs",
29+
srcs = ["defs.bzl"],
30+
visibility = ["//visibility:public"],
31+
deps = [
32+
"//pycross/private:lock_file",
33+
"//pycross/private:pdm_lock_model",
34+
"//pycross/private:poetry_lock_model",
35+
"//pycross/private:pypi_file",
36+
"//pycross/private:target_environment",
37+
"//pycross/private:wheel_build",
38+
"//pycross/private:wheel_library",
39+
"//pycross/private:wheel_zipimport_library",
40+
],
41+
)
42+
43+
bzl_library(
44+
name = "workspace",
45+
srcs = ["workspace.bzl"],
46+
visibility = ["//visibility:public"],
47+
deps = [
48+
"//pycross/private:lock_file_repo",
49+
"//pycross/private:lock_repo",
50+
"//pycross/private:pdm_lock_model",
51+
"//pycross/private:poetry_lock_model",
52+
"//pycross/private:toolchain_helpers",
53+
],
54+
)
55+
56+
bzl_library(
57+
name = "toolchain",
58+
srcs = ["toolchain.bzl"],
59+
visibility = ["//visibility:public"],
60+
deps = [
61+
"//pycross/private:providers",
62+
"@bazel_skylib//lib:paths",
63+
],
64+
)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"Public build rule API re-exports"
2+
3+
load("//pycross/private:lock_attrs.bzl", _package_annotation = "package_annotation")
4+
load("//pycross/private:lock_file.bzl", _pycross_lock_file = "pycross_lock_file")
5+
load("//pycross/private:pdm_lock_model.bzl", _pycross_pdm_lock_model = "pycross_pdm_lock_model")
6+
load("//pycross/private:poetry_lock_model.bzl", _pycross_poetry_lock_model = "pycross_poetry_lock_model")
7+
load("//pycross/private:providers.bzl", _PycrossWheelInfo = "PycrossWheelInfo")
8+
load("//pycross/private:pypi_file.bzl", _pypi_file = "pypi_file")
9+
load("//pycross/private:target_environment.bzl", _pycross_target_environment = "pycross_target_environment")
10+
load("//pycross/private:wheel_build.bzl", _pycross_wheel_build = "pycross_wheel_build")
11+
load("//pycross/private:wheel_library.bzl", _pycross_wheel_library = "pycross_wheel_library")
12+
load("//pycross/private:wheel_zipimport_library.bzl", _pycross_wheel_zipimport_library = "pycross_wheel_zipimport_library")
13+
14+
PycrossWheelInfo = _PycrossWheelInfo
15+
16+
package_annotation = _package_annotation
17+
pycross_lock_file = _pycross_lock_file
18+
pycross_pdm_lock_model = _pycross_pdm_lock_model
19+
pycross_poetry_lock_model = _pycross_poetry_lock_model
20+
pycross_target_environment = _pycross_target_environment
21+
pycross_wheel_build = _pycross_wheel_build
22+
pycross_wheel_library = _pycross_wheel_library
23+
pycross_wheel_zipimport_library = _pycross_wheel_zipimport_library
24+
pypi_file = _pypi_file
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
2+
3+
exports_files([
4+
"environments.bzl",
5+
"lock_file.bzl",
6+
"lock_import.bzl",
7+
"lock_repos.bzl",
8+
"pycross.bzl",
9+
])
10+
11+
bzl_library(
12+
name = "environments",
13+
srcs = ["environments.bzl"],
14+
visibility = ["//visibility:public"],
15+
deps = ["//pycross/private/bzlmod:environments"],
16+
)
17+
18+
bzl_library(
19+
name = "lock_file",
20+
srcs = ["lock_file.bzl"],
21+
visibility = ["//visibility:public"],
22+
deps = ["//pycross/private/bzlmod:lock_file"],
23+
)
24+
25+
bzl_library(
26+
name = "lock_import",
27+
srcs = ["lock_import.bzl"],
28+
visibility = ["//visibility:public"],
29+
deps = ["//pycross/private/bzlmod:lock_import"],
30+
)
31+
32+
bzl_library(
33+
name = "lock_repos",
34+
srcs = ["lock_repos.bzl"],
35+
visibility = ["//visibility:public"],
36+
deps = ["//pycross/private/bzlmod:lock_repos"],
37+
)
38+
39+
bzl_library(
40+
name = "pycross",
41+
srcs = ["pycross.bzl"],
42+
visibility = ["//visibility:public"],
43+
deps = ["//pycross/private/bzlmod:pycross"],
44+
)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""The environments extension."""
2+
3+
load("//pycross/private/bzlmod:environments.bzl", _environments = "environments")
4+
5+
environments = _environments
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""The lock_repos extension."""
2+
3+
load("//pycross/private/bzlmod:lock_file.bzl", _lock_file = "lock_file")
4+
5+
lock_file = _lock_file
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""The lock_import extension."""
2+
3+
load("//pycross/private/bzlmod:lock_import.bzl", _lock_import = "lock_import")
4+
5+
lock_import = _lock_import
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""The lock_repos extension."""
2+
3+
load("//pycross/private/bzlmod:lock_repos.bzl", _lock_repos = "lock_repos")
4+
5+
lock_repos = _lock_repos
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""The lock_import extension."""
2+
3+
load("//pycross/private/bzlmod:pycross.bzl", _pycross = "pycross")
4+
5+
pycross = _pycross
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
alias(
2+
name = "repair_wheel",
3+
actual = "//pycross/private/tools/repairwheel:repair_wheel_hook",
4+
visibility = ["//visibility:public"],
5+
)

0 commit comments

Comments
 (0)