From 084e3af2eb3b8638f4bc472e4f5d61c1ce524394 Mon Sep 17 00:00:00 2001 From: "publish-to-bcr-bot[bot]" <112732530+publish-to-bcr-bot[bot]@users.noreply.github.com> Date: Wed, 13 Nov 2024 14:15:12 -0800 Subject: [PATCH] aspect_rules_py@1.0.0 (#3183) Release: https://github.com/aspect-build/rules_py/releases/tag/v1.0.0 _Automated by [Publish to BCR](https://github.com/apps/publish-to-bcr)_ Co-authored-by: Matt Mackay --- modules/aspect_rules_py/1.0.0/MODULE.bazel | 87 +++++++++++++++++++ .../patches/module_dot_bazel_version.patch | 14 +++ .../1.0.0/patches/rust_dev_dep.patch | 36 ++++++++ modules/aspect_rules_py/1.0.0/presubmit.yml | 16 ++++ modules/aspect_rules_py/1.0.0/source.json | 10 +++ modules/aspect_rules_py/metadata.json | 3 +- 6 files changed, 165 insertions(+), 1 deletion(-) create mode 100644 modules/aspect_rules_py/1.0.0/MODULE.bazel create mode 100644 modules/aspect_rules_py/1.0.0/patches/module_dot_bazel_version.patch create mode 100644 modules/aspect_rules_py/1.0.0/patches/rust_dev_dep.patch create mode 100644 modules/aspect_rules_py/1.0.0/presubmit.yml create mode 100644 modules/aspect_rules_py/1.0.0/source.json diff --git a/modules/aspect_rules_py/1.0.0/MODULE.bazel b/modules/aspect_rules_py/1.0.0/MODULE.bazel new file mode 100644 index 00000000000..556ed8c4dd8 --- /dev/null +++ b/modules/aspect_rules_py/1.0.0/MODULE.bazel @@ -0,0 +1,87 @@ +"aspect-build/rules_py" + +module( + name = "aspect_rules_py", + compatibility_level = 1, + version = "1.0.0", +) + +# Lower-bound versions of direct dependencies. +# When bumping, add a comment explaining what's required from the newer release. + +# py_image_layer requires 2.x for the `tar` rule. +# py_image_layer needs compute_unused_inputs attribute +# py_image_layer needs repo_mapping fix. +bazel_dep(name = "aspect_bazel_lib", version = "2.9.4") +bazel_dep(name = "bazel_skylib", version = "1.4.2") +bazel_dep(name = "rules_python", version = "0.29.0") +bazel_dep(name = "platforms", version = "0.0.7") + +# Custom python version for testing only +python = use_extension("@rules_python//python/extensions:python.bzl", "python", dev_dependency = True) +python.toolchain( + is_default = False, + python_version = "3.8.12", +) + +tools = use_extension("//py:extensions.bzl", "py_tools") +tools.rules_py_tools() +use_repo(tools, "rules_py_tools") +use_repo(tools, "rules_py_pex_2_3_1") + +register_toolchains( + "@rules_py_tools//:all", + + # Register the "from source" toolchains last, so there's no accidental dependency on Rust + # For manual testing: comment these out to force use of pre-built binaries. + "@aspect_rules_py//py/private/toolchain/venv/...", + "@aspect_rules_py//py/private/toolchain/unpack/...", +) + +# To allow Rust binaries in /py/tools to be built from source +# NOTE: when publishing to BCR, we patch these to be dev_dependency, as we publish pre-built binaries +# along with our releases. + +bazel_dep( + name = "rules_rust", + version = "0.53.0", + dev_dependency = True +) + +rust = use_extension( + "@rules_rust//rust:extensions.bzl", + "rust", + dev_dependency = True +) + +rust.toolchain( + edition = "2021", + versions = ["1.81.0"], +) +use_repo(rust, "rust_toolchains") + +register_toolchains( + "@rust_toolchains//:all", + dev_dependency = True +) + +crate = use_extension( + "@rules_rust//crate_universe:extension.bzl", + "crate", + dev_dependency = True +) + +crate.from_cargo( + name = "crate_index", + cargo_lockfile = "//:Cargo.lock", + # Apparently not needed under bzlmod? + # lockfile = "//:Cargo.Bazel.lock", + manifests = [ + "//:Cargo.toml", + "//py/tools/py:Cargo.toml", + "//py/tools/venv_bin:Cargo.toml", + "//py/tools/unpack_bin:Cargo.toml", + ], +) + +use_repo(crate, "crate_index") diff --git a/modules/aspect_rules_py/1.0.0/patches/module_dot_bazel_version.patch b/modules/aspect_rules_py/1.0.0/patches/module_dot_bazel_version.patch new file mode 100644 index 00000000000..2c9aa86011e --- /dev/null +++ b/modules/aspect_rules_py/1.0.0/patches/module_dot_bazel_version.patch @@ -0,0 +1,14 @@ +=================================================================== +--- a/MODULE.bazel ++++ b/MODULE.bazel +@@ -2,9 +2,9 @@ + + module( + name = "aspect_rules_py", + compatibility_level = 1, +- version = "0.0.0", ++ version = "1.0.0", + ) + + # Lower-bound versions of direct dependencies. + # When bumping, add a comment explaining what's required from the newer release. diff --git a/modules/aspect_rules_py/1.0.0/patches/rust_dev_dep.patch b/modules/aspect_rules_py/1.0.0/patches/rust_dev_dep.patch new file mode 100644 index 00000000000..485eac65363 --- /dev/null +++ b/modules/aspect_rules_py/1.0.0/patches/rust_dev_dep.patch @@ -0,0 +1,36 @@ +diff --git a/MODULE.bazel b/MODULE.bazel +index 841aed7..e1a1d6d 100644 +--- a/MODULE.bazel ++++ b/MODULE.bazel +@@ -41,13 +41,13 @@ register_toolchains( + bazel_dep( + name = "rules_rust", + version = "0.53.0", +- # In released versions: dev_dependency = True ++ dev_dependency = True + ) + + rust = use_extension( + "@rules_rust//rust:extensions.bzl", + "rust", +- # In released versions: dev_dependency = True ++ dev_dependency = True + ) + + rust.toolchain( +@@ -58,13 +58,13 @@ use_repo(rust, "rust_toolchains") + + register_toolchains( + "@rust_toolchains//:all", +- # In released versions: dev_dependency = True ++ dev_dependency = True + ) + + crate = use_extension( + "@rules_rust//crate_universe:extension.bzl", + "crate", +- # In released versions: dev_dependency = True ++ dev_dependency = True + ) + + crate.from_cargo( diff --git a/modules/aspect_rules_py/1.0.0/presubmit.yml b/modules/aspect_rules_py/1.0.0/presubmit.yml new file mode 100644 index 00000000000..5ac74121e5f --- /dev/null +++ b/modules/aspect_rules_py/1.0.0/presubmit.yml @@ -0,0 +1,16 @@ +bcr_test_module: + module_path: "e2e/use_release" + matrix: + bazel: ["7.x"] + # TODO(#9): add windows to this list + platform: ["debian10", "macos", "ubuntu2004"] + tasks: + run_tests: + name: "Run test module" + bazel: ${{ bazel }} + platform: ${{ platform }} + test_flags: + # Bazel 6.x requires this flag set. + - --@aspect_rules_py//py:interpreter_version=3.8.12 + test_targets: + - "//..." diff --git a/modules/aspect_rules_py/1.0.0/source.json b/modules/aspect_rules_py/1.0.0/source.json new file mode 100644 index 00000000000..3af380c6758 --- /dev/null +++ b/modules/aspect_rules_py/1.0.0/source.json @@ -0,0 +1,10 @@ +{ + "integrity": "sha256-LOSODz6q9zIEtiP5nyPUVpC4YqmUtbPCRkouNhsPxK4=", + "strip_prefix": "rules_py-1.0.0", + "url": "https://github.com/aspect-build/rules_py/releases/download/v1.0.0/rules_py-v1.0.0.tar.gz", + "patches": { + "rust_dev_dep.patch": "sha256-Y719sNLUsXsQfJYCVCPQyIL21y9z+at6VImeEi1/dG0=", + "module_dot_bazel_version.patch": "sha256-w2g7DXDeKk2gPSG7mi+u4W38VA+QR7rRnmEKBomCjqw=" + }, + "patch_strip": 1 +} diff --git a/modules/aspect_rules_py/metadata.json b/modules/aspect_rules_py/metadata.json index 363b7ae0bde..53c4cd3df81 100644 --- a/modules/aspect_rules_py/metadata.json +++ b/modules/aspect_rules_py/metadata.json @@ -23,7 +23,8 @@ "0.8.2", "0.9.1", "1.0.0-rc0", - "1.0.0-rc1" + "1.0.0-rc1", + "1.0.0" ], "yanked_versions": {} }