From cc0f5c6c1c85cd2f95b814ef2d0e586bb4f23523 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, 12 Jun 2024 18:25:59 -0700 Subject: [PATCH] rules_python@0.33.1 (#2250) --- modules/rules_python/0.33.1/MODULE.bazel | 134 ++++++++++++++++++ .../patches/module_dot_bazel_version.patch | 12 ++ modules/rules_python/0.33.1/presubmit.yml | 26 ++++ modules/rules_python/0.33.1/source.json | 9 ++ modules/rules_python/metadata.json | 3 +- 5 files changed, 183 insertions(+), 1 deletion(-) create mode 100644 modules/rules_python/0.33.1/MODULE.bazel create mode 100644 modules/rules_python/0.33.1/patches/module_dot_bazel_version.patch create mode 100644 modules/rules_python/0.33.1/presubmit.yml create mode 100644 modules/rules_python/0.33.1/source.json diff --git a/modules/rules_python/0.33.1/MODULE.bazel b/modules/rules_python/0.33.1/MODULE.bazel new file mode 100644 index 00000000000..96ed2d89ca0 --- /dev/null +++ b/modules/rules_python/0.33.1/MODULE.bazel @@ -0,0 +1,134 @@ +module( + name = "rules_python", + version = "0.33.1", + compatibility_level = 1, +) + +bazel_dep(name = "bazel_features", version = "1.9.1") +bazel_dep(name = "bazel_skylib", version = "1.6.1") +bazel_dep(name = "rules_cc", version = "0.0.9") +bazel_dep(name = "platforms", version = "0.0.4") + +# Those are loaded only when using py_proto_library +bazel_dep(name = "rules_proto", version = "6.0.0-rc1") +bazel_dep(name = "protobuf", version = "21.7", repo_name = "com_google_protobuf") + +internal_deps = use_extension("//python/private/bzlmod:internal_deps.bzl", "internal_deps") +use_repo( + internal_deps, + "rules_python_internal", + # START: maintained by 'bazel run //tools/private/update_deps:update_pip_deps' + "pypi__build", + "pypi__click", + "pypi__colorama", + "pypi__importlib_metadata", + "pypi__installer", + "pypi__more_itertools", + "pypi__packaging", + "pypi__pep517", + "pypi__pip", + "pypi__pip_tools", + "pypi__pyproject_hooks", + "pypi__setuptools", + "pypi__tomli", + "pypi__wheel", + "pypi__zipp", + # END: maintained by 'bazel run //tools/private/update_deps:update_pip_deps' +) + +# We need to do another use_extension call to expose the "pythons_hub" +# repo. +python = use_extension("//python/extensions:python.bzl", "python") + +# The default toolchain to use if nobody configures a toolchain. +# NOTE: This is not a stable version. It is provided for convenience, but will +# change frequently to track the most recent Python version. +# NOTE: The root module can override this. +python.toolchain( + is_default = True, + python_version = "3.11", +) +use_repo(python, "python_3_11", "python_versions", "pythons_hub") + +# This call registers the Python toolchains. +register_toolchains("@pythons_hub//:all") + +##################### +# Install twine for our own runfiles wheel publishing and allow bzlmod users to use it. + +pip = use_extension("//python/private/bzlmod:pip.bzl", "pip_internal") +pip.parse( + hub_name = "rules_python_publish_deps", + python_version = "3.11", + requirements_by_platform = { + "//tools/publish:requirements.txt": "linux_*", + "//tools/publish:requirements_darwin.txt": "osx_*", + "//tools/publish:requirements_windows.txt": "windows_*", + }, +) +use_repo(pip, "rules_python_publish_deps") + +# ===== DEV ONLY DEPS AND SETUP BELOW HERE ===== +bazel_dep(name = "stardoc", version = "0.6.2", dev_dependency = True, repo_name = "io_bazel_stardoc") +bazel_dep(name = "rules_bazel_integration_test", version = "0.20.0", dev_dependency = True) +bazel_dep(name = "rules_testing", version = "0.6.0", dev_dependency = True) + +# Extra gazelle plugin deps so that WORKSPACE.bzlmod can continue including it for e2e tests. +# We use `WORKSPACE.bzlmod` because it is impossible to have dev-only local overrides. +bazel_dep(name = "rules_go", version = "0.41.0", dev_dependency = True, repo_name = "io_bazel_rules_go") +bazel_dep(name = "gazelle", version = "0.33.0", dev_dependency = True, repo_name = "bazel_gazelle") + +dev_pip = use_extension( + "//python/private/bzlmod:pip.bzl", + "pip_internal", + dev_dependency = True, +) +dev_pip.parse( + experimental_requirement_cycles = { + "sphinx": [ + "sphinx", + "sphinxcontrib-serializinghtml", + "sphinxcontrib-qthelp", + "sphinxcontrib-htmlhelp", + "sphinxcontrib-devhelp", + "sphinxcontrib-applehelp", + ], + }, + hub_name = "dev_pip", + python_version = "3.11", + requirements_by_platform = { + "//docs/sphinx:requirements.txt": "linux_*,osx_*", + }, +) +dev_pip.parse( + hub_name = "pypiserver", + python_version = "3.11", + requirements_lock = "//examples/wheel:requirements_server.txt", +) +use_repo(dev_pip, "dev_pip", "pypiserver") + +# Bazel integration test setup below + +bazel_binaries = use_extension( + "@rules_bazel_integration_test//:extensions.bzl", + "bazel_binaries", + dev_dependency = True, +) + +# Keep in sync with //:version.bzl +bazel_binaries.local( + name = "self", + path = "tests/integration/bazel_from_env", +) +bazel_binaries.download(version = "6.4.0") +bazel_binaries.download(version = "rolling") +use_repo( + bazel_binaries, + "bazel_binaries", + # These don't appear necessary, but are reported as direct dependencies + # that should be use_repo()'d, so we add them as requested + "bazel_binaries_bazelisk", + "build_bazel_bazel_6_4_0", + "build_bazel_bazel_rolling", + "build_bazel_bazel_self", +) diff --git a/modules/rules_python/0.33.1/patches/module_dot_bazel_version.patch b/modules/rules_python/0.33.1/patches/module_dot_bazel_version.patch new file mode 100644 index 00000000000..1651e2ada9f --- /dev/null +++ b/modules/rules_python/0.33.1/patches/module_dot_bazel_version.patch @@ -0,0 +1,12 @@ +=================================================================== +--- a/MODULE.bazel ++++ b/MODULE.bazel +@@ -1,7 +1,7 @@ + module( + name = "rules_python", +- version = "0.0.0", ++ version = "0.33.1", + compatibility_level = 1, + ) + + bazel_dep(name = "bazel_features", version = "1.9.1") diff --git a/modules/rules_python/0.33.1/presubmit.yml b/modules/rules_python/0.33.1/presubmit.yml new file mode 100644 index 00000000000..6be334ebfe9 --- /dev/null +++ b/modules/rules_python/0.33.1/presubmit.yml @@ -0,0 +1,26 @@ +# Copyright 2023 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +bcr_test_module: + module_path: "examples/bzlmod" + matrix: + platform: ["debian11", "macos", "ubuntu2004", "windows"] + bazel: [6.x, 7.x] + tasks: + run_tests: + name: "Run test module" + platform: ${{ platform }} + bazel: ${{ bazel }} + test_targets: + - "//..." diff --git a/modules/rules_python/0.33.1/source.json b/modules/rules_python/0.33.1/source.json new file mode 100644 index 00000000000..cca706bbe52 --- /dev/null +++ b/modules/rules_python/0.33.1/source.json @@ -0,0 +1,9 @@ +{ + "integrity": "sha256-W8+jhSRE0ISx0yYnFM7BUbeXZI1NRE6piVx8ftec1xU=", + "strip_prefix": "rules_python-0.33.1", + "url": "https://github.com/bazelbuild/rules_python/releases/download/0.33.1/rules_python-0.33.1.tar.gz", + "patches": { + "module_dot_bazel_version.patch": "sha256-mwvmFSZ7xBL2/QSSEkUIkmNGxJP/UwdmBPDjHo8AzGc=" + }, + "patch_strip": 1 +} diff --git a/modules/rules_python/metadata.json b/modules/rules_python/metadata.json index 36f65cff480..017374c6267 100644 --- a/modules/rules_python/metadata.json +++ b/modules/rules_python/metadata.json @@ -46,7 +46,8 @@ "0.32.0", "0.32.1", "0.32.2", - "0.33.0" + "0.33.0", + "0.33.1" ], "yanked_versions": { "0.14.0": "rules_python 0.14.0 is broken due to https://github.com/bazelbuild/bazel-central-registry/issues/287, please upgrade to version >= 0.15.0"