Skip to content

Commit

Permalink
Import rules pycross as part of bazelbuild#1360
Browse files Browse the repository at this point in the history
  • Loading branch information
ewianda committed Jun 20, 2024
1 parent a124c84 commit 6de62c0
Show file tree
Hide file tree
Showing 80 changed files with 10,372 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# (Note, we cannot use `common --deleted_packages` because the bazel version command doesn't support it)
# To update these lines, execute
# `bazel run @rules_bazel_integration_test//tools:update_deleted_packages`
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
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
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
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

test --test_output=errors

Expand Down
64 changes: 64 additions & 0 deletions python/private/pycross_staging/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")

# For stardoc to reference the files
exports_files([
"defs.bzl",
"workspace.bzl",
])

toolchain_type(
name = "toolchain_type",
visibility = ["//visibility:public"],
)

bzl_library(
name = "repositories",
srcs = ["repositories.bzl"],
visibility = ["//visibility:public"],
deps = [
"//pycross/private:internal_repo",
"//pycross/private:pycross_deps_core_lock",
"//pycross/private:pycross_deps_lock",
"@bazel_tools//tools/build_defs/repo:http.bzl",
"@bazel_tools//tools/build_defs/repo:utils.bzl",
],
)

bzl_library(
name = "defs",
srcs = ["defs.bzl"],
visibility = ["//visibility:public"],
deps = [
"//pycross/private:lock_file",
"//pycross/private:pdm_lock_model",
"//pycross/private:poetry_lock_model",
"//pycross/private:pypi_file",
"//pycross/private:target_environment",
"//pycross/private:wheel_build",
"//pycross/private:wheel_library",
"//pycross/private:wheel_zipimport_library",
],
)

bzl_library(
name = "workspace",
srcs = ["workspace.bzl"],
visibility = ["//visibility:public"],
deps = [
"//pycross/private:lock_file_repo",
"//pycross/private:lock_repo",
"//pycross/private:pdm_lock_model",
"//pycross/private:poetry_lock_model",
"//pycross/private:toolchain_helpers",
],
)

bzl_library(
name = "toolchain",
srcs = ["toolchain.bzl"],
visibility = ["//visibility:public"],
deps = [
"//pycross/private:providers",
"@bazel_skylib//lib:paths",
],
)
24 changes: 24 additions & 0 deletions python/private/pycross_staging/defs.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"Public build rule API re-exports"

load("//pycross/private:lock_attrs.bzl", _package_annotation = "package_annotation")
load("//pycross/private:lock_file.bzl", _pycross_lock_file = "pycross_lock_file")
load("//pycross/private:pdm_lock_model.bzl", _pycross_pdm_lock_model = "pycross_pdm_lock_model")
load("//pycross/private:poetry_lock_model.bzl", _pycross_poetry_lock_model = "pycross_poetry_lock_model")
load("//pycross/private:providers.bzl", _PycrossWheelInfo = "PycrossWheelInfo")
load("//pycross/private:pypi_file.bzl", _pypi_file = "pypi_file")
load("//pycross/private:target_environment.bzl", _pycross_target_environment = "pycross_target_environment")
load("//pycross/private:wheel_build.bzl", _pycross_wheel_build = "pycross_wheel_build")
load("//pycross/private:wheel_library.bzl", _pycross_wheel_library = "pycross_wheel_library")
load("//pycross/private:wheel_zipimport_library.bzl", _pycross_wheel_zipimport_library = "pycross_wheel_zipimport_library")

PycrossWheelInfo = _PycrossWheelInfo

package_annotation = _package_annotation
pycross_lock_file = _pycross_lock_file
pycross_pdm_lock_model = _pycross_pdm_lock_model
pycross_poetry_lock_model = _pycross_poetry_lock_model
pycross_target_environment = _pycross_target_environment
pycross_wheel_build = _pycross_wheel_build
pycross_wheel_library = _pycross_wheel_library
pycross_wheel_zipimport_library = _pycross_wheel_zipimport_library
pypi_file = _pypi_file
44 changes: 44 additions & 0 deletions python/private/pycross_staging/extensions/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")

exports_files([
"environments.bzl",
"lock_file.bzl",
"lock_import.bzl",
"lock_repos.bzl",
"pycross.bzl",
])

bzl_library(
name = "environments",
srcs = ["environments.bzl"],
visibility = ["//visibility:public"],
deps = ["//pycross/private/bzlmod:environments"],
)

bzl_library(
name = "lock_file",
srcs = ["lock_file.bzl"],
visibility = ["//visibility:public"],
deps = ["//pycross/private/bzlmod:lock_file"],
)

bzl_library(
name = "lock_import",
srcs = ["lock_import.bzl"],
visibility = ["//visibility:public"],
deps = ["//pycross/private/bzlmod:lock_import"],
)

bzl_library(
name = "lock_repos",
srcs = ["lock_repos.bzl"],
visibility = ["//visibility:public"],
deps = ["//pycross/private/bzlmod:lock_repos"],
)

bzl_library(
name = "pycross",
srcs = ["pycross.bzl"],
visibility = ["//visibility:public"],
deps = ["//pycross/private/bzlmod:pycross"],
)
5 changes: 5 additions & 0 deletions python/private/pycross_staging/extensions/environments.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""The environments extension."""

load("//pycross/private/bzlmod:environments.bzl", _environments = "environments")

environments = _environments
5 changes: 5 additions & 0 deletions python/private/pycross_staging/extensions/lock_file.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""The lock_repos extension."""

load("//pycross/private/bzlmod:lock_file.bzl", _lock_file = "lock_file")

lock_file = _lock_file
5 changes: 5 additions & 0 deletions python/private/pycross_staging/extensions/lock_import.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""The lock_import extension."""

load("//pycross/private/bzlmod:lock_import.bzl", _lock_import = "lock_import")

lock_import = _lock_import
5 changes: 5 additions & 0 deletions python/private/pycross_staging/extensions/lock_repos.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""The lock_repos extension."""

load("//pycross/private/bzlmod:lock_repos.bzl", _lock_repos = "lock_repos")

lock_repos = _lock_repos
5 changes: 5 additions & 0 deletions python/private/pycross_staging/extensions/pycross.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""The lock_import extension."""

load("//pycross/private/bzlmod:pycross.bzl", _pycross = "pycross")

pycross = _pycross
5 changes: 5 additions & 0 deletions python/private/pycross_staging/hooks/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
alias(
name = "repair_wheel",
actual = "//pycross/private/tools/repairwheel:repair_wheel_hook",
visibility = ["//visibility:public"],
)
Loading

0 comments on commit 6de62c0

Please sign in to comment.