diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 6366741313..d88e52b4b0 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -41,25 +41,6 @@ buildifier: - "..." test_flags: - "--test_tag_filters=-integration-test" -.common_workspace_flags_min_bazel: &common_workspace_flags_min_bazel - build_flags: - - "--experimental_repository_cache_hardlinks=false" - - "--noenable_bzlmod" - - "--build_tag_filters=-integration-test" - test_flags: - - "--noenable_bzlmod" - - "--test_tag_filters=-integration-test" -.common_workspace_flags: &common_workspace_flags - skip_in_bazel_downstream_pipeline: "Bazel 9 doesn't support workspace" - test_flags: - - "--noenable_bzlmod" - - "--enable_workspace" - - "--test_tag_filters=-integration-test" - build_flags: - - "--noenable_bzlmod" - - "--enable_workspace" - - "--build_tag_filters=-integration-test" - bazel: 7.x # NOTE: The Mac and Windows bazelinbazel jobs override parts of this config. .common_bazelinbazel_config: &common_bazelinbazel_config build_flags: @@ -154,21 +135,6 @@ tasks: name: "Gazelle: BCR, Bazel {bazel}" platform: macos_arm64 - gazelle_extension_min: - <<: *common_workspace_flags_min_bazel - <<: *minimum_supported_version - name: "Gazelle: workspace, minimum supported Bazel version" - platform: ubuntu2204 - build_targets: ["//..."] - test_targets: ["//..."] - working_directory: gazelle - gazelle_extension_workspace: - <<: *common_workspace_flags - name: "Gazelle: workspace" - platform: ubuntu2204 - build_targets: ["//..."] - test_targets: ["//..."] - working_directory: gazelle gazelle_extension: name: "Gazelle: default settings" platform: ubuntu2204 @@ -197,13 +163,6 @@ tasks: test_targets: - "//..." - ubuntu_min_workspace: - <<: *minimum_supported_version - <<: *reusable_config - <<: *common_workspace_flags_min_bazel - name: "Default: Ubuntu, workspace, minimum Bazel" - platform: ubuntu2204 - ubuntu_min_bzlmod: <<: *minimum_supported_version <<: *reusable_config @@ -239,41 +198,6 @@ tasks: test_flags: - "--keep_going" - "--test_tag_filters=-integration-test" - ubuntu_workspace: - <<: *reusable_config - <<: *common_workspace_flags - name: "Default: Ubuntu, workspace" - platform: ubuntu2204 - mac_workspace: - <<: *reusable_config - <<: *common_workspace_flags - name: "Default: Mac, workspace" - platform: macos_arm64 - windows_workspace: - <<: *reusable_config - <<: *common_workspace_flags - name: "Default: Windows, workspace" - platform: windows - # Most of tests/integration are failing on Windows w/workspace. Skip them - # for now until we can look into it. - build_targets: - - "--" - - "..." - # As a regression test for #225, check that wheel targets still build when - # their package path is qualified with the repo name. - - "@rules_python//examples/wheel/..." - build_flags: - - "--noenable_bzlmod" - - "--enable_workspace" - - "--keep_going" - - "--build_tag_filters=-integration-test" - test_targets: - - "--" - - "..." - test_flags: - - "--noenable_bzlmod" - - "--enable_workspace" - - "--test_tag_filters=-integration-test" debian: <<: *reusable_config @@ -323,38 +247,6 @@ tasks: - "--test_tag_filters=-integration-test,-acceptance-test" - "--extra_toolchains=@buildkite_config//config:cc-toolchain" - integration_test_build_file_generation_ubuntu_minimum_supported_workspace: - <<: *minimum_supported_version - <<: *reusable_build_test_all - <<: *common_workspace_flags_min_bazel - name: "examples/build_file_generation: Ubuntu, workspace, minimum Bazel" - working_directory: examples/build_file_generation - platform: ubuntu2204 - integration_test_build_file_generation_ubuntu_workspace: - <<: *reusable_build_test_all - <<: *common_workspace_flags - name: "examples/build_file_generation: Ubuntu, workspace" - working_directory: examples/build_file_generation - platform: ubuntu2204 - integration_test_build_file_generation_debian_workspace: - <<: *reusable_build_test_all - <<: *common_workspace_flags - name: "examples/build_file_generation: Debian, workspace" - working_directory: examples/build_file_generation - platform: debian11 - integration_test_build_file_generation_macos_workspace: - <<: *reusable_build_test_all - <<: *common_workspace_flags - name: "examples/build_file_generation: macOS, workspace" - working_directory: examples/build_file_generation - platform: macos_arm64 - integration_test_build_file_generation_windows_workspace: - <<: *reusable_build_test_all - <<: *common_workspace_flags - name: "examples/build_file_generation: Windows, workspace" - working_directory: examples/build_file_generation - platform: windows - integration_test_bzlmod_ubuntu_vendor: <<: *reusable_build_test_all name: "examples/bzlmod: bazel vendor" @@ -365,42 +257,6 @@ tasks: - "bazel build --vendor_dir=./vendor //..." - "rm -rf ./vendor" - integration_test_multi_python_versions_ubuntu_workspace: - <<: *reusable_build_test_all - <<: *common_workspace_flags - <<: *coverage_targets_example_multi_python - name: "examples/multi_python_versions: Ubuntu, workspace" - working_directory: examples/multi_python_versions - platform: ubuntu2204 - integration_test_multi_python_versions_debian_workspace: - <<: *reusable_build_test_all - <<: *common_workspace_flags - <<: *coverage_targets_example_multi_python - name: "examples/multi_python_versions: Debian, workspace" - working_directory: examples/multi_python_versions - platform: debian11 - integration_test_multi_python_versions_macos_workspace: - <<: *reusable_build_test_all - <<: *common_workspace_flags - <<: *coverage_targets_example_multi_python - name: "examples/multi_python_versions: MacOS, workspace" - working_directory: examples/multi_python_versions - platform: macos_arm64 - integration_test_multi_python_versions_windows_workspace: - <<: *reusable_build_test_all - <<: *common_workspace_flags - # coverage is not supported on Windows - name: "examples/multi_python_versions: Windows, workspace" - working_directory: examples/multi_python_versions - platform: windows - - integration_test_pip_parse_ubuntu_min_workspace: - <<: *minimum_supported_version - <<: *common_workspace_flags_min_bazel - <<: *reusable_build_test_all - name: "examples/pip_parse: Ubuntu, workspace, minimum supported Bazel version" - working_directory: examples/pip_parse - platform: ubuntu2204 integration_test_pip_parse_ubuntu_min_bzlmod: <<: *minimum_supported_version <<: *reusable_build_test_all @@ -429,34 +285,6 @@ tasks: working_directory: examples/pip_parse platform: windows - integration_test_pip_parse_vendored_ubuntu_min_workspace: - <<: *minimum_supported_version - <<: *common_workspace_flags_min_bazel - <<: *reusable_build_test_all - name: "examples/pip_parse_vendored: Ubuntu, workspace, minimum Bazel" - working_directory: examples/pip_parse_vendored - platform: ubuntu2204 - integration_test_pip_parse_vendored_ubuntu: - <<: *reusable_build_test_all - <<: *common_workspace_flags - name: "examples/pip_parse_vendored: Ubuntu" - working_directory: examples/pip_parse_vendored - platform: ubuntu2204 - integration_test_pip_parse_vendored_debian: - <<: *reusable_build_test_all - <<: *common_workspace_flags - name: "examples/pip_parse_vendored: Debian" - working_directory: examples/pip_parse_vendored - platform: debian11 - integration_test_pip_parse_vendored_macos: - <<: *reusable_build_test_all - <<: *common_workspace_flags - name: "examples/pip_parse_vendored: MacOS" - working_directory: examples/pip_parse_vendored - platform: macos_arm64 - # We don't run pip_parse_vendored under Windows as the file checked in is - # generated from a repository rule containing OS-specific rendered paths. - integration_test_bazelinbazel_ubuntu: <<: *common_bazelinbazel_config name: "tests/integration bazel-in-bazel: Ubuntu" @@ -557,15 +385,6 @@ tasks: - "bazel run //:os_specific_requirements.update" - "git diff --exit-code" - integration_compile_pip_requirements_test_from_external_repo_ubuntu_min_workspace: - <<: *minimum_supported_version - <<: *common_workspace_flags_min_bazel - name: "compile_pip_requirements_test_from_external_repo: Ubuntu, workspace, minimum Bazel" - working_directory: tests/integration/compile_pip_requirements_test_from_external_repo - platform: ubuntu2204 - shell_commands: - # Assert that @compile_pip_requirements//:requirements_test does the right thing. - - "bazel test @compile_pip_requirements//..." integration_compile_pip_requirements_test_from_external_repo_ubuntu_min_bzlmod: <<: *minimum_supported_version name: "compile_pip_requirements_test_from_external_repo: Ubuntu, bzlmod, minimum Bazel" diff --git a/.bazelrc.deleted_packages b/.bazelrc.deleted_packages index f4ea8527f3..c912180550 100644 --- a/.bazelrc.deleted_packages +++ b/.bazelrc.deleted_packages @@ -1,6 +1,4 @@ # Generated via './tools/update_deleted_packages.sh' -common --deleted_packages=examples/build_file_generation -common --deleted_packages=examples/build_file_generation/random_number_generator common --deleted_packages=examples/bzlmod common --deleted_packages=examples/bzlmod/entry_points common --deleted_packages=examples/bzlmod/entry_points/tests @@ -16,7 +14,6 @@ common --deleted_packages=examples/multi_python_versions/libs/my_lib common --deleted_packages=examples/multi_python_versions/requirements common --deleted_packages=examples/multi_python_versions/tests common --deleted_packages=examples/pip_parse -common --deleted_packages=examples/pip_parse_vendored common --deleted_packages=gazelle common --deleted_packages=gazelle/examples/bzlmod_build_file_generation common --deleted_packages=gazelle/examples/bzlmod_build_file_generation/other_module/other_module/pkg diff --git a/.github/workflows/create_archive_and_notes.sh b/.github/workflows/create_archive_and_notes.sh index 506e2f9784..e692399f86 100755 --- a/.github/workflows/create_archive_and_notes.sh +++ b/.github/workflows/create_archive_and_notes.sh @@ -35,7 +35,6 @@ $(dirname $0)/check_version_markers.sh PREFIX="rules_python-${TAG}" ARCHIVE="rules_python-$TAG.tar.gz" git archive --format=tar "--prefix=${PREFIX}/" "$TAG" | gzip > "$ARCHIVE" -SHA=$(shasum -a 256 "$ARCHIVE" | awk '{print $1}') cat > release_notes.txt << EOF @@ -43,7 +42,7 @@ For more detailed setup instructions, see https://rules-python.readthedocs.io/en For the user-facing changelog see [here](https://rules-python.readthedocs.io/en/latest/changelog.html#v${TAG//./-}) -## Using Bzlmod +## Using Add to your \`MODULE.bazel\` file: @@ -65,43 +64,7 @@ pip.parse( use_repo(pip, "pypi") \`\`\` -## Using WORKSPACE +For \`WORKSPACE\` users, please use rules_python through \`bzlmod\` by loading the rest of your +dependencies through the \`WORKSPACE.bzlmod\` file. -Paste this snippet into your \`WORKSPACE\` file: - -\`\`\`starlark -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_archive( - name = "rules_python", - sha256 = "${SHA}", - strip_prefix = "${PREFIX}", - url = "https://github.com/bazel-contrib/rules_python/releases/download/${TAG}/rules_python-${TAG}.tar.gz", -) - -load("@rules_python//python:repositories.bzl", "py_repositories") - -py_repositories() -\`\`\` - -### Gazelle plugin - -Paste this snippet into your \`WORKSPACE\` file: - -\`\`\`starlark -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -http_archive( - name = "rules_python_gazelle_plugin", - sha256 = "${SHA}", - strip_prefix = "${PREFIX}/gazelle", - url = "https://github.com/bazel-contrib/rules_python/releases/download/${TAG}/rules_python-${TAG}.tar.gz", -) - -# To compile the rules_python gazelle extension from source, -# we must fetch some third-party go dependencies that it uses. - -load("@rules_python_gazelle_plugin//:deps.bzl", _py_gazelle_deps = "gazelle_deps") - -_py_gazelle_deps() -\`\`\` EOF diff --git a/AGENTS.md b/AGENTS.md index 45df61fd25..a1820e2b39 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -156,11 +156,6 @@ instructed to. `bazel query --output=build` can be used to inspect target definitions. -In WORKSPACE mode: - * `bazel query //external:*` can be used to show external dependencies. Adding - `--output=build` shows the definition, including version. - -For bzlmod mode: * `bazel mod graph` shows dependencies and their version. * `bazel mod explain` shows detailed information about a module. * `bazel mode show_repo` shows detailed information about a repository. diff --git a/BUILD.bazel b/BUILD.bazel index 7da18ebaa4..eb6e1a1a9e 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -38,8 +38,6 @@ filegroup( srcs = [ "BUILD.bazel", "MODULE.bazel", - "WORKSPACE", - "WORKSPACE.bzlmod", "internal_dev_deps.bzl", "internal_dev_setup.bzl", "version.bzl", diff --git a/CHANGELOG.md b/CHANGELOG.md index 3916f191b2..8a59795d98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,9 @@ END_UNRELEASED_TEMPLATE ### Removed * (coverage) Support for python 3.8 has been dropped from the bundled `coverage.py` wheel set, since coverage.py 7.6.2 dropped it. +* (workspace) Users loading `rules_python` through `WORKSPACE` will have + to migrate to loading it through `MODULE.bazel`. The previous release is + the last release that supports `WORKSPACE`. {#v0-0-0-changed} ### Changed diff --git a/WORKSPACE b/WORKSPACE deleted file mode 100644 index 077ddb5e68..0000000000 --- a/WORKSPACE +++ /dev/null @@ -1,182 +0,0 @@ -# Copyright 2017 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. - -workspace(name = "rules_python") - -# Everything below this line is used only for developing rules_python. Users -# should not copy it to their WORKSPACE. - -# Necessary so that Bazel 9 recognizes this as rules_python and doesn't try -# to load the version Bazel itself uses by default. -# buildifier: disable=duplicated-name -local_repository( - name = "rules_python", - path = ".", -) - -load("//:internal_dev_deps.bzl", "rules_python_internal_deps") - -rules_python_internal_deps() - -load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies") - -rules_java_dependencies() - -# note that the following line is what is minimally required from protobuf for the java rules -# consider using the protobuf_deps() public API from @com_google_protobuf//:protobuf_deps.bzl -load("@com_google_protobuf//bazel/private:proto_bazel_features.bzl", "proto_bazel_features") # buildifier: disable=bzl-visibility - -proto_bazel_features(name = "proto_bazel_features") - -# register toolchains -load("@rules_java//java:repositories.bzl", "rules_java_toolchains") - -rules_java_toolchains() - -load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") - -protobuf_deps() - -load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps") - -rules_jvm_external_deps() - -load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup") - -rules_jvm_external_setup() - -load("@io_bazel_stardoc//:deps.bzl", "stardoc_external_deps") - -stardoc_external_deps() - -load("@stardoc_maven//:defs.bzl", stardoc_pinned_maven_install = "pinned_maven_install") - -stardoc_pinned_maven_install() - -load("//:internal_dev_setup.bzl", "rules_python_internal_setup") - -rules_python_internal_setup() - -load("@pythons_hub//:versions.bzl", "PYTHON_VERSIONS") -load("//python:repositories.bzl", "py_repositories", "python_register_multi_toolchains") - -py_repositories() - -python_register_multi_toolchains( - name = "python", - default_version = "3.11", - # Integration tests verify each version, so register all of them. - python_versions = PYTHON_VERSIONS, -) - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -# Used for Bazel CI -http_archive( - name = "bazelci_rules", - sha256 = "eca21884e6f66a88c358e580fd67a6b148d30ab57b1680f62a96c00f9bc6a07e", - strip_prefix = "bazelci_rules-1.0.0", - url = "https://github.com/bazelbuild/continuous-integration/releases/download/rules-1.0.0/bazelci_rules-1.0.0.tar.gz", -) - -load("@bazelci_rules//:rbe_repo.bzl", "rbe_preconfig") - -# Creates a default toolchain config for RBE. -# Use this as is if you are using the rbe_ubuntu16_04 container, -# otherwise refer to RBE docs. -rbe_preconfig( - name = "buildkite_config", - toolchain = "ubuntu2204", -) - -local_repository( - name = "rules_python_gazelle_plugin", - path = "gazelle", -) - -# The rules_python gazelle extension has some third-party go dependencies -# which we need to fetch in order to compile it. -load("@rules_python_gazelle_plugin//:deps.bzl", _py_gazelle_deps = "gazelle_deps") - -# See: https://github.com/bazel-contrib/rules_python/blob/main/gazelle/README.md -# This rule loads and compiles various go dependencies that running gazelle -# for python requirements. -_py_gazelle_deps() - -# This interpreter is used for various rules_python dev-time tools -interpreter = "@python_3_11_9_host//:python" - -##################### -# Install twine for our own runfiles wheel publishing. -# Eventually we might want to install twine automatically for users too, see: -# https://github.com/bazel-contrib/rules_python/issues/1016. -load("@rules_python//python:pip.bzl", "pip_parse") - -pip_parse( - name = "rules_python_publish_deps", - python_interpreter_target = interpreter, - requirements_darwin = "//tools/publish:requirements_darwin.txt", - requirements_lock = "//tools/publish:requirements_linux.txt", - requirements_windows = "//tools/publish:requirements_windows.txt", -) - -load("@rules_python_publish_deps//:requirements.bzl", "install_deps") - -install_deps() - -pip_parse( - name = "pypiserver", - python_interpreter_target = interpreter, - requirements_lock = "//examples/wheel:requirements_server.txt", -) - -load("@pypiserver//:requirements.bzl", install_pypiserver = "install_deps") - -install_pypiserver() - -##################### -# Install sphinx for doc generation. - -pip_parse( - name = "dev_pip", - python_interpreter_target = interpreter, - requirements_lock = "//docs:requirements.txt", -) - -load("@dev_pip//:requirements.bzl", docs_install_deps = "install_deps") - -docs_install_deps() - -##################### -# Pypi repos for //tests/multi_pypi - -pip_parse( - name = "pypi_alpha", - python_interpreter_target = interpreter, - requirements_lock = "//tests/multi_pypi/alpha:requirements.txt", -) - -load("@pypi_alpha//:requirements.bzl", pypi_alpha_install_deps = "install_deps") - -pypi_alpha_install_deps() - -pip_parse( - name = "pypi_beta", - python_interpreter_target = interpreter, - requirements_lock = "//tests/multi_pypi/beta:requirements.txt", -) - -load("@pypi_beta//:requirements.bzl", pypi_beta_install_deps = "install_deps") - -pypi_beta_install_deps() diff --git a/WORKSPACE.bzlmod b/WORKSPACE.bzlmod deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/docs/pypi/download-workspace.md b/docs/pypi/download-workspace.md deleted file mode 100644 index 4912f71103..0000000000 --- a/docs/pypi/download-workspace.md +++ /dev/null @@ -1,106 +0,0 @@ -:::{default-domain} bzl -::: - -# Download (WORKSPACE) - -This documentation page covers how to download PyPI dependencies in the legacy `WORKSPACE` setup. - -To add pip dependencies to your `WORKSPACE`, load the `pip_parse` function and -call it to create the central external repo and individual wheel external repos. - -```starlark -load("@rules_python//python:pip.bzl", "pip_parse") - -# Create a central repo that knows about the dependencies needed from -# requirements_lock.txt. -pip_parse( - name = "my_deps", - requirements_lock = "//path/to:requirements_lock.txt", -) - -# Load the starlark macro, which will define your dependencies. -load("@my_deps//:requirements.bzl", "install_deps") - -# Call it to define repos for your requirements. -install_deps() -``` - -## Interpreter selection - -Note that because `pip_parse` runs before Bazel decides which Python toolchain to use, it cannot -enforce that the interpreter used to invoke `pip` matches the interpreter used to run `py_binary` -targets. By default, `pip_parse` uses the system command `"python3"`. To override this, pass in the -{attr}`pip_parse.python_interpreter` attribute or {attr}`pip_parse.python_interpreter_target`. - -You can have multiple `pip_parse`s in the same workspace. This configuration will create multiple -external repos that have no relation to one another and may result in downloading the same wheels -numerous times. - -As with any repository rule, if you would like to ensure that `pip_parse` is -re-executed to pick up a non-hermetic change to your environment (e.g., updating -your system `python` interpreter), you can force it to re-execute by running -`bazel sync --only [pip_parse name]`. - -## Requirements for a specific OS/Architecture - -In some cases, you may need to use different requirements files for different OS and architecture combinations. -This is enabled via the {attr}`pip_parse.requirements_by_platform` attribute. The keys of the -dictionary are labels to the file, and the values are a list of comma-separated target (os, arch) -tuples. - -For example: -```starlark - # ... - requirements_by_platform = { - "requirements_linux_x86_64.txt": "linux_x86_64", - "requirements_osx.txt": "osx_*", - "requirements_linux_exotic.txt": "linux_exotic", - "requirements_some_platforms.txt": "linux_aarch64,windows_*", - }, - # For the list of standard platforms that the rules_python has toolchains for, default to - # the following requirements file. - requirements_lock = "requirements_lock.txt", -``` - -In case of duplicate platforms, `rules_python` will raise an error, as there has -to be an unambiguous mapping of the requirement files to the (os, arch) tuples. - -An alternative way is to use per-OS requirement attributes. -```starlark - # ... - requirements_windows = "requirements_windows.txt", - requirements_darwin = "requirements_darwin.txt", - # For the remaining platforms (which is basically only linux OS), use this file. - requirements_lock = "requirements_lock.txt", -) -``` - -:::{note} -If you are using a universal lock file but want to restrict the list of platforms that -the lock file will be evaluated against, consider using the aforementioned -`requirements_by_platform` attribute and listing the platforms explicitly. -::: - -(vendoring-requirements)= -## Vendoring the requirements.bzl file - -:::{note} -For `bzlmod`, refer to standard `bazel vendor` usage if you want to really vendor it, otherwise -just use the `pip` extension as you would normally. - -However, be aware that there are caveats when doing so. -::: - -In some cases you may not want to generate the requirements.bzl file as a repository rule -while Bazel is fetching dependencies. For example, if you produce a reusable Bazel module -such as a ruleset, you may want to include the `requirements.bzl` file rather than make your users -install the `WORKSPACE` setup to generate it, see {gh-issue}`608`. - -This is the same workflow as Gazelle, which creates `go_repository` rules with -[`update-repos`](https://github.com/bazelbuild/bazel-gazelle#update-repos) - -To do this, use the "write to source file" pattern documented in - -to put a copy of the generated `requirements.bzl` into your project. -Then load the requirements.bzl file directly rather than from the generated repository. -See the example in {gh-path}`examples/pip_parse_vendored`. diff --git a/docs/pypi/download.md b/docs/pypi/download.md index f0e70cf850..62da6afd3b 100644 --- a/docs/pypi/download.md +++ b/docs/pypi/download.md @@ -1,11 +1,7 @@ :::{default-domain} bzl ::: -# Download (bzlmod) - -:::{seealso} -For WORKSPACE instructions see [here](./download-workspace). -::: +# Download To add PyPI dependencies to your `MODULE.bazel` file, use the `pip.parse` extension and call it to create the central external repo and individual wheel diff --git a/docs/pypi/index.md b/docs/pypi/index.md index 2d17dd5054..4a4ba7989e 100644 --- a/docs/pypi/index.md +++ b/docs/pypi/index.md @@ -7,7 +7,7 @@ Using PyPI packages (aka "pip install") involves the following main steps: 1. [Generating requirements file](./lock) -2. Installing third-party packages in [bzlmod](./download) or [WORKSPACE](./download-workspace). +2. Installing third-party packages in [bzlmod](./download). 3. [Using third-party packages as dependencies](./use) With the advanced topics covered separately: @@ -17,7 +17,6 @@ With the advanced topics covered separately: ```{toctree} lock download -download-workspace use ``` diff --git a/docs/pypi/lock.md b/docs/pypi/lock.md index b5d8ec24f7..d2fe58874c 100644 --- a/docs/pypi/lock.md +++ b/docs/pypi/lock.md @@ -36,7 +36,7 @@ This rule generates two targets: - `bazel run [name].update` will regenerate the `requirements_txt` file - `bazel test [name]_test` will test that the `requirements_txt` file is up to date -Once you generate this fully specified list of requirements, you can install the requirements ([bzlmod](./download)/[WORKSPACE](./download-workspace)). +Once you generate this fully specified list of requirements, you can [install the requirements](./download). :::{warning} If you're specifying dependencies in `pyproject.toml`, make sure to include the diff --git a/docs/pypi/use.md b/docs/pypi/use.md index 9d0c54c4ab..bb85700f2c 100644 --- a/docs/pypi/use.md +++ b/docs/pypi/use.md @@ -4,9 +4,7 @@ # Use in BUILD.bazel files Once you have set up the dependencies, you are ready to start using them in your `BUILD.bazel` -files. If you haven't done so yet, set it up by following these docs: -1. [WORKSPACE](./download-workspace) -2. [bzlmod](./download) +files. If you haven't done so yet, set it up by [following these docs](./download). To refer to targets in a hub repo `pypi`, you can do one of two things: ```starlark diff --git a/examples/build_file_generation/.bazelrc b/examples/build_file_generation/.bazelrc deleted file mode 100644 index f1ae44fac8..0000000000 --- a/examples/build_file_generation/.bazelrc +++ /dev/null @@ -1,10 +0,0 @@ -test --test_output=errors --enable_runfiles - -# Windows requires these for multi-python support: -build --enable_runfiles - -# The bzlmod version of this example is in gazelle/examples/bzlmod_build_file_generation -# Once WORKSPACE support is dropped, this example can be entirely deleted. -common --noenable_bzlmod -common --enable_workspace -common --incompatible_python_disallow_native_rules diff --git a/examples/build_file_generation/.gitignore b/examples/build_file_generation/.gitignore deleted file mode 100644 index ac51a054d2..0000000000 --- a/examples/build_file_generation/.gitignore +++ /dev/null @@ -1 +0,0 @@ -bazel-* diff --git a/examples/build_file_generation/BUILD.bazel b/examples/build_file_generation/BUILD.bazel deleted file mode 100644 index a378775968..0000000000 --- a/examples/build_file_generation/BUILD.bazel +++ /dev/null @@ -1,103 +0,0 @@ -# Load various rules so that we can have bazel download -# various rulesets and dependencies. -# The `load` statement imports the symbol for the rule, in the defined -# ruleset. When the symbol is loaded you can use the rule. -load("@bazel_gazelle//:def.bzl", "gazelle") -load("@pip//:requirements.bzl", "all_whl_requirements") -load("@rules_python//python:pip.bzl", "compile_pip_requirements") -load("@rules_python//python:py_binary.bzl", "py_binary") -load("@rules_python//python:py_library.bzl", "py_library") -load("@rules_python//python:py_test.bzl", "py_test") -load("@rules_python_gazelle_plugin//manifest:defs.bzl", "gazelle_python_manifest") -load("@rules_python_gazelle_plugin//modules_mapping:def.bzl", "modules_mapping") - -compile_pip_requirements( - name = "requirements", - src = "requirements.in", - requirements_txt = "requirements_lock.txt", - requirements_windows = "requirements_windows.txt", -) - -# This repository rule fetches the metadata for python packages we -# depend on. That data is required for the gazelle_python_manifest -# rule to update our manifest file. -# To see what this rule does, try `bazel run @modules_map//:print` -modules_mapping( - name = "modules_map", - exclude_patterns = [ - "^_|(\\._)+", # This is the default. - "(\\.tests)+", # Add a custom one to get rid of the psutil tests. - ], - wheels = all_whl_requirements, -) - -# Gazelle python extension needs a manifest file mapping from -# an import to the installed package that provides it. -# This macro produces two targets: -# - //:gazelle_python_manifest.update can be used with `bazel run` -# to recalculate the manifest -# - //:gazelle_python_manifest.test is a test target ensuring that -# the manifest doesn't need to be updated -gazelle_python_manifest( - name = "gazelle_python_manifest", - modules_mapping = ":modules_map", - pip_repository_name = "pip", - # NOTE: We can pass a list just like in `bzlmod_build_file_generation` example - # but we keep a single target here for regression testing. - requirements = "//:requirements_lock.txt", -) - -# Our gazelle target points to the python gazelle binary. -# This is the simple case where we only need one language supported. -# If you also had proto, go, or other gazelle-supported languages, -# you would also need a gazelle_binary rule. -# See https://github.com/bazelbuild/bazel-gazelle/blob/master/extend.rst#example -gazelle( - name = "gazelle", - gazelle = "@rules_python_gazelle_plugin//python:gazelle_binary", -) - -# This rule is auto-generated and managed by Gazelle, -# because it found the __init__.py file in this folder. -# See: https://bazel.build/reference/be/python#py_library -py_library( - name = "build_file_generation", - srcs = ["__init__.py"], - visibility = ["//:__subpackages__"], - deps = [ - "//random_number_generator", - "@pip//flask", - "@pip//sphinx", - ], -) - -# A py_binary is an executable Python program consisting of a collection of .py source files. -# See: https://bazel.build/reference/be/python#py_binary -# -# This rule is auto-generated and managed by Gazelle, -# because it found the __main__.py file in this folder. -# This rule creates a target named //:build_file_generation_bin and you can use -# bazel to run the target: -# `bazel run //:build_file_generation_bin` -py_binary( - name = "build_file_generation_bin", - srcs = ["__main__.py"], - main = "__main__.py", - visibility = ["//:__subpackages__"], - deps = [":build_file_generation"], -) - -# A py_test is a Python unit test. -# See: https://bazel.build/reference/be/python#py_test -# -# This rule is auto-generated and managed by Gazelle, -# because it found the __test__.py file in this folder. -# This rule creates a target named //:build_file_generation_test and you can use -# bazel to run the target: -# `bazel test //:build_file_generation_test` -py_test( - name = "build_file_generation_test", - srcs = ["__test__.py"], - main = "__test__.py", - deps = [":build_file_generation"], -) diff --git a/examples/build_file_generation/README.md b/examples/build_file_generation/README.md deleted file mode 100644 index cd3cd1f109..0000000000 --- a/examples/build_file_generation/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# Build file generation with Gazelle - -This example shows a project that has Gazelle setup with the rules_python -extension, so that targets like `py_library` and `py_binary` can be -automatically created just by running - -```sh -bazel run //:requirements.update -bazel run //:gazelle_python_manifest.update -bazel run //:gazelle -``` - -As a demo, try creating a `__main__.py` file in this directory, then -re-run that gazelle command. You'll see that a `py_binary` target -is created in the `BUILD` file. - -Or, try importing the `requests` library in `__init__.py`. -You'll see that `deps = ["@pip//pypi__requests"]` is automatically -added to the `py_library` target in the `BUILD` file. - -For more information on the behavior of the rules_python gazelle extension, -see the README.md file in the /gazelle folder. diff --git a/examples/build_file_generation/WORKSPACE b/examples/build_file_generation/WORKSPACE deleted file mode 100644 index 27d0d13b7c..0000000000 --- a/examples/build_file_generation/WORKSPACE +++ /dev/null @@ -1,134 +0,0 @@ -# Set the name of the bazel workspace. -workspace(name = "build_file_generation_example") - -# Load the http_archive rule so that we can have bazel download -# various rulesets and dependencies. -# The `load` statement imports the symbol for http_archive from the http.bzl -# file. When the symbol is loaded you can use the rule. -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -# Setup rules_python. - -# DON'T COPY_PASTE THIS. -# Our example uses `local_repository` to point to the HEAD version of rules_python. -# Users should instead use the installation instructions from the release they use. -# See https://github.com/bazel-contrib/rules_python/releases -local_repository( - name = "rules_python", - path = "../..", -) - -local_repository( - name = "rules_python_gazelle_plugin", - path = "../../gazelle", -) - -# Next we load the setup and toolchain from rules_python. -load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains") - -# Perform general setup -py_repositories() - -# We now register a hermetic Python interpreter rather than relying on a system-installed interpreter. -# This toolchain will allow bazel to download a specific python version, and use that version -# for compilation. -python_register_toolchains( - name = "python39", - python_version = "3.9", -) - -load("@rules_python//python:pip.bzl", "pip_parse") - -# This macro wraps the `pip_repository` rule that invokes `pip`, with `incremental` set. -# Accepts a locked/compiled requirements file and installs the dependencies listed within. -# Those dependencies become available in a generated `requirements.bzl` file. -# You can instead check this `requirements.bzl` file into your repo. -pip_parse( - name = "pip", - - # Requirement groups allow Bazel to tolerate PyPi cycles by putting dependencies - # which are known to form cycles into groups together. - experimental_requirement_cycles = { - "sphinx": [ - "sphinx", - "sphinxcontrib-qthelp", - "sphinxcontrib-htmlhelp", - "sphinxcontrib-devhelp", - "sphinxcontrib-applehelp", - "sphinxcontrib-serializinghtml", - ], - }, - # (Optional) You can provide a python_interpreter (path) or a python_interpreter_target (a Bazel target, that - # acts as an executable). The latter can be anything that could be used as Python interpreter. E.g.: - # 1. Python interpreter that you compile in the build file. - # 2. Pre-compiled python interpreter included with http_archive. - # 3. Wrapper script, like in the autodetecting python toolchain. - # - # Here, we use the interpreter constant that resolves to the host interpreter from the default Python toolchain. - python_interpreter_target = "@python39_host//:python", - # Set the location of the lock file. - requirements_lock = "//:requirements_lock.txt", - requirements_windows = "//:requirements_windows.txt", -) - -# Load the install_deps macro. -load("@pip//:requirements.bzl", "install_deps") - -# Initialize repositories for all packages in requirements_lock.txt. -install_deps() - -###################################################################### -# We need rules_go and bazel_gazelle, to build the gazelle plugin from source. -# Setup instructions for this section are at -# https://github.com/bazelbuild/bazel-gazelle#running-gazelle-with-bazel -# You may need to update the version of the rule, which is listed in the above -# documentation. -###################################################################### - -# Define an http_archive rule that will download the below ruleset, -# test the sha, and extract the ruleset to you local bazel cache. - -http_archive( - name = "io_bazel_rules_go", - sha256 = "9d72f7b8904128afb98d46bbef82ad7223ec9ff3718d419afb355fddd9f9484a", - urls = [ - "https://mirror.bazel.build/github.com/bazel-contrib/rules_go/releases/download/v0.55.1/rules_go-v0.55.1.zip", - "https://github.com/bazel-contrib/rules_go/releases/download/v0.55.1/rules_go-v0.55.1.zip", - ], -) - -# Download the bazel_gazelle ruleset. -http_archive( - name = "bazel_gazelle", - sha256 = "75df288c4b31c81eb50f51e2e14f4763cb7548daae126817247064637fd9ea62", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.36.0/bazel-gazelle-v0.36.0.tar.gz", - "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.36.0/bazel-gazelle-v0.36.0.tar.gz", - ], -) - -# Load rules_go ruleset and expose the toolchain and dep rules. -load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") -load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") - -# go_rules_dependencies is a function that registers external dependencies -# needed by the Go rules. -# See: https://github.com/bazelbuild/rules_go/blob/master/go/dependencies.rst#go_rules_dependencies -go_rules_dependencies() - -# go_rules_dependencies is a function that registers external dependencies -# needed by the Go rules. -# See: https://github.com/bazelbuild/rules_go/blob/master/go/dependencies.rst#go_rules_dependencies -go_register_toolchains(version = "1.21.13") - -# The following call configured the gazelle dependencies, Go environment and Go SDK. -gazelle_dependencies() - -# The rules_python gazelle extension has some third-party go dependencies -# which we need to fetch in order to compile it. -load("@rules_python_gazelle_plugin//:deps.bzl", _py_gazelle_deps = "gazelle_deps") - -# See: https://github.com/bazel-contrib/rules_python/blob/main/gazelle/README.md -# This rule loads and compiles various go dependencies that running gazelle -# for python requirements. -_py_gazelle_deps() diff --git a/examples/build_file_generation/__init__.py b/examples/build_file_generation/__init__.py deleted file mode 100644 index 22e42212de..0000000000 --- a/examples/build_file_generation/__init__.py +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2022 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. - -import sphinx # noqa -from flask import Flask, jsonify -from random_number_generator import generate_random_number - -app = Flask(__name__) - - -@app.route("/random-number", methods=["GET"]) -def get_random_number(): - return jsonify({"number": generate_random_number.generate_random_number()}) - - -def main(): - """Start the python web server""" - app.run() diff --git a/examples/build_file_generation/__main__.py b/examples/build_file_generation/__main__.py deleted file mode 100644 index a77055f2d5..0000000000 --- a/examples/build_file_generation/__main__.py +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 2022 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. - -from __init__ import main - -if __name__ == "__main__": - main() diff --git a/examples/build_file_generation/__test__.py b/examples/build_file_generation/__test__.py deleted file mode 100644 index 45e127bab8..0000000000 --- a/examples/build_file_generation/__test__.py +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2022 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. - -import unittest - -from __init__ import app - - -class TestServer(unittest.TestCase): - def setUp(self): - self.app = app.test_client() - - def test_get_random_number(self): - response = self.app.get("/random-number") - self.assertEqual(response.status_code, 200) - self.assertIn("number", response.json) - - -if __name__ == "__main__": - unittest.main() diff --git a/examples/build_file_generation/gazelle_python.yaml b/examples/build_file_generation/gazelle_python.yaml deleted file mode 100644 index 6b34f3c688..0000000000 --- a/examples/build_file_generation/gazelle_python.yaml +++ /dev/null @@ -1,38 +0,0 @@ -# GENERATED FILE - DO NOT EDIT! -# -# To update this file, run: -# bazel run //:gazelle_python_manifest.update - ---- -manifest: - modules_mapping: - alabaster: alabaster - babel: Babel - certifi: certifi - charset_normalizer: charset_normalizer - click: click - docutils: docutils - flask: Flask - idna: idna - imagesize: imagesize - importlib_metadata: importlib_metadata - itsdangerous: itsdangerous - jinja2: Jinja2 - markupsafe: MarkupSafe - packaging: packaging - pygments: Pygments - requests: requests - snowballstemmer: snowballstemmer - sphinx: sphinx - sphinxcontrib.applehelp: sphinxcontrib_applehelp - sphinxcontrib.devhelp: sphinxcontrib_devhelp - sphinxcontrib.htmlhelp: sphinxcontrib_htmlhelp - sphinxcontrib.jsmath: sphinxcontrib_jsmath - sphinxcontrib.qthelp: sphinxcontrib_qthelp - sphinxcontrib.serializinghtml: sphinxcontrib_serializinghtml - urllib3: urllib3 - werkzeug: Werkzeug - zipp: zipp - pip_repository: - name: pip -integrity: 19c0e03a9cf1d6bbb2dfe301325fefc59a30c3f967f84c2f1baaf915c2805da7 diff --git a/examples/build_file_generation/random_number_generator/BUILD.bazel b/examples/build_file_generation/random_number_generator/BUILD.bazel deleted file mode 100644 index c77550084f..0000000000 --- a/examples/build_file_generation/random_number_generator/BUILD.bazel +++ /dev/null @@ -1,18 +0,0 @@ -load("@rules_python//python:py_library.bzl", "py_library") -load("@rules_python//python:py_test.bzl", "py_test") - -py_library( - name = "random_number_generator", - srcs = [ - "__init__.py", - "generate_random_number.py", - ], - visibility = ["//:__subpackages__"], -) - -py_test( - name = "random_number_generator_test", - srcs = ["__test__.py"], - main = "__test__.py", - deps = [":random_number_generator"], -) diff --git a/examples/build_file_generation/random_number_generator/__init__.py b/examples/build_file_generation/random_number_generator/__init__.py deleted file mode 100644 index 41010956cf..0000000000 --- a/examples/build_file_generation/random_number_generator/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# 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. diff --git a/examples/build_file_generation/random_number_generator/__test__.py b/examples/build_file_generation/random_number_generator/__test__.py deleted file mode 100644 index 5facfeee9e..0000000000 --- a/examples/build_file_generation/random_number_generator/__test__.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2022 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. - -import unittest - -import random_number_generator.generate_random_number as generate_random_number - - -class TestRandomNumberGenerator(unittest.TestCase): - def test_generate_random_number(self): - number = generate_random_number.generate_random_number() - self.assertGreaterEqual(number, 1) - self.assertLessEqual(number, 10) - - -if __name__ == "__main__": - unittest.main() diff --git a/examples/build_file_generation/random_number_generator/generate_random_number.py b/examples/build_file_generation/random_number_generator/generate_random_number.py deleted file mode 100644 index d551e3367f..0000000000 --- a/examples/build_file_generation/random_number_generator/generate_random_number.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2022 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. - -import random - - -def generate_random_number(): - """Generate a random number""" - return random.randint(1, 10) diff --git a/examples/build_file_generation/requirements.in b/examples/build_file_generation/requirements.in deleted file mode 100644 index d1380fa948..0000000000 --- a/examples/build_file_generation/requirements.in +++ /dev/null @@ -1,3 +0,0 @@ -flask -sphinx -sphinxcontrib-serializinghtml diff --git a/examples/build_file_generation/requirements_lock.txt b/examples/build_file_generation/requirements_lock.txt deleted file mode 100644 index 995a56a28e..0000000000 --- a/examples/build_file_generation/requirements_lock.txt +++ /dev/null @@ -1,254 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.9 -# by the following command: -# -# bazel run //:requirements.update -# -alabaster==0.7.13 \ - --hash=sha256:1ee19aca801bbabb5ba3f5f258e4422dfa86f82f3e9cefb0859b283cdd7f62a3 \ - --hash=sha256:a27a4a084d5e690e16e01e03ad2b2e552c61a65469419b907243193de1a84ae2 - # via sphinx -babel==2.13.1 \ - --hash=sha256:33e0952d7dd6374af8dbf6768cc4ddf3ccfefc244f9986d4074704f2fbd18900 \ - --hash=sha256:7077a4984b02b6727ac10f1f7294484f737443d7e2e66c5e4380e41a3ae0b4ed - # via sphinx -certifi==2023.7.22 \ - --hash=sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082 \ - --hash=sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9 - # via requests -charset-normalizer==3.3.1 \ - --hash=sha256:06cf46bdff72f58645434d467bf5228080801298fbba19fe268a01b4534467f5 \ - --hash=sha256:0c8c61fb505c7dad1d251c284e712d4e0372cef3b067f7ddf82a7fa82e1e9a93 \ - --hash=sha256:10b8dd31e10f32410751b3430996f9807fc4d1587ca69772e2aa940a82ab571a \ - --hash=sha256:1171ef1fc5ab4693c5d151ae0fdad7f7349920eabbaca6271f95969fa0756c2d \ - --hash=sha256:17a866d61259c7de1bdadef418a37755050ddb4b922df8b356503234fff7932c \ - --hash=sha256:1d6bfc32a68bc0933819cfdfe45f9abc3cae3877e1d90aac7259d57e6e0f85b1 \ - --hash=sha256:1ec937546cad86d0dce5396748bf392bb7b62a9eeb8c66efac60e947697f0e58 \ - --hash=sha256:223b4d54561c01048f657fa6ce41461d5ad8ff128b9678cfe8b2ecd951e3f8a2 \ - --hash=sha256:2465aa50c9299d615d757c1c888bc6fef384b7c4aec81c05a0172b4400f98557 \ - --hash=sha256:28f512b9a33235545fbbdac6a330a510b63be278a50071a336afc1b78781b147 \ - --hash=sha256:2c092be3885a1b7899cd85ce24acedc1034199d6fca1483fa2c3a35c86e43041 \ - --hash=sha256:2c4c99f98fc3a1835af8179dcc9013f93594d0670e2fa80c83aa36346ee763d2 \ - --hash=sha256:31445f38053476a0c4e6d12b047b08ced81e2c7c712e5a1ad97bc913256f91b2 \ - --hash=sha256:31bbaba7218904d2eabecf4feec0d07469284e952a27400f23b6628439439fa7 \ - --hash=sha256:34d95638ff3613849f473afc33f65c401a89f3b9528d0d213c7037c398a51296 \ - --hash=sha256:352a88c3df0d1fa886562384b86f9a9e27563d4704ee0e9d56ec6fcd270ea690 \ - --hash=sha256:39b70a6f88eebe239fa775190796d55a33cfb6d36b9ffdd37843f7c4c1b5dc67 \ - --hash=sha256:3c66df3f41abee950d6638adc7eac4730a306b022570f71dd0bd6ba53503ab57 \ - --hash=sha256:3f70fd716855cd3b855316b226a1ac8bdb3caf4f7ea96edcccc6f484217c9597 \ - --hash=sha256:3f9bc2ce123637a60ebe819f9fccc614da1bcc05798bbbaf2dd4ec91f3e08846 \ - --hash=sha256:3fb765362688821404ad6cf86772fc54993ec11577cd5a92ac44b4c2ba52155b \ - --hash=sha256:45f053a0ece92c734d874861ffe6e3cc92150e32136dd59ab1fb070575189c97 \ - --hash=sha256:46fb9970aa5eeca547d7aa0de5d4b124a288b42eaefac677bde805013c95725c \ - --hash=sha256:4cb50a0335382aac15c31b61d8531bc9bb657cfd848b1d7158009472189f3d62 \ - --hash=sha256:4e12f8ee80aa35e746230a2af83e81bd6b52daa92a8afaef4fea4a2ce9b9f4fa \ - --hash=sha256:4f3100d86dcd03c03f7e9c3fdb23d92e32abbca07e7c13ebd7ddfbcb06f5991f \ - --hash=sha256:4f6e2a839f83a6a76854d12dbebde50e4b1afa63e27761549d006fa53e9aa80e \ - --hash=sha256:4f861d94c2a450b974b86093c6c027888627b8082f1299dfd5a4bae8e2292821 \ - --hash=sha256:501adc5eb6cd5f40a6f77fbd90e5ab915c8fd6e8c614af2db5561e16c600d6f3 \ - --hash=sha256:520b7a142d2524f999447b3a0cf95115df81c4f33003c51a6ab637cbda9d0bf4 \ - --hash=sha256:548eefad783ed787b38cb6f9a574bd8664468cc76d1538215d510a3cd41406cb \ - --hash=sha256:555fe186da0068d3354cdf4bbcbc609b0ecae4d04c921cc13e209eece7720727 \ - --hash=sha256:55602981b2dbf8184c098bc10287e8c245e351cd4fdcad050bd7199d5a8bf514 \ - --hash=sha256:58e875eb7016fd014c0eea46c6fa92b87b62c0cb31b9feae25cbbe62c919f54d \ - --hash=sha256:5a3580a4fdc4ac05f9e53c57f965e3594b2f99796231380adb2baaab96e22761 \ - --hash=sha256:5b70bab78accbc672f50e878a5b73ca692f45f5b5e25c8066d748c09405e6a55 \ - --hash=sha256:5ceca5876032362ae73b83347be8b5dbd2d1faf3358deb38c9c88776779b2e2f \ - --hash=sha256:61f1e3fb621f5420523abb71f5771a204b33c21d31e7d9d86881b2cffe92c47c \ - --hash=sha256:633968254f8d421e70f91c6ebe71ed0ab140220469cf87a9857e21c16687c034 \ - --hash=sha256:63a6f59e2d01310f754c270e4a257426fe5a591dc487f1983b3bbe793cf6bac6 \ - --hash=sha256:63accd11149c0f9a99e3bc095bbdb5a464862d77a7e309ad5938fbc8721235ae \ - --hash=sha256:6db3cfb9b4fcecb4390db154e75b49578c87a3b9979b40cdf90d7e4b945656e1 \ - --hash=sha256:71ef3b9be10070360f289aea4838c784f8b851be3ba58cf796262b57775c2f14 \ - --hash=sha256:7ae8e5142dcc7a49168f4055255dbcced01dc1714a90a21f87448dc8d90617d1 \ - --hash=sha256:7b6cefa579e1237ce198619b76eaa148b71894fb0d6bcf9024460f9bf30fd228 \ - --hash=sha256:800561453acdecedaac137bf09cd719c7a440b6800ec182f077bb8e7025fb708 \ - --hash=sha256:82ca51ff0fc5b641a2d4e1cc8c5ff108699b7a56d7f3ad6f6da9dbb6f0145b48 \ - --hash=sha256:851cf693fb3aaef71031237cd68699dded198657ec1e76a76eb8be58c03a5d1f \ - --hash=sha256:854cc74367180beb327ab9d00f964f6d91da06450b0855cbbb09187bcdb02de5 \ - --hash=sha256:87071618d3d8ec8b186d53cb6e66955ef2a0e4fa63ccd3709c0c90ac5a43520f \ - --hash=sha256:871d045d6ccc181fd863a3cd66ee8e395523ebfbc57f85f91f035f50cee8e3d4 \ - --hash=sha256:8aee051c89e13565c6bd366813c386939f8e928af93c29fda4af86d25b73d8f8 \ - --hash=sha256:8af5a8917b8af42295e86b64903156b4f110a30dca5f3b5aedea123fbd638bff \ - --hash=sha256:8ec8ef42c6cd5856a7613dcd1eaf21e5573b2185263d87d27c8edcae33b62a61 \ - --hash=sha256:91e43805ccafa0a91831f9cd5443aa34528c0c3f2cc48c4cb3d9a7721053874b \ - --hash=sha256:9505dc359edb6a330efcd2be825fdb73ee3e628d9010597aa1aee5aa63442e97 \ - --hash=sha256:985c7965f62f6f32bf432e2681173db41336a9c2611693247069288bcb0c7f8b \ - --hash=sha256:9a74041ba0bfa9bc9b9bb2cd3238a6ab3b7618e759b41bd15b5f6ad958d17605 \ - --hash=sha256:9edbe6a5bf8b56a4a84533ba2b2f489d0046e755c29616ef8830f9e7d9cf5728 \ - --hash=sha256:a15c1fe6d26e83fd2e5972425a772cca158eae58b05d4a25a4e474c221053e2d \ - --hash=sha256:a66bcdf19c1a523e41b8e9d53d0cedbfbac2e93c649a2e9502cb26c014d0980c \ - --hash=sha256:ae4070f741f8d809075ef697877fd350ecf0b7c5837ed68738607ee0a2c572cf \ - --hash=sha256:ae55d592b02c4349525b6ed8f74c692509e5adffa842e582c0f861751701a673 \ - --hash=sha256:b578cbe580e3b41ad17b1c428f382c814b32a6ce90f2d8e39e2e635d49e498d1 \ - --hash=sha256:b891a2f68e09c5ef989007fac11476ed33c5c9994449a4e2c3386529d703dc8b \ - --hash=sha256:baec8148d6b8bd5cee1ae138ba658c71f5b03e0d69d5907703e3e1df96db5e41 \ - --hash=sha256:bb06098d019766ca16fc915ecaa455c1f1cd594204e7f840cd6258237b5079a8 \ - --hash=sha256:bc791ec3fd0c4309a753f95bb6c749ef0d8ea3aea91f07ee1cf06b7b02118f2f \ - --hash=sha256:bd28b31730f0e982ace8663d108e01199098432a30a4c410d06fe08fdb9e93f4 \ - --hash=sha256:be4d9c2770044a59715eb57c1144dedea7c5d5ae80c68fb9959515037cde2008 \ - --hash=sha256:c0c72d34e7de5604df0fde3644cc079feee5e55464967d10b24b1de268deceb9 \ - --hash=sha256:c0e842112fe3f1a4ffcf64b06dc4c61a88441c2f02f373367f7b4c1aa9be2ad5 \ - --hash=sha256:c15070ebf11b8b7fd1bfff7217e9324963c82dbdf6182ff7050519e350e7ad9f \ - --hash=sha256:c2000c54c395d9e5e44c99dc7c20a64dc371f777faf8bae4919ad3e99ce5253e \ - --hash=sha256:c30187840d36d0ba2893bc3271a36a517a717f9fd383a98e2697ee890a37c273 \ - --hash=sha256:cb7cd68814308aade9d0c93c5bd2ade9f9441666f8ba5aa9c2d4b389cb5e2a45 \ - --hash=sha256:cd805513198304026bd379d1d516afbf6c3c13f4382134a2c526b8b854da1c2e \ - --hash=sha256:d0bf89afcbcf4d1bb2652f6580e5e55a840fdf87384f6063c4a4f0c95e378656 \ - --hash=sha256:d9137a876020661972ca6eec0766d81aef8a5627df628b664b234b73396e727e \ - --hash=sha256:dbd95e300367aa0827496fe75a1766d198d34385a58f97683fe6e07f89ca3e3c \ - --hash=sha256:dced27917823df984fe0c80a5c4ad75cf58df0fbfae890bc08004cd3888922a2 \ - --hash=sha256:de0b4caa1c8a21394e8ce971997614a17648f94e1cd0640fbd6b4d14cab13a72 \ - --hash=sha256:debb633f3f7856f95ad957d9b9c781f8e2c6303ef21724ec94bea2ce2fcbd056 \ - --hash=sha256:e372d7dfd154009142631de2d316adad3cc1c36c32a38b16a4751ba78da2a397 \ - --hash=sha256:ecd26be9f112c4f96718290c10f4caea6cc798459a3a76636b817a0ed7874e42 \ - --hash=sha256:edc0202099ea1d82844316604e17d2b175044f9bcb6b398aab781eba957224bd \ - --hash=sha256:f194cce575e59ffe442c10a360182a986535fd90b57f7debfaa5c845c409ecc3 \ - --hash=sha256:f5fb672c396d826ca16a022ac04c9dce74e00a1c344f6ad1a0fdc1ba1f332213 \ - --hash=sha256:f6a02a3c7950cafaadcd46a226ad9e12fc9744652cc69f9e5534f98b47f3bbcf \ - --hash=sha256:fe81b35c33772e56f4b6cf62cf4aedc1762ef7162a31e6ac7fe5e40d0149eb67 - # via requests -click==8.1.3 \ - --hash=sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e \ - --hash=sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48 - # via flask -docutils==0.20.1 \ - --hash=sha256:96f387a2c5562db4476f09f13bbab2192e764cac08ebbf3a34a95d9b1e4a59d6 \ - --hash=sha256:f08a4e276c3a1583a86dce3e34aba3fe04d02bba2dd51ed16106244e8a923e3b - # via sphinx -flask==2.2.2 \ - --hash=sha256:642c450d19c4ad482f96729bd2a8f6d32554aa1e231f4f6b4e7e5264b16cca2b \ - --hash=sha256:b9c46cc36662a7949f34b52d8ec7bb59c0d74ba08ba6cb9ce9adc1d8676d9526 - # via -r requirements.in -idna==3.4 \ - --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \ - --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2 - # via requests -imagesize==1.4.1 \ - --hash=sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b \ - --hash=sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a - # via sphinx -importlib-metadata==5.2.0 \ - --hash=sha256:0eafa39ba42bf225fc00e67f701d71f85aead9f878569caf13c3724f704b970f \ - --hash=sha256:404d48d62bba0b7a77ff9d405efd91501bef2e67ff4ace0bed40a0cf28c3c7cd - # via - # flask - # sphinx -itsdangerous==2.1.2 \ - --hash=sha256:2c2349112351b88699d8d4b6b075022c0808887cb7ad10069318a8b0bc88db44 \ - --hash=sha256:5dbbc68b317e5e42f327f9021763545dc3fc3bfe22e6deb96aaf1fc38874156a - # via flask -jinja2==3.1.2 \ - --hash=sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852 \ - --hash=sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61 - # via - # flask - # sphinx -markupsafe==2.1.1 \ - --hash=sha256:0212a68688482dc52b2d45013df70d169f542b7394fc744c02a57374a4207003 \ - --hash=sha256:089cf3dbf0cd6c100f02945abeb18484bd1ee57a079aefd52cffd17fba910b88 \ - --hash=sha256:10c1bfff05d95783da83491be968e8fe789263689c02724e0c691933c52994f5 \ - --hash=sha256:33b74d289bd2f5e527beadcaa3f401e0df0a89927c1559c8566c066fa4248ab7 \ - --hash=sha256:3799351e2336dc91ea70b034983ee71cf2f9533cdff7c14c90ea126bfd95d65a \ - --hash=sha256:3ce11ee3f23f79dbd06fb3d63e2f6af7b12db1d46932fe7bd8afa259a5996603 \ - --hash=sha256:421be9fbf0ffe9ffd7a378aafebbf6f4602d564d34be190fc19a193232fd12b1 \ - --hash=sha256:43093fb83d8343aac0b1baa75516da6092f58f41200907ef92448ecab8825135 \ - --hash=sha256:46d00d6cfecdde84d40e572d63735ef81423ad31184100411e6e3388d405e247 \ - --hash=sha256:4a33dea2b688b3190ee12bd7cfa29d39c9ed176bda40bfa11099a3ce5d3a7ac6 \ - --hash=sha256:4b9fe39a2ccc108a4accc2676e77da025ce383c108593d65cc909add5c3bd601 \ - --hash=sha256:56442863ed2b06d19c37f94d999035e15ee982988920e12a5b4ba29b62ad1f77 \ - --hash=sha256:671cd1187ed5e62818414afe79ed29da836dde67166a9fac6d435873c44fdd02 \ - --hash=sha256:694deca8d702d5db21ec83983ce0bb4b26a578e71fbdbd4fdcd387daa90e4d5e \ - --hash=sha256:6a074d34ee7a5ce3effbc526b7083ec9731bb3cbf921bbe1d3005d4d2bdb3a63 \ - --hash=sha256:6d0072fea50feec76a4c418096652f2c3238eaa014b2f94aeb1d56a66b41403f \ - --hash=sha256:6fbf47b5d3728c6aea2abb0589b5d30459e369baa772e0f37a0320185e87c980 \ - --hash=sha256:7f91197cc9e48f989d12e4e6fbc46495c446636dfc81b9ccf50bb0ec74b91d4b \ - --hash=sha256:86b1f75c4e7c2ac2ccdaec2b9022845dbb81880ca318bb7a0a01fbf7813e3812 \ - --hash=sha256:8dc1c72a69aa7e082593c4a203dcf94ddb74bb5c8a731e4e1eb68d031e8498ff \ - --hash=sha256:8e3dcf21f367459434c18e71b2a9532d96547aef8a871872a5bd69a715c15f96 \ - --hash=sha256:8e576a51ad59e4bfaac456023a78f6b5e6e7651dcd383bcc3e18d06f9b55d6d1 \ - --hash=sha256:96e37a3dc86e80bf81758c152fe66dbf60ed5eca3d26305edf01892257049925 \ - --hash=sha256:97a68e6ada378df82bc9f16b800ab77cbf4b2fada0081794318520138c088e4a \ - --hash=sha256:99a2a507ed3ac881b975a2976d59f38c19386d128e7a9a18b7df6fff1fd4c1d6 \ - --hash=sha256:a49907dd8420c5685cfa064a1335b6754b74541bbb3706c259c02ed65b644b3e \ - --hash=sha256:b09bf97215625a311f669476f44b8b318b075847b49316d3e28c08e41a7a573f \ - --hash=sha256:b7bd98b796e2b6553da7225aeb61f447f80a1ca64f41d83612e6139ca5213aa4 \ - --hash=sha256:b87db4360013327109564f0e591bd2a3b318547bcef31b468a92ee504d07ae4f \ - --hash=sha256:bcb3ed405ed3222f9904899563d6fc492ff75cce56cba05e32eff40e6acbeaa3 \ - --hash=sha256:d4306c36ca495956b6d568d276ac11fdd9c30a36f1b6eb928070dc5360b22e1c \ - --hash=sha256:d5ee4f386140395a2c818d149221149c54849dfcfcb9f1debfe07a8b8bd63f9a \ - --hash=sha256:dda30ba7e87fbbb7eab1ec9f58678558fd9a6b8b853530e176eabd064da81417 \ - --hash=sha256:e04e26803c9c3851c931eac40c695602c6295b8d432cbe78609649ad9bd2da8a \ - --hash=sha256:e1c0b87e09fa55a220f058d1d49d3fb8df88fbfab58558f1198e08c1e1de842a \ - --hash=sha256:e72591e9ecd94d7feb70c1cbd7be7b3ebea3f548870aa91e2732960fa4d57a37 \ - --hash=sha256:e8c843bbcda3a2f1e3c2ab25913c80a3c5376cd00c6e8c4a86a89a28c8dc5452 \ - --hash=sha256:efc1913fd2ca4f334418481c7e595c00aad186563bbc1ec76067848c7ca0a933 \ - --hash=sha256:f121a1420d4e173a5d96e47e9a0c0dcff965afdf1626d28de1460815f7c4ee7a \ - --hash=sha256:fc7b548b17d238737688817ab67deebb30e8073c95749d55538ed473130ec0c7 - # via - # jinja2 - # werkzeug -packaging==23.2 \ - --hash=sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5 \ - --hash=sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7 - # via sphinx -pygments==2.16.1 \ - --hash=sha256:13fc09fa63bc8d8671a6d247e1eb303c4b343eaee81d861f3404db2935653692 \ - --hash=sha256:1daff0494820c69bc8941e407aa20f577374ee88364ee10a98fdbe0aece96e29 - # via sphinx -requests==2.31.0 \ - --hash=sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f \ - --hash=sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1 - # via sphinx -snowballstemmer==2.2.0 \ - --hash=sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1 \ - --hash=sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a - # via sphinx -sphinx==7.2.6 \ - --hash=sha256:1e09160a40b956dc623c910118fa636da93bd3ca0b9876a7b3df90f07d691560 \ - --hash=sha256:9a5160e1ea90688d5963ba09a2dcd8bdd526620edbb65c328728f1b2228d5ab5 - # via - # -r requirements.in - # sphinxcontrib-applehelp - # sphinxcontrib-devhelp - # sphinxcontrib-htmlhelp - # sphinxcontrib-qthelp - # sphinxcontrib-serializinghtml -sphinxcontrib-applehelp==1.0.7 \ - --hash=sha256:094c4d56209d1734e7d252f6e0b3ccc090bd52ee56807a5d9315b19c122ab15d \ - --hash=sha256:39fdc8d762d33b01a7d8f026a3b7d71563ea3b72787d5f00ad8465bd9d6dfbfa - # via sphinx -sphinxcontrib-devhelp==1.0.5 \ - --hash=sha256:63b41e0d38207ca40ebbeabcf4d8e51f76c03e78cd61abe118cf4435c73d4212 \ - --hash=sha256:fe8009aed765188f08fcaadbb3ea0d90ce8ae2d76710b7e29ea7d047177dae2f - # via sphinx -sphinxcontrib-htmlhelp==2.0.4 \ - --hash=sha256:6c26a118a05b76000738429b724a0568dbde5b72391a688577da08f11891092a \ - --hash=sha256:8001661c077a73c29beaf4a79968d0726103c5605e27db92b9ebed8bab1359e9 - # via sphinx -sphinxcontrib-jsmath==1.0.1 \ - --hash=sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178 \ - --hash=sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8 - # via sphinx -sphinxcontrib-qthelp==1.0.6 \ - --hash=sha256:62b9d1a186ab7f5ee3356d906f648cacb7a6bdb94d201ee7adf26db55092982d \ - --hash=sha256:bf76886ee7470b934e363da7a954ea2825650013d367728588732c7350f49ea4 - # via sphinx -sphinxcontrib-serializinghtml==1.1.9 \ - --hash=sha256:0c64ff898339e1fac29abd2bf5f11078f3ec413cfe9c046d3120d7ca65530b54 \ - --hash=sha256:9b36e503703ff04f20e9675771df105e58aa029cfcbc23b8ed716019b7416ae1 - # via - # -r requirements.in - # sphinx -urllib3==2.0.7 \ - --hash=sha256:c97dfde1f7bd43a71c8d2a58e369e9b2bf692d1334ea9f9cae55add7d0dd0f84 \ - --hash=sha256:fdb6d215c776278489906c2f8916e6e7d4f5a9b602ccbcfdf7f016fc8da0596e - # via requests -werkzeug==2.2.2 \ - --hash=sha256:7ea2d48322cc7c0f8b3a215ed73eabd7b5d75d0b50e31ab006286ccff9e00b8f \ - --hash=sha256:f979ab81f58d7318e064e99c4506445d60135ac5cd2e177a2de0089bfd4c9bd5 - # via flask -zipp==3.11.0 \ - --hash=sha256:83a28fcb75844b5c0cdaf5aa4003c2d728c77e05f5aeabe8e95e56727005fbaa \ - --hash=sha256:a7a22e05929290a67401440b39690ae6563279bced5f314609d9d03798f56766 - # via importlib-metadata diff --git a/examples/build_file_generation/requirements_windows.txt b/examples/build_file_generation/requirements_windows.txt deleted file mode 100644 index 19709690ea..0000000000 --- a/examples/build_file_generation/requirements_windows.txt +++ /dev/null @@ -1,260 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.9 -# by the following command: -# -# bazel run //:requirements.update -# -alabaster==0.7.13 \ - --hash=sha256:1ee19aca801bbabb5ba3f5f258e4422dfa86f82f3e9cefb0859b283cdd7f62a3 \ - --hash=sha256:a27a4a084d5e690e16e01e03ad2b2e552c61a65469419b907243193de1a84ae2 - # via sphinx -babel==2.13.1 \ - --hash=sha256:33e0952d7dd6374af8dbf6768cc4ddf3ccfefc244f9986d4074704f2fbd18900 \ - --hash=sha256:7077a4984b02b6727ac10f1f7294484f737443d7e2e66c5e4380e41a3ae0b4ed - # via sphinx -certifi==2023.7.22 \ - --hash=sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082 \ - --hash=sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9 - # via requests -charset-normalizer==3.3.1 \ - --hash=sha256:06cf46bdff72f58645434d467bf5228080801298fbba19fe268a01b4534467f5 \ - --hash=sha256:0c8c61fb505c7dad1d251c284e712d4e0372cef3b067f7ddf82a7fa82e1e9a93 \ - --hash=sha256:10b8dd31e10f32410751b3430996f9807fc4d1587ca69772e2aa940a82ab571a \ - --hash=sha256:1171ef1fc5ab4693c5d151ae0fdad7f7349920eabbaca6271f95969fa0756c2d \ - --hash=sha256:17a866d61259c7de1bdadef418a37755050ddb4b922df8b356503234fff7932c \ - --hash=sha256:1d6bfc32a68bc0933819cfdfe45f9abc3cae3877e1d90aac7259d57e6e0f85b1 \ - --hash=sha256:1ec937546cad86d0dce5396748bf392bb7b62a9eeb8c66efac60e947697f0e58 \ - --hash=sha256:223b4d54561c01048f657fa6ce41461d5ad8ff128b9678cfe8b2ecd951e3f8a2 \ - --hash=sha256:2465aa50c9299d615d757c1c888bc6fef384b7c4aec81c05a0172b4400f98557 \ - --hash=sha256:28f512b9a33235545fbbdac6a330a510b63be278a50071a336afc1b78781b147 \ - --hash=sha256:2c092be3885a1b7899cd85ce24acedc1034199d6fca1483fa2c3a35c86e43041 \ - --hash=sha256:2c4c99f98fc3a1835af8179dcc9013f93594d0670e2fa80c83aa36346ee763d2 \ - --hash=sha256:31445f38053476a0c4e6d12b047b08ced81e2c7c712e5a1ad97bc913256f91b2 \ - --hash=sha256:31bbaba7218904d2eabecf4feec0d07469284e952a27400f23b6628439439fa7 \ - --hash=sha256:34d95638ff3613849f473afc33f65c401a89f3b9528d0d213c7037c398a51296 \ - --hash=sha256:352a88c3df0d1fa886562384b86f9a9e27563d4704ee0e9d56ec6fcd270ea690 \ - --hash=sha256:39b70a6f88eebe239fa775190796d55a33cfb6d36b9ffdd37843f7c4c1b5dc67 \ - --hash=sha256:3c66df3f41abee950d6638adc7eac4730a306b022570f71dd0bd6ba53503ab57 \ - --hash=sha256:3f70fd716855cd3b855316b226a1ac8bdb3caf4f7ea96edcccc6f484217c9597 \ - --hash=sha256:3f9bc2ce123637a60ebe819f9fccc614da1bcc05798bbbaf2dd4ec91f3e08846 \ - --hash=sha256:3fb765362688821404ad6cf86772fc54993ec11577cd5a92ac44b4c2ba52155b \ - --hash=sha256:45f053a0ece92c734d874861ffe6e3cc92150e32136dd59ab1fb070575189c97 \ - --hash=sha256:46fb9970aa5eeca547d7aa0de5d4b124a288b42eaefac677bde805013c95725c \ - --hash=sha256:4cb50a0335382aac15c31b61d8531bc9bb657cfd848b1d7158009472189f3d62 \ - --hash=sha256:4e12f8ee80aa35e746230a2af83e81bd6b52daa92a8afaef4fea4a2ce9b9f4fa \ - --hash=sha256:4f3100d86dcd03c03f7e9c3fdb23d92e32abbca07e7c13ebd7ddfbcb06f5991f \ - --hash=sha256:4f6e2a839f83a6a76854d12dbebde50e4b1afa63e27761549d006fa53e9aa80e \ - --hash=sha256:4f861d94c2a450b974b86093c6c027888627b8082f1299dfd5a4bae8e2292821 \ - --hash=sha256:501adc5eb6cd5f40a6f77fbd90e5ab915c8fd6e8c614af2db5561e16c600d6f3 \ - --hash=sha256:520b7a142d2524f999447b3a0cf95115df81c4f33003c51a6ab637cbda9d0bf4 \ - --hash=sha256:548eefad783ed787b38cb6f9a574bd8664468cc76d1538215d510a3cd41406cb \ - --hash=sha256:555fe186da0068d3354cdf4bbcbc609b0ecae4d04c921cc13e209eece7720727 \ - --hash=sha256:55602981b2dbf8184c098bc10287e8c245e351cd4fdcad050bd7199d5a8bf514 \ - --hash=sha256:58e875eb7016fd014c0eea46c6fa92b87b62c0cb31b9feae25cbbe62c919f54d \ - --hash=sha256:5a3580a4fdc4ac05f9e53c57f965e3594b2f99796231380adb2baaab96e22761 \ - --hash=sha256:5b70bab78accbc672f50e878a5b73ca692f45f5b5e25c8066d748c09405e6a55 \ - --hash=sha256:5ceca5876032362ae73b83347be8b5dbd2d1faf3358deb38c9c88776779b2e2f \ - --hash=sha256:61f1e3fb621f5420523abb71f5771a204b33c21d31e7d9d86881b2cffe92c47c \ - --hash=sha256:633968254f8d421e70f91c6ebe71ed0ab140220469cf87a9857e21c16687c034 \ - --hash=sha256:63a6f59e2d01310f754c270e4a257426fe5a591dc487f1983b3bbe793cf6bac6 \ - --hash=sha256:63accd11149c0f9a99e3bc095bbdb5a464862d77a7e309ad5938fbc8721235ae \ - --hash=sha256:6db3cfb9b4fcecb4390db154e75b49578c87a3b9979b40cdf90d7e4b945656e1 \ - --hash=sha256:71ef3b9be10070360f289aea4838c784f8b851be3ba58cf796262b57775c2f14 \ - --hash=sha256:7ae8e5142dcc7a49168f4055255dbcced01dc1714a90a21f87448dc8d90617d1 \ - --hash=sha256:7b6cefa579e1237ce198619b76eaa148b71894fb0d6bcf9024460f9bf30fd228 \ - --hash=sha256:800561453acdecedaac137bf09cd719c7a440b6800ec182f077bb8e7025fb708 \ - --hash=sha256:82ca51ff0fc5b641a2d4e1cc8c5ff108699b7a56d7f3ad6f6da9dbb6f0145b48 \ - --hash=sha256:851cf693fb3aaef71031237cd68699dded198657ec1e76a76eb8be58c03a5d1f \ - --hash=sha256:854cc74367180beb327ab9d00f964f6d91da06450b0855cbbb09187bcdb02de5 \ - --hash=sha256:87071618d3d8ec8b186d53cb6e66955ef2a0e4fa63ccd3709c0c90ac5a43520f \ - --hash=sha256:871d045d6ccc181fd863a3cd66ee8e395523ebfbc57f85f91f035f50cee8e3d4 \ - --hash=sha256:8aee051c89e13565c6bd366813c386939f8e928af93c29fda4af86d25b73d8f8 \ - --hash=sha256:8af5a8917b8af42295e86b64903156b4f110a30dca5f3b5aedea123fbd638bff \ - --hash=sha256:8ec8ef42c6cd5856a7613dcd1eaf21e5573b2185263d87d27c8edcae33b62a61 \ - --hash=sha256:91e43805ccafa0a91831f9cd5443aa34528c0c3f2cc48c4cb3d9a7721053874b \ - --hash=sha256:9505dc359edb6a330efcd2be825fdb73ee3e628d9010597aa1aee5aa63442e97 \ - --hash=sha256:985c7965f62f6f32bf432e2681173db41336a9c2611693247069288bcb0c7f8b \ - --hash=sha256:9a74041ba0bfa9bc9b9bb2cd3238a6ab3b7618e759b41bd15b5f6ad958d17605 \ - --hash=sha256:9edbe6a5bf8b56a4a84533ba2b2f489d0046e755c29616ef8830f9e7d9cf5728 \ - --hash=sha256:a15c1fe6d26e83fd2e5972425a772cca158eae58b05d4a25a4e474c221053e2d \ - --hash=sha256:a66bcdf19c1a523e41b8e9d53d0cedbfbac2e93c649a2e9502cb26c014d0980c \ - --hash=sha256:ae4070f741f8d809075ef697877fd350ecf0b7c5837ed68738607ee0a2c572cf \ - --hash=sha256:ae55d592b02c4349525b6ed8f74c692509e5adffa842e582c0f861751701a673 \ - --hash=sha256:b578cbe580e3b41ad17b1c428f382c814b32a6ce90f2d8e39e2e635d49e498d1 \ - --hash=sha256:b891a2f68e09c5ef989007fac11476ed33c5c9994449a4e2c3386529d703dc8b \ - --hash=sha256:baec8148d6b8bd5cee1ae138ba658c71f5b03e0d69d5907703e3e1df96db5e41 \ - --hash=sha256:bb06098d019766ca16fc915ecaa455c1f1cd594204e7f840cd6258237b5079a8 \ - --hash=sha256:bc791ec3fd0c4309a753f95bb6c749ef0d8ea3aea91f07ee1cf06b7b02118f2f \ - --hash=sha256:bd28b31730f0e982ace8663d108e01199098432a30a4c410d06fe08fdb9e93f4 \ - --hash=sha256:be4d9c2770044a59715eb57c1144dedea7c5d5ae80c68fb9959515037cde2008 \ - --hash=sha256:c0c72d34e7de5604df0fde3644cc079feee5e55464967d10b24b1de268deceb9 \ - --hash=sha256:c0e842112fe3f1a4ffcf64b06dc4c61a88441c2f02f373367f7b4c1aa9be2ad5 \ - --hash=sha256:c15070ebf11b8b7fd1bfff7217e9324963c82dbdf6182ff7050519e350e7ad9f \ - --hash=sha256:c2000c54c395d9e5e44c99dc7c20a64dc371f777faf8bae4919ad3e99ce5253e \ - --hash=sha256:c30187840d36d0ba2893bc3271a36a517a717f9fd383a98e2697ee890a37c273 \ - --hash=sha256:cb7cd68814308aade9d0c93c5bd2ade9f9441666f8ba5aa9c2d4b389cb5e2a45 \ - --hash=sha256:cd805513198304026bd379d1d516afbf6c3c13f4382134a2c526b8b854da1c2e \ - --hash=sha256:d0bf89afcbcf4d1bb2652f6580e5e55a840fdf87384f6063c4a4f0c95e378656 \ - --hash=sha256:d9137a876020661972ca6eec0766d81aef8a5627df628b664b234b73396e727e \ - --hash=sha256:dbd95e300367aa0827496fe75a1766d198d34385a58f97683fe6e07f89ca3e3c \ - --hash=sha256:dced27917823df984fe0c80a5c4ad75cf58df0fbfae890bc08004cd3888922a2 \ - --hash=sha256:de0b4caa1c8a21394e8ce971997614a17648f94e1cd0640fbd6b4d14cab13a72 \ - --hash=sha256:debb633f3f7856f95ad957d9b9c781f8e2c6303ef21724ec94bea2ce2fcbd056 \ - --hash=sha256:e372d7dfd154009142631de2d316adad3cc1c36c32a38b16a4751ba78da2a397 \ - --hash=sha256:ecd26be9f112c4f96718290c10f4caea6cc798459a3a76636b817a0ed7874e42 \ - --hash=sha256:edc0202099ea1d82844316604e17d2b175044f9bcb6b398aab781eba957224bd \ - --hash=sha256:f194cce575e59ffe442c10a360182a986535fd90b57f7debfaa5c845c409ecc3 \ - --hash=sha256:f5fb672c396d826ca16a022ac04c9dce74e00a1c344f6ad1a0fdc1ba1f332213 \ - --hash=sha256:f6a02a3c7950cafaadcd46a226ad9e12fc9744652cc69f9e5534f98b47f3bbcf \ - --hash=sha256:fe81b35c33772e56f4b6cf62cf4aedc1762ef7162a31e6ac7fe5e40d0149eb67 - # via requests -click==8.1.3 \ - --hash=sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e \ - --hash=sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48 - # via flask -colorama==0.4.6 \ - --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \ - --hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6 - # via - # click - # sphinx -docutils==0.20.1 \ - --hash=sha256:96f387a2c5562db4476f09f13bbab2192e764cac08ebbf3a34a95d9b1e4a59d6 \ - --hash=sha256:f08a4e276c3a1583a86dce3e34aba3fe04d02bba2dd51ed16106244e8a923e3b - # via sphinx -flask==2.2.2 \ - --hash=sha256:642c450d19c4ad482f96729bd2a8f6d32554aa1e231f4f6b4e7e5264b16cca2b \ - --hash=sha256:b9c46cc36662a7949f34b52d8ec7bb59c0d74ba08ba6cb9ce9adc1d8676d9526 - # via -r requirements.in -idna==3.4 \ - --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \ - --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2 - # via requests -imagesize==1.4.1 \ - --hash=sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b \ - --hash=sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a - # via sphinx -importlib-metadata==5.2.0 \ - --hash=sha256:0eafa39ba42bf225fc00e67f701d71f85aead9f878569caf13c3724f704b970f \ - --hash=sha256:404d48d62bba0b7a77ff9d405efd91501bef2e67ff4ace0bed40a0cf28c3c7cd - # via - # flask - # sphinx -itsdangerous==2.1.2 \ - --hash=sha256:2c2349112351b88699d8d4b6b075022c0808887cb7ad10069318a8b0bc88db44 \ - --hash=sha256:5dbbc68b317e5e42f327f9021763545dc3fc3bfe22e6deb96aaf1fc38874156a - # via flask -jinja2==3.1.2 \ - --hash=sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852 \ - --hash=sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61 - # via - # flask - # sphinx -markupsafe==2.1.1 \ - --hash=sha256:0212a68688482dc52b2d45013df70d169f542b7394fc744c02a57374a4207003 \ - --hash=sha256:089cf3dbf0cd6c100f02945abeb18484bd1ee57a079aefd52cffd17fba910b88 \ - --hash=sha256:10c1bfff05d95783da83491be968e8fe789263689c02724e0c691933c52994f5 \ - --hash=sha256:33b74d289bd2f5e527beadcaa3f401e0df0a89927c1559c8566c066fa4248ab7 \ - --hash=sha256:3799351e2336dc91ea70b034983ee71cf2f9533cdff7c14c90ea126bfd95d65a \ - --hash=sha256:3ce11ee3f23f79dbd06fb3d63e2f6af7b12db1d46932fe7bd8afa259a5996603 \ - --hash=sha256:421be9fbf0ffe9ffd7a378aafebbf6f4602d564d34be190fc19a193232fd12b1 \ - --hash=sha256:43093fb83d8343aac0b1baa75516da6092f58f41200907ef92448ecab8825135 \ - --hash=sha256:46d00d6cfecdde84d40e572d63735ef81423ad31184100411e6e3388d405e247 \ - --hash=sha256:4a33dea2b688b3190ee12bd7cfa29d39c9ed176bda40bfa11099a3ce5d3a7ac6 \ - --hash=sha256:4b9fe39a2ccc108a4accc2676e77da025ce383c108593d65cc909add5c3bd601 \ - --hash=sha256:56442863ed2b06d19c37f94d999035e15ee982988920e12a5b4ba29b62ad1f77 \ - --hash=sha256:671cd1187ed5e62818414afe79ed29da836dde67166a9fac6d435873c44fdd02 \ - --hash=sha256:694deca8d702d5db21ec83983ce0bb4b26a578e71fbdbd4fdcd387daa90e4d5e \ - --hash=sha256:6a074d34ee7a5ce3effbc526b7083ec9731bb3cbf921bbe1d3005d4d2bdb3a63 \ - --hash=sha256:6d0072fea50feec76a4c418096652f2c3238eaa014b2f94aeb1d56a66b41403f \ - --hash=sha256:6fbf47b5d3728c6aea2abb0589b5d30459e369baa772e0f37a0320185e87c980 \ - --hash=sha256:7f91197cc9e48f989d12e4e6fbc46495c446636dfc81b9ccf50bb0ec74b91d4b \ - --hash=sha256:86b1f75c4e7c2ac2ccdaec2b9022845dbb81880ca318bb7a0a01fbf7813e3812 \ - --hash=sha256:8dc1c72a69aa7e082593c4a203dcf94ddb74bb5c8a731e4e1eb68d031e8498ff \ - --hash=sha256:8e3dcf21f367459434c18e71b2a9532d96547aef8a871872a5bd69a715c15f96 \ - --hash=sha256:8e576a51ad59e4bfaac456023a78f6b5e6e7651dcd383bcc3e18d06f9b55d6d1 \ - --hash=sha256:96e37a3dc86e80bf81758c152fe66dbf60ed5eca3d26305edf01892257049925 \ - --hash=sha256:97a68e6ada378df82bc9f16b800ab77cbf4b2fada0081794318520138c088e4a \ - --hash=sha256:99a2a507ed3ac881b975a2976d59f38c19386d128e7a9a18b7df6fff1fd4c1d6 \ - --hash=sha256:a49907dd8420c5685cfa064a1335b6754b74541bbb3706c259c02ed65b644b3e \ - --hash=sha256:b09bf97215625a311f669476f44b8b318b075847b49316d3e28c08e41a7a573f \ - --hash=sha256:b7bd98b796e2b6553da7225aeb61f447f80a1ca64f41d83612e6139ca5213aa4 \ - --hash=sha256:b87db4360013327109564f0e591bd2a3b318547bcef31b468a92ee504d07ae4f \ - --hash=sha256:bcb3ed405ed3222f9904899563d6fc492ff75cce56cba05e32eff40e6acbeaa3 \ - --hash=sha256:d4306c36ca495956b6d568d276ac11fdd9c30a36f1b6eb928070dc5360b22e1c \ - --hash=sha256:d5ee4f386140395a2c818d149221149c54849dfcfcb9f1debfe07a8b8bd63f9a \ - --hash=sha256:dda30ba7e87fbbb7eab1ec9f58678558fd9a6b8b853530e176eabd064da81417 \ - --hash=sha256:e04e26803c9c3851c931eac40c695602c6295b8d432cbe78609649ad9bd2da8a \ - --hash=sha256:e1c0b87e09fa55a220f058d1d49d3fb8df88fbfab58558f1198e08c1e1de842a \ - --hash=sha256:e72591e9ecd94d7feb70c1cbd7be7b3ebea3f548870aa91e2732960fa4d57a37 \ - --hash=sha256:e8c843bbcda3a2f1e3c2ab25913c80a3c5376cd00c6e8c4a86a89a28c8dc5452 \ - --hash=sha256:efc1913fd2ca4f334418481c7e595c00aad186563bbc1ec76067848c7ca0a933 \ - --hash=sha256:f121a1420d4e173a5d96e47e9a0c0dcff965afdf1626d28de1460815f7c4ee7a \ - --hash=sha256:fc7b548b17d238737688817ab67deebb30e8073c95749d55538ed473130ec0c7 - # via - # jinja2 - # werkzeug -packaging==23.2 \ - --hash=sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5 \ - --hash=sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7 - # via sphinx -pygments==2.16.1 \ - --hash=sha256:13fc09fa63bc8d8671a6d247e1eb303c4b343eaee81d861f3404db2935653692 \ - --hash=sha256:1daff0494820c69bc8941e407aa20f577374ee88364ee10a98fdbe0aece96e29 - # via sphinx -requests==2.31.0 \ - --hash=sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f \ - --hash=sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1 - # via sphinx -snowballstemmer==2.2.0 \ - --hash=sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1 \ - --hash=sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a - # via sphinx -sphinx==7.2.6 \ - --hash=sha256:1e09160a40b956dc623c910118fa636da93bd3ca0b9876a7b3df90f07d691560 \ - --hash=sha256:9a5160e1ea90688d5963ba09a2dcd8bdd526620edbb65c328728f1b2228d5ab5 - # via - # -r requirements.in - # sphinxcontrib-applehelp - # sphinxcontrib-devhelp - # sphinxcontrib-htmlhelp - # sphinxcontrib-qthelp - # sphinxcontrib-serializinghtml -sphinxcontrib-applehelp==1.0.7 \ - --hash=sha256:094c4d56209d1734e7d252f6e0b3ccc090bd52ee56807a5d9315b19c122ab15d \ - --hash=sha256:39fdc8d762d33b01a7d8f026a3b7d71563ea3b72787d5f00ad8465bd9d6dfbfa - # via sphinx -sphinxcontrib-devhelp==1.0.5 \ - --hash=sha256:63b41e0d38207ca40ebbeabcf4d8e51f76c03e78cd61abe118cf4435c73d4212 \ - --hash=sha256:fe8009aed765188f08fcaadbb3ea0d90ce8ae2d76710b7e29ea7d047177dae2f - # via sphinx -sphinxcontrib-htmlhelp==2.0.4 \ - --hash=sha256:6c26a118a05b76000738429b724a0568dbde5b72391a688577da08f11891092a \ - --hash=sha256:8001661c077a73c29beaf4a79968d0726103c5605e27db92b9ebed8bab1359e9 - # via sphinx -sphinxcontrib-jsmath==1.0.1 \ - --hash=sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178 \ - --hash=sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8 - # via sphinx -sphinxcontrib-qthelp==1.0.6 \ - --hash=sha256:62b9d1a186ab7f5ee3356d906f648cacb7a6bdb94d201ee7adf26db55092982d \ - --hash=sha256:bf76886ee7470b934e363da7a954ea2825650013d367728588732c7350f49ea4 - # via sphinx -sphinxcontrib-serializinghtml==1.1.9 \ - --hash=sha256:0c64ff898339e1fac29abd2bf5f11078f3ec413cfe9c046d3120d7ca65530b54 \ - --hash=sha256:9b36e503703ff04f20e9675771df105e58aa029cfcbc23b8ed716019b7416ae1 - # via - # -r requirements.in - # sphinx -urllib3==2.0.7 \ - --hash=sha256:c97dfde1f7bd43a71c8d2a58e369e9b2bf692d1334ea9f9cae55add7d0dd0f84 \ - --hash=sha256:fdb6d215c776278489906c2f8916e6e7d4f5a9b602ccbcfdf7f016fc8da0596e - # via requests -werkzeug==2.2.2 \ - --hash=sha256:7ea2d48322cc7c0f8b3a215ed73eabd7b5d75d0b50e31ab006286ccff9e00b8f \ - --hash=sha256:f979ab81f58d7318e064e99c4506445d60135ac5cd2e177a2de0089bfd4c9bd5 - # via flask -zipp==3.11.0 \ - --hash=sha256:83a28fcb75844b5c0cdaf5aa4003c2d728c77e05f5aeabe8e95e56727005fbaa \ - --hash=sha256:a7a22e05929290a67401440b39690ae6563279bced5f314609d9d03798f56766 - # via importlib-metadata diff --git a/examples/multi_python_versions/WORKSPACE b/examples/multi_python_versions/WORKSPACE index 0b6b8a0cbf..e69de29bb2 100644 --- a/examples/multi_python_versions/WORKSPACE +++ b/examples/multi_python_versions/WORKSPACE @@ -1,66 +0,0 @@ -workspace(name = "rules_python_multi_python_versions") - -local_repository( - name = "rules_python", - path = "../..", -) - -load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_multi_toolchains") - -py_repositories() - -default_python_version = "3.10" - -python_register_multi_toolchains( - name = "python", - default_version = default_python_version, - python_versions = [ - "3.10", - "3.11", - "3.12", - "3.13", - "3.14", - ], - register_coverage_tool = True, -) - -load("@python//:pip.bzl", "multi_pip_parse") - -multi_pip_parse( - name = "pypi", - default_version = default_python_version, - python_interpreter_target = { - "3.10": "@python_3_10_host//:python", - "3.11": "@python_3_11_host//:python", - "3.12": "@python_3_12_host//:python", - "3.13": "@python_3_13_host//:python", - "3.14": "@python_3_14_host//:python", - }, - requirements_lock = { - "3.10": "//requirements:requirements_lock_3_10.txt", - "3.11": "//requirements:requirements_lock_3_11.txt", - "3.12": "//requirements:requirements_lock_3_12.txt", - "3.13": "//requirements:requirements_lock_3_13.txt", - "3.14": "//requirements:requirements_lock_3_14.txt", - }, -) - -load("@pypi//:requirements.bzl", "install_deps") - -install_deps() - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -# See https://github.com/bazelbuild/rules_shell/releases/tag/v0.2.0 -http_archive( - name = "rules_shell", - sha256 = "410e8ff32e018b9efd2743507e7595c26e2628567c42224411ff533b57d27c28", - strip_prefix = "rules_shell-0.2.0", - url = "https://github.com/bazelbuild/rules_shell/releases/download/v0.2.0/rules_shell-v0.2.0.tar.gz", -) - -load("@rules_shell//shell:repositories.bzl", "rules_shell_dependencies", "rules_shell_toolchains") - -rules_shell_dependencies() - -rules_shell_toolchains() diff --git a/examples/multi_python_versions/WORKSPACE.bzlmod b/examples/multi_python_versions/WORKSPACE.bzlmod deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/examples/pip_parse/WORKSPACE b/examples/pip_parse/WORKSPACE index e0d60af9ff..e69de29bb2 100644 --- a/examples/pip_parse/WORKSPACE +++ b/examples/pip_parse/WORKSPACE @@ -1,65 +0,0 @@ -workspace(name = "rules_python_pip_parse_example") - -local_repository( - name = "rules_python", - path = "../..", -) - -load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains") - -py_repositories() - -python_register_toolchains( - name = "python_3_9", - python_version = "3.9.25", -) - -load("@rules_python//python:pip.bzl", "pip_parse") - -pip_parse( - # (Optional) You can set an environment in the pip process to control its - # behavior. Note that pip is run in "isolated" mode so no PIP__ - # style env vars are read, but env vars that control requests and urllib3 - # can be passed - # environment = {"HTTPS_PROXY": "http://my.proxy.fun/"}, - name = "pypi", - - # Requirement groups allow Bazel to tolerate PyPi cycles by putting dependencies - # which are known to form cycles into groups together. - experimental_requirement_cycles = { - "sphinx": [ - "sphinx", - "sphinxcontrib-qthelp", - "sphinxcontrib-htmlhelp", - "sphinxcontrib-devhelp", - "sphinxcontrib-applehelp", - "sphinxcontrib-serializinghtml", - ], - }, - # (Optional) You can provide extra parameters to pip. - # Here, make pip output verbose (this is usable with `quiet = False`). - # extra_pip_args = ["-v"], - - # (Optional) You can exclude custom elements in the data section of the generated BUILD files for pip packages. - # Exclude directories with spaces in their names in this example (avoids build errors if there are such directories). - #pip_data_exclude = ["**/* */**"], - - # (Optional) You can provide a python_interpreter (path) or a python_interpreter_target (a Bazel target, that - # acts as an executable). The latter can be anything that could be used as Python interpreter. E.g.: - # 1. Python interpreter that you compile in the build file (as above in @python_interpreter). - # 2. Pre-compiled python interpreter included with http_archive - # 3. Wrapper script, like in the autodetecting python toolchain. - # - # Here, we use the interpreter constant that resolves to the host interpreter from the default Python toolchain. - python_interpreter_target = "@python_3_9_host//:python", - - # (Optional) You can set quiet to False if you want to see pip output. - #quiet = False, - requirements_lock = "//:requirements_lock.txt", - requirements_windows = "//:requirements_windows.txt", -) - -load("@pypi//:requirements.bzl", "install_deps") - -# Initialize repositories for all packages in requirements_lock.txt. -install_deps() diff --git a/examples/pip_parse/WORKSPACE.bzlmod b/examples/pip_parse/WORKSPACE.bzlmod deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/examples/pip_parse_vendored/.bazelrc b/examples/pip_parse_vendored/.bazelrc deleted file mode 100644 index a6ea2d9138..0000000000 --- a/examples/pip_parse_vendored/.bazelrc +++ /dev/null @@ -1,10 +0,0 @@ -test --test_output=errors - -# Windows requires these for multi-python support: -build --enable_runfiles - -# Vendoring requirements.bzl files isn't necessary under bzlmod -# When workspace support is dropped, this example can be removed. -common --noenable_bzlmod -common --enable_workspace -common --incompatible_python_disallow_native_rules diff --git a/examples/pip_parse_vendored/.bazelversion b/examples/pip_parse_vendored/.bazelversion deleted file mode 100644 index 35907cd9ca..0000000000 --- a/examples/pip_parse_vendored/.bazelversion +++ /dev/null @@ -1 +0,0 @@ -7.x diff --git a/examples/pip_parse_vendored/.gitignore b/examples/pip_parse_vendored/.gitignore deleted file mode 100644 index ac51a054d2..0000000000 --- a/examples/pip_parse_vendored/.gitignore +++ /dev/null @@ -1 +0,0 @@ -bazel-* diff --git a/examples/pip_parse_vendored/BUILD.bazel b/examples/pip_parse_vendored/BUILD.bazel deleted file mode 100644 index 74b9286359..0000000000 --- a/examples/pip_parse_vendored/BUILD.bazel +++ /dev/null @@ -1,77 +0,0 @@ -load("@bazel_skylib//rules:build_test.bzl", "build_test") -load("@bazel_skylib//rules:diff_test.bzl", "diff_test") -load("@bazel_skylib//rules:write_file.bzl", "write_file") -load("@rules_python//python:pip.bzl", "compile_pip_requirements") -load("@rules_python//python:py_test.bzl", "py_test") -load("@rules_shell//shell:sh_binary.bzl", "sh_binary") -load("//:requirements.bzl", "all_data_requirements", "all_requirements", "all_whl_requirements", "requirement") - -# This rule adds a convenient way to update the requirements.txt -# lockfile based on the requirements.in. -compile_pip_requirements( - name = "requirements", - src = "requirements.in", -) - -# The requirements.bzl file is using the hub repo to access packages via the -# `requirement` macro and when the requirements.bzl is vendored, the hub -# repo won't be present. As a result, we have to adjust the label scheme in -# the requirements.bzl to make sure that they continue to work. -genrule( - name = "requirement_bzl", - srcs = ["@pip_deps_to_be_vendored//:requirements.bzl"], - outs = ["requirements.clean.bzl"], - cmd = " | ".join([ - "cat $<", - # Substitute the name of the hub to ensure that the dependencies do - # not require the hub repo initialized in the WORKSPACE. - "sed -e 's/pip_deps_to_be_vendored/my_project_pip_deps_vendored/g'", - # Change the labels from using the hub repo to using the spoke repos - # directly. - "sed -e 's|//\\([^:]*\\):pkg|_\\1//:pkg|g'", - "sed -e 's|//\\([^:]*\\):whl|_\\1//:whl|g'", - "sed -e 's|//\\([^:]*\\):data|_\\1//:data|g'", - # Change the convenience macros to use the same naming. - "sed -e 's|//{}:{}|_{}//:{}|g' >$@", - ]), -) - -write_file( - name = "gen_update", - out = "update.sh", - content = [ - # This depends on bash, would need tweaks for Windows - "#!/usr/bin/env bash", - # Bazel gives us a way to access the source folder! - "cd $BUILD_WORKSPACE_DIRECTORY", - "cp -fv bazel-bin/requirements.clean.bzl requirements.bzl", - ], -) - -sh_binary( - name = "vendor_requirements", - srcs = ["update.sh"], - data = [":requirement_bzl"], -) - -# Similarly ensures that the requirements.bzl file is updated -# based on the requirements.txt lockfile. -diff_test( - name = "test_vendored", - failure_message = "Please run: bazel run //:vendor_requirements", - file1 = "requirements.bzl", - file2 = "requirement_bzl", -) - -py_test( - name = "test_dependency_usage", - srcs = ["test_dependency_usage.py"], - deps = [ - requirement("requests"), - ], -) - -build_test( - name = "test_requirement_lists", - targets = all_requirements + all_whl_requirements + all_data_requirements, -) diff --git a/examples/pip_parse_vendored/README.md b/examples/pip_parse_vendored/README.md deleted file mode 100644 index baa51f5729..0000000000 --- a/examples/pip_parse_vendored/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# pip_parse vendored - -This example is like pip_parse, however we avoid loading from the generated file. -See https://github.com/bazel-contrib/rules_python/issues/608 -and https://blog.aspect.dev/avoid-eager-fetches. - -The requirements now form a triple: - -- requirements.in - human editable, expresses only direct dependencies and load-bearing version constraints -- requirements.txt - lockfile produced by pip-compile or other means -- requirements.bzl - the "parsed" version of the lockfile readable by Bazel downloader - -The `requirements.bzl` file contains baked-in attributes such as `python_interpreter_target` as they were specified in the original `pip_parse` rule. These can be overridden at install time by passing arguments to `install_deps`. For example: - -```python -# Register a hermetic toolchain -load("@rules_python//python:repositories.bzl", "python_register_toolchains") - -python_register_toolchains( - name = "python39", - python_version = "3.9", -) - -# Load dependencies vendored by some other ruleset. -load("@some_rules//:py_deps.bzl", "install_deps") - -install_deps( - python_interpreter_target = "@python39_host//:python", -) -``` diff --git a/examples/pip_parse_vendored/WORKSPACE b/examples/pip_parse_vendored/WORKSPACE deleted file mode 100644 index 5e80b4116b..0000000000 --- a/examples/pip_parse_vendored/WORKSPACE +++ /dev/null @@ -1,57 +0,0 @@ -workspace(name = "pip_parse_vendored_example") - -local_repository( - name = "rules_python", - path = "../..", -) - -load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains") - -py_repositories() - -python_register_toolchains( - name = "python39", - python_version = "3.9", -) - -load("@rules_python//python:pip.bzl", "pip_parse") - -# This repository isn't referenced, except by our test that asserts the requirements.bzl is updated. -# It also wouldn't be needed by users of this ruleset. -# If you're using envsubst with extra_pip_args, as we do below, the value of the environment -# variables at the time we generate requirements.bzl don't make it into the file, as you may -# verify by inspection; the environment variables at a later time, when we download the -# packages, will be the ones that take effect. -pip_parse( - # We choose a unique name here to make sure we can do some cleanup on it. - name = "pip_deps_to_be_vendored", - envsubst = ["PIP_RETRIES"], - extra_pip_args = ["--retries=${PIP_RETRIES:-5}"], - python_interpreter_target = "@python39_host//:python", - requirements_lock = "//:requirements.txt", -) - -# This example vendors the file produced by `pip_parse` above into the repo. -# This way our Bazel doesn't eagerly fetch and install the pip_parse'd -# repository for builds that don't need it. -# See discussion of the trade-offs in the pip_parse documentation -# and the "vendor_requirements" target in the BUILD file. -load("//:requirements.bzl", "install_deps") - -install_deps() - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -# See https://github.com/bazelbuild/rules_shell/releases/tag/v0.2.0 -http_archive( - name = "rules_shell", - sha256 = "410e8ff32e018b9efd2743507e7595c26e2628567c42224411ff533b57d27c28", - strip_prefix = "rules_shell-0.2.0", - url = "https://github.com/bazelbuild/rules_shell/releases/download/v0.2.0/rules_shell-v0.2.0.tar.gz", -) - -load("@rules_shell//shell:repositories.bzl", "rules_shell_dependencies", "rules_shell_toolchains") - -rules_shell_dependencies() - -rules_shell_toolchains() diff --git a/examples/pip_parse_vendored/requirements.bzl b/examples/pip_parse_vendored/requirements.bzl deleted file mode 100644 index f5551573fb..0000000000 --- a/examples/pip_parse_vendored/requirements.bzl +++ /dev/null @@ -1,122 +0,0 @@ -"""Starlark representation of locked requirements. - -@generated by rules_python pip_parse repository rule. -""" - -load("@rules_python//python:pip.bzl", "pip_utils") -load("@rules_python//python/pip_install:pip_repository.bzl", "whl_config_repo", "whl_library") - -all_requirements = [ - "@my_project_pip_deps_vendored_certifi//:pkg", - "@my_project_pip_deps_vendored_charset_normalizer//:pkg", - "@my_project_pip_deps_vendored_idna//:pkg", - "@my_project_pip_deps_vendored_requests//:pkg", - "@my_project_pip_deps_vendored_urllib3//:pkg", -] - -all_whl_requirements_by_package = { - "certifi": "@my_project_pip_deps_vendored_certifi//:whl", - "charset_normalizer": "@my_project_pip_deps_vendored_charset_normalizer//:whl", - "idna": "@my_project_pip_deps_vendored_idna//:whl", - "requests": "@my_project_pip_deps_vendored_requests//:whl", - "urllib3": "@my_project_pip_deps_vendored_urllib3//:whl", -} - -all_whl_requirements = all_whl_requirements_by_package.values() - -all_data_requirements = [ - "@my_project_pip_deps_vendored_certifi//:data", - "@my_project_pip_deps_vendored_charset_normalizer//:data", - "@my_project_pip_deps_vendored_idna//:data", - "@my_project_pip_deps_vendored_requests//:data", - "@my_project_pip_deps_vendored_urllib3//:data", -] - -_packages = [ - ("my_project_pip_deps_vendored_certifi", "certifi==2023.7.22 --hash=sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082 --hash=sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9"), - ("my_project_pip_deps_vendored_charset_normalizer", "charset-normalizer==2.1.1 --hash=sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845 --hash=sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f"), - ("my_project_pip_deps_vendored_idna", "idna==3.4 --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"), - ("my_project_pip_deps_vendored_requests", "requests==2.28.1 --hash=sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983 --hash=sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349"), - ("my_project_pip_deps_vendored_urllib3", "urllib3==1.26.13 --hash=sha256:47cc05d99aaa09c9e72ed5809b60e7ba354e64b59c9c173ac3018642d8bb41fc --hash=sha256:c083dd0dce68dbfbe1129d5271cb90f9447dea7d52097c6e0126120c521ddea8"), -] -_config = { - "download_only": False, - "enable_implicit_namespace_pkgs": False, - "environment": {}, - "envsubst": ["PIP_RETRIES"], - "extra_pip_args": ["--retries=${PIP_RETRIES:-5}"], - "isolated": True, - "pip_data_exclude": [], - "python_interpreter": "python3", - "python_interpreter_target": "@python39_host//:python", - "quiet": True, - "repo": "my_project_pip_deps_vendored", - "repo_prefix": "my_project_pip_deps_vendored_", - "timeout": 600, -} -_annotations = {} - -def requirement(name): - return "@my_project_pip_deps_vendored_{}//:{}".format(pip_utils.normalize_name(name), "pkg") - -def whl_requirement(name): - return "@my_project_pip_deps_vendored_{}//:{}".format(pip_utils.normalize_name(name), "whl") - -def data_requirement(name): - return "@my_project_pip_deps_vendored_{}//:{}".format(pip_utils.normalize_name(name), "data") - -def dist_info_requirement(name): - return "@my_project_pip_deps_vendored_{}//:{}".format(pip_utils.normalize_name(name), "dist_info") - -def _get_annotation(requirement): - # This expects to parse `setuptools==58.2.0 --hash=sha256:2551203ae6955b9876741a26ab3e767bb3242dafe86a32a749ea0d78b6792f11` - # down to `setuptools`. - name = requirement.split(" ")[0].split("=")[0].split("[")[0] - return _annotations.get(name) - -def install_deps(**whl_library_kwargs): - """Repository rule macro. Install dependencies from `pip_parse`. - - Args: - **whl_library_kwargs: Additional arguments which will flow to underlying - `whl_library` calls. See pip_repository.bzl for details. - """ - - # Set up the requirement groups - all_requirement_groups = {} - - requirement_group_mapping = { - requirement: group_name - for group_name, group_requirements in all_requirement_groups.items() - for requirement in group_requirements - } - - config_repo = "my_project_pip_deps_vendored__config" - whl_config_repo( - name = "my_project_pip_deps_vendored__config", - repo_prefix = "my_project_pip_deps_vendored_", - groups = all_requirement_groups, - whl_map = { - p: "" - for p in all_whl_requirements_by_package - }, - ) - config_load = "@{}//:config.bzl".format(config_repo) - - # Install wheels which may be participants in a group - whl_config = dict(_config) - whl_config.update(whl_library_kwargs) - - for name, requirement in _packages: - group_name = requirement_group_mapping.get(name.replace("my_project_pip_deps_vendored_", "")) - group_deps = all_requirement_groups.get(group_name, []) - - whl_library( - name = name, - requirement = requirement, - group_name = group_name, - group_deps = group_deps, - annotation = _get_annotation(requirement), - config_load = config_load, - **whl_config - ) diff --git a/examples/pip_parse_vendored/requirements.in b/examples/pip_parse_vendored/requirements.in deleted file mode 100644 index 7ec4233fa4..0000000000 --- a/examples/pip_parse_vendored/requirements.in +++ /dev/null @@ -1,2 +0,0 @@ -requests -certifi>=2023.7.22 # https://security.snyk.io/vuln/SNYK-PYTHON-CERTIFI-5805047 diff --git a/examples/pip_parse_vendored/requirements.txt b/examples/pip_parse_vendored/requirements.txt deleted file mode 100644 index 75b45a1ce3..0000000000 --- a/examples/pip_parse_vendored/requirements.txt +++ /dev/null @@ -1,28 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.9 -# by the following command: -# -# bazel run //:requirements.update -# -certifi==2023.7.22 \ - --hash=sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082 \ - --hash=sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9 - # via - # -r requirements.in - # requests -charset-normalizer==2.1.1 \ - --hash=sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845 \ - --hash=sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f - # via requests -idna==3.4 \ - --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \ - --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2 - # via requests -requests==2.28.1 \ - --hash=sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983 \ - --hash=sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349 - # via -r requirements.in -urllib3==1.26.13 \ - --hash=sha256:47cc05d99aaa09c9e72ed5809b60e7ba354e64b59c9c173ac3018642d8bb41fc \ - --hash=sha256:c083dd0dce68dbfbe1129d5271cb90f9447dea7d52097c6e0126120c521ddea8 - # via requests diff --git a/examples/pip_parse_vendored/test_dependency_usage.py b/examples/pip_parse_vendored/test_dependency_usage.py deleted file mode 100644 index e2cf970d9d..0000000000 --- a/examples/pip_parse_vendored/test_dependency_usage.py +++ /dev/null @@ -1,12 +0,0 @@ -import unittest - -import requests - - -class TestDependencies(unittest.TestCase): - def test_import(self): - self.assertIsNotNone(requests.get) - - -if __name__ == "__main__": - unittest.main() diff --git a/gazelle/BUILD.bazel b/gazelle/BUILD.bazel index 0938be3dfc..b265c1c61b 100644 --- a/gazelle/BUILD.bazel +++ b/gazelle/BUILD.bazel @@ -24,7 +24,6 @@ filegroup( ":BUILD.bazel", ":MODULE.bazel", ":README.md", - ":WORKSPACE", ":def.bzl", ":deps.bzl", ":go.mod", diff --git a/gazelle/WORKSPACE b/gazelle/WORKSPACE deleted file mode 100644 index ebb18e7a47..0000000000 --- a/gazelle/WORKSPACE +++ /dev/null @@ -1,63 +0,0 @@ -workspace(name = "rules_python_gazelle_plugin") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_archive( - name = "bazel_skylib", - sha256 = "6e78f0e57de26801f6f564fa7c4a48dc8b36873e416257a92bbb0937eeac8446", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.8.2/bazel-skylib-1.8.2.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.8.2/bazel-skylib-1.8.2.tar.gz", - ], -) - -load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") - -bazel_skylib_workspace() - -http_archive( - name = "io_bazel_rules_go", - sha256 = "9d72f7b8904128afb98d46bbef82ad7223ec9ff3718d419afb355fddd9f9484a", - urls = [ - "https://mirror.bazel.build/github.com/bazel-contrib/rules_go/releases/download/v0.55.1/rules_go-v0.55.1.zip", - "https://github.com/bazel-contrib/rules_go/releases/download/v0.55.1/rules_go-v0.55.1.zip", - ], -) - -http_archive( - name = "bazel_gazelle", - sha256 = "675114d8b433d0a9f54d81171833be96ebc4113115664b791e6f204d58e93446", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.47.0/bazel-gazelle-v0.47.0.tar.gz", - "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.47.0/bazel-gazelle-v0.47.0.tar.gz", - ], -) - -load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") -load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") - -go_rules_dependencies() - -go_register_toolchains(version = "1.22.9") - -gazelle_dependencies() - -local_repository( - name = "rules_python", - path = "..", -) - -load("@rules_python//python:repositories.bzl", "py_repositories") - -py_repositories() - -load("//:internal_dev_deps.bzl", "internal_dev_deps") - -internal_dev_deps() - -register_toolchains("@rules_python//python/runtime_env_toolchains:all") - -load("//:deps.bzl", _py_gazelle_deps = "gazelle_deps") - -# gazelle:repository_macro deps.bzl%go_deps -_py_gazelle_deps() diff --git a/gazelle/manifest/defs.bzl b/gazelle/manifest/defs.bzl index 71a4d57156..ef26a3cb05 100644 --- a/gazelle/manifest/defs.bzl +++ b/gazelle/manifest/defs.bzl @@ -158,7 +158,7 @@ def gazelle_python_manifest( # buildifier: disable=provider-params AllSourcesInfo = provider(fields = {"all_srcs": "All sources collected from the target and dependencies."}) -_rules_python_workspace = Label("@rules_python//:WORKSPACE") +_rules_python_workspace = Label("@rules_python//:MODULE.bazel") def _get_all_sources_impl(target, ctx): is_rules_python = target.label.repo_name == _rules_python_workspace.repo_name diff --git a/python/BUILD.bazel b/python/BUILD.bazel index 90b2225ab5..2546094fa2 100644 --- a/python/BUILD.bazel +++ b/python/BUILD.bazel @@ -102,11 +102,9 @@ bzl_library( srcs = ["pip.bzl"], deps = [ "//python/private:normalize_name_bzl", - "//python/private/pypi:multi_pip_parse_bzl", "//python/private/pypi:package_annotation_bzl", "//python/private/pypi:pip_compile_bzl", "//python/private/pypi:pip_repository_bzl", - "//python/private/pypi:whl_library_alias_bzl", "//python/private/whl_filegroup:whl_filegroup_bzl", ], ) @@ -216,7 +214,6 @@ bzl_library( deps = [ "//python/private:is_standalone_interpreter_bzl", "//python/private:py_repositories_bzl", - "//python/private:python_register_multi_toolchains_bzl", "//python/private:python_register_toolchains_bzl", "//python/private:python_repository_bzl", ], diff --git a/python/pip.bzl b/python/pip.bzl index 44ee69d65b..7159946cb2 100644 --- a/python/pip.bzl +++ b/python/pip.bzl @@ -24,11 +24,9 @@ rest of the symbols are for legacy `WORKSPACE` setups. """ load("//python/private:normalize_name.bzl", "normalize_name") -load("//python/private/pypi:multi_pip_parse.bzl", _multi_pip_parse = "multi_pip_parse") load("//python/private/pypi:package_annotation.bzl", _package_annotation = "package_annotation") load("//python/private/pypi:pip_compile.bzl", "pip_compile") load("//python/private/pypi:pip_repository.bzl", "pip_repository") -load("//python/private/pypi:whl_library_alias.bzl", _whl_library_alias = "whl_library_alias") load("//python/private/whl_filegroup:whl_filegroup.bzl", _whl_filegroup = "whl_filegroup") compile_pip_requirements = pip_compile @@ -40,10 +38,3 @@ whl_filegroup = _whl_filegroup pip_utils = struct( normalize_name = normalize_name, ) - -# The following are only exported here because they are used from -# multi_toolchain_aliases repository_rule, not intended for public use. -# -# See ./private/toolchains_repo.bzl -multi_pip_parse = _multi_pip_parse -whl_library_alias = _whl_library_alias diff --git a/python/private/BUILD.bazel b/python/private/BUILD.bazel index 6ab3d546be..7de3806f65 100644 --- a/python/private/BUILD.bazel +++ b/python/private/BUILD.bazel @@ -312,16 +312,6 @@ bzl_library( ], ) -bzl_library( - name = "python_register_multi_toolchains_bzl", - srcs = ["python_register_multi_toolchains.bzl"], - deps = [ - ":python_register_toolchains_bzl", - ":toolchains_repo_bzl", - "//python:versions_bzl", - ], -) - bzl_library( name = "pythons_hub_bzl", srcs = ["pythons_hub.bzl"], diff --git a/python/private/pypi/BUILD.bazel b/python/private/pypi/BUILD.bazel index 7569eccac4..4e0ca105e5 100644 --- a/python/private/pypi/BUILD.bazel +++ b/python/private/pypi/BUILD.bazel @@ -225,15 +225,6 @@ bzl_library( srcs = ["labels.bzl"], ) -bzl_library( - name = "multi_pip_parse_bzl", - srcs = ["multi_pip_parse.bzl"], - deps = [ - ":pip_repository_bzl", - "//python/private:text_util_bzl", - ], -) - bzl_library( name = "package_annotation_bzl", srcs = ["package_annotation.bzl"], @@ -485,15 +476,6 @@ bzl_library( ], ) -bzl_library( - name = "whl_library_alias_bzl", - srcs = ["whl_library_alias.bzl"], - deps = [ - ":render_pkg_aliases_bzl", - "//python/private:full_version_bzl", - ], -) - bzl_library( name = "whl_library_bzl", srcs = ["whl_library.bzl"], diff --git a/python/private/pypi/multi_pip_parse.bzl b/python/private/pypi/multi_pip_parse.bzl deleted file mode 100644 index 60496c2eca..0000000000 --- a/python/private/pypi/multi_pip_parse.bzl +++ /dev/null @@ -1,166 +0,0 @@ -# Copyright 2024 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. - -"""A pip_parse implementation for version aware toolchains in WORKSPACE.""" - -load("//python/private:text_util.bzl", "render") -load(":pip_repository.bzl", pip_parse = "pip_repository") - -def _multi_pip_parse_impl(rctx): - rules_python = rctx.attr._rules_python_workspace.repo_name - load_statements = [] - install_deps_calls = [] - process_requirements_calls = [] - for python_version, pypi_repository in rctx.attr.pip_parses.items(): - sanitized_python_version = python_version.replace(".", "_") - load_statement = """\ -load( - "@{pypi_repository}//:requirements.bzl", - _{sanitized_python_version}_install_deps = "install_deps", - _{sanitized_python_version}_all_requirements = "all_requirements", -)""".format( - pypi_repository = pypi_repository, - sanitized_python_version = sanitized_python_version, - ) - load_statements.append(load_statement) - process_requirements_call = """\ -_process_requirements( - pkg_labels = _{sanitized_python_version}_all_requirements, - python_version = "{python_version}", - repo_prefix = "{pypi_repository}_", -)""".format( - pypi_repository = pypi_repository, - python_version = python_version, - sanitized_python_version = sanitized_python_version, - ) - process_requirements_calls.append(process_requirements_call) - install_deps_call = """ _{sanitized_python_version}_install_deps(**whl_library_kwargs)""".format( - sanitized_python_version = sanitized_python_version, - ) - install_deps_calls.append(install_deps_call) - - # NOTE @aignas 2023-10-31: I am not sure it is possible to render aliases - # for all of the packages using the `render_pkg_aliases` function because - # we need to know what the list of packages for each version is and then - # we would be creating directories for each. - macro_tmpl = "@%s_{}//:{}" % rctx.attr.name - - requirements_bzl = """\ -# Generated by python/pip.bzl - -load("@{rules_python}//python:pip.bzl", "whl_library_alias", "pip_utils") -{load_statements} - -_wheel_names = [] -_version_map = dict() -def _process_requirements(pkg_labels, python_version, repo_prefix): - for pkg_label in pkg_labels: - wheel_name = Label(pkg_label).package - if not wheel_name: - # We are dealing with the cases where we don't have aliases. - workspace_name = Label(pkg_label).repo_name - wheel_name = workspace_name[len(repo_prefix):] - - _wheel_names.append(wheel_name) - if not wheel_name in _version_map: - _version_map[wheel_name] = dict() - _version_map[wheel_name][python_version] = repo_prefix - -{process_requirements_calls} - -def requirement(name): - return "{macro_tmpl}".format(pip_utils.normalize_name(name), "pkg") - -def whl_requirement(name): - return "{macro_tmpl}".format(pip_utils.normalize_name(name), "whl") - -def data_requirement(name): - return "{macro_tmpl}".format(pip_utils.normalize_name(name), "data") - -def dist_info_requirement(name): - return "{macro_tmpl}".format(pip_utils.normalize_name(name), "dist_info") - -def install_deps(**whl_library_kwargs): -{install_deps_calls} - for wheel_name in _wheel_names: - whl_library_alias( - name = "{name}_" + wheel_name, - wheel_name = wheel_name, - default_version = "{default_version}", - minor_mapping = {minor_mapping}, - version_map = _version_map[wheel_name], - ) -""".format( - name = rctx.attr.name, - install_deps_calls = "\n".join(install_deps_calls), - load_statements = "\n".join(load_statements), - macro_tmpl = macro_tmpl, - process_requirements_calls = "\n".join(process_requirements_calls), - rules_python = rules_python, - default_version = rctx.attr.default_version, - minor_mapping = render.indent(render.dict(rctx.attr.minor_mapping)).lstrip(), - ) - rctx.file("requirements.bzl", requirements_bzl) - rctx.file("BUILD.bazel", "exports_files(['requirements.bzl'])") - -_multi_pip_parse = repository_rule( - _multi_pip_parse_impl, - attrs = { - "default_version": attr.string(), - "minor_mapping": attr.string_dict(), - "pip_parses": attr.string_dict(), - "_rules_python_workspace": attr.label(default = Label("//:WORKSPACE")), - }, -) - -def multi_pip_parse(name, default_version, python_versions, python_interpreter_target, requirements_lock, minor_mapping, **kwargs): - """NOT INTENDED FOR DIRECT USE! - - This is intended to be used by the multi_pip_parse implementation in the template of the - multi_toolchain_aliases repository rule. - - Args: - name: the name of the multi_pip_parse repository. - default_version: {type}`str` the default Python version. - python_versions: {type}`list[str]` all Python toolchain versions currently registered. - python_interpreter_target: {type}`dict[str, Label]` a dictionary which keys are Python versions and values are resolved host interpreters. - requirements_lock: {type}`dict[str, Label]` a dictionary which keys are Python versions and values are locked requirements files. - minor_mapping: {type}`dict[str, str]` mapping between `X.Y` to `X.Y.Z` format. - **kwargs: extra arguments passed to all wrapped pip_parse. - - Returns: - The internal implementation of multi_pip_parse repository rule. - """ - pip_parses = {} - for python_version in python_versions: - if not python_version in python_interpreter_target: - fail("Missing python_interpreter_target for Python version %s in '%s'" % (python_version, name)) - if not python_version in requirements_lock: - fail("Missing requirements_lock for Python version %s in '%s'" % (python_version, name)) - - pip_parse_name = name + "_" + python_version.replace(".", "_") - pip_parse( - name = pip_parse_name, - python_interpreter_target = python_interpreter_target[python_version], - requirements_lock = requirements_lock[python_version], - **kwargs - ) - pip_parses[python_version] = pip_parse_name - - return _multi_pip_parse( - name = name, - default_version = default_version, - pip_parses = pip_parses, - minor_mapping = minor_mapping, - ) diff --git a/python/private/pypi/whl_library_alias.bzl b/python/private/pypi/whl_library_alias.bzl deleted file mode 100644 index 66c3504d90..0000000000 --- a/python/private/pypi/whl_library_alias.bzl +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright 2024 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. - -"""whl_library aliases for multi_pip_parse.""" - -load("//python/private:full_version.bzl", "full_version") -load(":render_pkg_aliases.bzl", "NO_MATCH_ERROR_MESSAGE_TEMPLATE") - -def _whl_library_alias_impl(rctx): - rules_python = rctx.attr._rules_python_workspace.repo_name - if rctx.attr.default_version: - default_repo_prefix = rctx.attr.version_map[rctx.attr.default_version] - else: - default_repo_prefix = None - version_map = rctx.attr.version_map.items() - build_content = ["# Generated by python/pip.bzl"] - for alias_name in ["pkg", "whl", "data", "dist_info"]: - build_content.append(_whl_library_render_alias_target( - alias_name = alias_name, - default_repo_prefix = default_repo_prefix, - minor_mapping = rctx.attr.minor_mapping, - rules_python = rules_python, - version_map = version_map, - wheel_name = rctx.attr.wheel_name, - )) - rctx.file("BUILD.bazel", "\n".join(build_content)) - -def _whl_library_render_alias_target( - *, - alias_name, - default_repo_prefix, - minor_mapping, - rules_python, - version_map, - wheel_name): - alias = ["""\ -alias( - name = "{alias_name}", - actual = select({{""".format(alias_name = alias_name)] - for [python_version, repo_prefix] in version_map: - alias.append("""\ - "@{rules_python}//python/config_settings:is_python_{full_python_version}": "{actual}",""".format( - full_python_version = full_version(version = python_version, minor_mapping = minor_mapping), - actual = "@{repo_prefix}{wheel_name}//:{alias_name}".format( - repo_prefix = repo_prefix, - wheel_name = wheel_name, - alias_name = alias_name, - ), - rules_python = rules_python, - )) - if default_repo_prefix: - default_actual = "@{repo_prefix}{wheel_name}//:{alias_name}".format( - repo_prefix = default_repo_prefix, - wheel_name = wheel_name, - alias_name = alias_name, - ) - alias.append(' "//conditions:default": "{default_actual}",'.format( - default_actual = default_actual, - )) - - alias.append(" },") # Close select expression condition dict - if not default_repo_prefix: - supported_versions = sorted([python_version for python_version, _ in version_map]) - alias.append(' no_match_error="""{}""",'.format( - NO_MATCH_ERROR_MESSAGE_TEMPLATE.format( - supported_versions = ", ".join(supported_versions), - rules_python = rules_python, - ), - )) - alias.append(" ),") # Close the select expression - alias.append(' visibility = ["//visibility:public"],') - alias.append(")") # Close the alias() expression - return "\n".join(alias) - -whl_library_alias = repository_rule( - _whl_library_alias_impl, - attrs = { - "default_version": attr.string( - mandatory = False, - doc = "Optional Python version in major.minor format, e.g. '3.10'." + - "The Python version of the wheel to use when the versions " + - "from `version_map` don't match. This allows the default " + - "(version unaware) rules to match and select a wheel. If " + - "not specified, then the default rules won't be able to " + - "resolve a wheel and an error will occur.", - ), - "minor_mapping": attr.string_dict(mandatory = True), - "version_map": attr.string_dict(mandatory = True), - "wheel_name": attr.string(mandatory = True), - "_rules_python_workspace": attr.label(default = Label("//:WORKSPACE")), - }, -) diff --git a/python/private/python_register_multi_toolchains.bzl b/python/private/python_register_multi_toolchains.bzl deleted file mode 100644 index 1c7138d0e9..0000000000 --- a/python/private/python_register_multi_toolchains.bzl +++ /dev/null @@ -1,79 +0,0 @@ -# Copyright 2024 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. - -"""This file contains repository rules and macros to support toolchain registration. -""" - -# NOTE @aignas 2024-10-07: we are not importing this from `@pythons_hub` because of this -# leading to a backwards incompatible change - the `//python:repositories.bzl` is loading -# from this file and it will cause a circular import loop and an error. If the users in -# WORKSPACE world want to override the `minor_mapping`, they will have to pass an argument. -load("//python:versions.bzl", "MINOR_MAPPING") -load(":python_register_toolchains.bzl", "python_register_toolchains") -load(":toolchains_repo.bzl", "multi_toolchain_aliases") - -def python_register_multi_toolchains( - name, - python_versions, - default_version = None, - minor_mapping = None, - **kwargs): - """Convenience macro for registering multiple Python toolchains. - - Args: - name: {type}`str` base name for each name in {obj}`python_register_toolchains` call. - python_versions: {type}`list[str]` the Python versions. - default_version: {type}`str` the default Python version. If not set, - the first version in python_versions is used. - minor_mapping: {type}`dict[str, str]` mapping between `X.Y` to `X.Y.Z` - format. Defaults to the value in `//python:versions.bzl`. - **kwargs: passed to each {obj}`python_register_toolchains` call. - """ - if len(python_versions) == 0: - fail("python_versions must not be empty") - - minor_mapping = minor_mapping or MINOR_MAPPING - - if not default_version: - default_version = python_versions.pop(0) - for python_version in python_versions: - if python_version == default_version: - # We register the default version lastly so that it's not picked first when --platforms - # is set with a constraint during toolchain resolution. This is due to the fact that - # Bazel will match the unconstrained toolchain if we register it before the constrained - # ones. - continue - python_register_toolchains( - name = name + "_" + python_version.replace(".", "_"), - python_version = python_version, - set_python_version_constraint = True, - minor_mapping = minor_mapping, - **kwargs - ) - python_register_toolchains( - name = name + "_" + default_version.replace(".", "_"), - python_version = default_version, - set_python_version_constraint = False, - minor_mapping = minor_mapping, - **kwargs - ) - - multi_toolchain_aliases( - name = name, - python_versions = { - python_version: name + "_" + python_version.replace(".", "_") - for python_version in (python_versions + [default_version]) - }, - minor_mapping = minor_mapping, - ) diff --git a/python/private/toolchains_repo.bzl b/python/private/toolchains_repo.bzl index 1338e9c569..0d0b0a6bc4 100644 --- a/python/private/toolchains_repo.bzl +++ b/python/private/toolchains_repo.bzl @@ -167,22 +167,6 @@ def compile_pip_requirements(**kwargs): return _compile_pip_requirements(**_with_deprecation(kwargs, name = "compile_pip_requirements")) """.lstrip() -_MULTI_TOOLCHAIN_ALIASES_PIP_TEMPLATE = """ -# Generated by python/private/toolchains_repo.bzl - -load("@@{rules_python}//python:pip.bzl", "pip_parse", _multi_pip_parse = "multi_pip_parse") - -def multi_pip_parse(name, requirements_lock, **kwargs): - return _multi_pip_parse( - name = name, - python_versions = {python_versions}, - requirements_lock = requirements_lock, - minor_mapping = {minor_mapping}, - **kwargs - ) - -""".lstrip() - def python_toolchain_build_file_content( prefix, python_version, @@ -469,12 +453,6 @@ def _multi_toolchain_aliases_impl(rctx): )) rctx.file("{}/BUILD.bazel".format(python_version), "") - pip_bzl = _MULTI_TOOLCHAIN_ALIASES_PIP_TEMPLATE.format( - python_versions = rctx.attr.python_versions.keys(), - minor_mapping = render.indent(render.dict(rctx.attr.minor_mapping), indent = " " * 8).lstrip(), - rules_python = rules_python, - ) - rctx.file("pip.bzl", content = pip_bzl) rctx.file("BUILD.bazel", "") multi_toolchain_aliases = repository_rule( diff --git a/python/repositories.bzl b/python/repositories.bzl index 768b5874d5..4580575ecf 100644 --- a/python/repositories.bzl +++ b/python/repositories.bzl @@ -21,12 +21,10 @@ load( _is_standalone_interpreter = "is_standalone_interpreter", ) load("//python/private:py_repositories.bzl", _py_repositories = "py_repositories") -load("//python/private:python_register_multi_toolchains.bzl", _python_register_multi_toolchains = "python_register_multi_toolchains") load("//python/private:python_register_toolchains.bzl", _python_register_toolchains = "python_register_toolchains") load("//python/private:python_repository.bzl", _python_repository = "python_repository") py_repositories = _py_repositories -python_register_multi_toolchains = _python_register_multi_toolchains python_register_toolchains = _python_register_toolchains # Useful for documentation, but is not intended for public use - the python diff --git a/tests/integration/BUILD.bazel b/tests/integration/BUILD.bazel index 9295cbb22f..d945ca80e6 100644 --- a/tests/integration/BUILD.bazel +++ b/tests/integration/BUILD.bazel @@ -18,20 +18,6 @@ load(":integration_test.bzl", "rules_python_integration_test") licenses(["notice"]) -_WORKSPACE_FLAGS = [ - "--noenable_bzlmod", - "--enable_workspace", -] - -default_test_runner( - name = "workspace_test_runner", - bazel_cmds = [ - "info {}".format(" ".join(_WORKSPACE_FLAGS)), - "test {} //...".format(" ".join(_WORKSPACE_FLAGS)), - ], - visibility = ["//visibility:public"], -) - default_test_runner( name = "test_runner", visibility = ["//visibility:public"], @@ -55,12 +41,6 @@ rules_python_integration_test( name = "compile_pip_requirements_test", ) -rules_python_integration_test( - name = "compile_pip_requirements_workspace_test", - bzlmod = False, - workspace_path = "compile_pip_requirements", -) - rules_python_integration_test( name = "local_toolchains_test", env = { @@ -68,15 +48,6 @@ rules_python_integration_test( }, ) -rules_python_integration_test( - name = "local_toolchains_workspace_test", - bzlmod = False, - env = { - "RULES_PYTHON_BZLMOD_DEBUG": "1", - }, - workspace_path = "local_toolchains", -) - rules_python_integration_test( name = "pip_parse_test", ) @@ -85,22 +56,10 @@ rules_python_integration_test( name = "pip_parse_isolated_test", ) -rules_python_integration_test( - name = "pip_parse_workspace_test", - bzlmod = False, - workspace_path = "pip_parse", -) - rules_python_integration_test( name = "py_cc_toolchain_registered_test", ) -rules_python_integration_test( - name = "py_cc_toolchain_registered_workspace_test", - bzlmod = False, - workspace_path = "py_cc_toolchain_registered", -) - rules_python_integration_test( name = "custom_commands_test", py_main = "custom_commands_test.py", @@ -108,6 +67,10 @@ rules_python_integration_test( rules_python_integration_test( name = "toolchain_target_settings_test", + bazel_versions = [ + "8.5.1", + "9.1.0", + ], py_main = "toolchain_target_settings_test.py", ) diff --git a/tests/integration/compile_pip_requirements/WORKSPACE b/tests/integration/compile_pip_requirements/WORKSPACE index 0eeab2067c..e69de29bb2 100644 --- a/tests/integration/compile_pip_requirements/WORKSPACE +++ b/tests/integration/compile_pip_requirements/WORKSPACE @@ -1,13 +0,0 @@ -local_repository( - name = "rules_python", - path = "../../..", -) - -load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains") - -py_repositories() - -python_register_toolchains( - name = "python39", - python_version = "3.9", -) diff --git a/tests/integration/compile_pip_requirements/WORKSPACE.bzlmod b/tests/integration/compile_pip_requirements/WORKSPACE.bzlmod deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/integration/compile_pip_requirements_test_from_external_repo/WORKSPACE b/tests/integration/compile_pip_requirements_test_from_external_repo/WORKSPACE index 7834000854..e69de29bb2 100644 --- a/tests/integration/compile_pip_requirements_test_from_external_repo/WORKSPACE +++ b/tests/integration/compile_pip_requirements_test_from_external_repo/WORKSPACE @@ -1,31 +0,0 @@ -local_repository( - name = "rules_python", - path = "../../..", -) - -load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains") - -py_repositories() - -python_register_toolchains( - name = "python39", - python_version = "3.9", -) - -load("@rules_python//python:pip.bzl", "pip_parse") - -local_repository( - name = "compile_pip_requirements", - path = "../compile_pip_requirements", -) - -pip_parse( - name = "pypi", - python_interpreter_target = "@python39_host//:python", - requirements_lock = "@compile_pip_requirements//:requirements_lock.txt", -) - -load("@pypi//:requirements.bzl", "install_deps") - -# Initialize repositories for all packages in requirements_lock.txt. -install_deps() diff --git a/tests/integration/compile_pip_requirements_test_from_external_repo/WORKSPACE.bzlmod b/tests/integration/compile_pip_requirements_test_from_external_repo/WORKSPACE.bzlmod deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/integration/custom_commands/WORKSPACE b/tests/integration/custom_commands/WORKSPACE index de908549c0..e69de29bb2 100644 --- a/tests/integration/custom_commands/WORKSPACE +++ b/tests/integration/custom_commands/WORKSPACE @@ -1,13 +0,0 @@ -local_repository( - name = "rules_python", - path = "../../..", -) - -load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains") - -py_repositories() - -python_register_toolchains( - name = "python_3_11", - python_version = "3.11", -) diff --git a/tests/integration/custom_commands/WORKSPACE.bzlmod b/tests/integration/custom_commands/WORKSPACE.bzlmod deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/integration/integration_test.bzl b/tests/integration/integration_test.bzl index 771976d037..eaa6ffacfa 100644 --- a/tests/integration/integration_test.bzl +++ b/tests/integration/integration_test.bzl @@ -21,7 +21,7 @@ load( ) load("//python:py_test.bzl", "py_test") -def _test_runner(*, name, bazel_version, py_main, bzlmod): +def _test_runner(*, name, bazel_version, py_main): if py_main: test_runner = "{}_bazel_{}_py_runner".format(name, bazel_version) py_test( @@ -35,15 +35,11 @@ def _test_runner(*, name, bazel_version, py_main, bzlmod): ) return test_runner - if bzlmod: - return "//tests/integration:test_runner" - else: - return "//tests/integration:workspace_test_runner" + return "//tests/integration:test_runner" def rules_python_integration_test( name, workspace_path = None, - bzlmod = True, tags = None, py_main = None, bazel_versions = None, @@ -54,8 +50,6 @@ def rules_python_integration_test( name: Name of the test. This gets appended by the bazel version. workspace_path: The directory name. Defaults to `name` without the `_test` suffix. - bzlmod: bool, default True. If true, run with bzlmod enabled, otherwise - disable bzlmod. tags: Test tags. py_main: Optional `.py` file to run tests using. When specified, a python based test runner is used, and this source file is the main @@ -91,7 +85,6 @@ def rules_python_integration_test( name = name, bazel_version = bazel_version, py_main = py_main, - bzlmod = bzlmod, ) bazel_integration_test( name = "{}_bazel_{}".format(name, bazel_version), diff --git a/tests/integration/local_toolchains/WORKSPACE b/tests/integration/local_toolchains/WORKSPACE index 159f16deab..e69de29bb2 100644 --- a/tests/integration/local_toolchains/WORKSPACE +++ b/tests/integration/local_toolchains/WORKSPACE @@ -1,76 +0,0 @@ -workspace( - name = "module_under_test", -) - -local_repository( - name = "rules_python", - path = "../../..", -) - -load("@rules_python//python:repositories.bzl", "py_repositories") - -py_repositories( - transition_settings = [ - "@//:py", - ], -) - -load("@rules_python//python/local_toolchains:repos.bzl", "local_runtime_repo", "local_runtime_toolchains_repo") - -# Step 1: Define the python runtime. -local_runtime_repo( - name = "local_python3", - interpreter_path = "python3", - on_failure = "fail", - # or interpreter_path = "C:\\path\\to\\python.exe" -) - -load("//:pbs_archive.bzl", "pbs_archive") - -pbs_archive( - name = "pbs_runtime", - sha256 = { - "linux": "0a01bad99fd4a165a11335c29eb43015dfdb8bd5ba8e305538ebb54f3bf3146d", - "mac os x": "4fb42ffc8aad2a42ca7646715b8926bc6b2e0d31f13d2fec25943dc236a6fd60", - "windows": "005cb2abf4cfa4aaa48fb10ce4e33fe4335ea4d1f55202dbe4e20c852e45e0f9", - }, - urls = { - "linux": "https://github.com/astral-sh/python-build-standalone/releases/download/20250918/cpython-3.13.7+20250918-x86_64-unknown-linux-gnu-install_only.tar.gz", - "mac os x": "https://github.com/astral-sh/python-build-standalone/releases/download/20250918/cpython-3.13.7+20250918-x86_64-apple-darwin-install_only.tar.gz", - "windows server 2022": "https://github.com/astral-sh/python-build-standalone/releases/download/20250918/cpython-3.13.7+20250918-x86_64-pc-windows-msvc-install_only.tar.gz", - }, -) - -local_runtime_repo( - name = "repo_python3", - interpreter_target = "@pbs_runtime//:python/bin/python3", - on_failure = "fail", -) - -# Step 2: Create toolchains for the runtimes -local_runtime_toolchains_repo( - name = "local_toolchains", - runtimes = [ - "local_python3", - "repo_python3", - ], - target_compatible_with = { - "local_python3": [ - "HOST_CONSTRAINTS", - ], - "repo_python3": [ - "HOST_CONSTRAINTS", - ], - }, - target_settings = { - "local_python3": [ - "@//:is_py_local", - ], - "repo_python3": [ - "@//:is_py_repo", - ], - }, -) - -# Step 3: Register the toolchains -register_toolchains("@local_toolchains//:all") diff --git a/tests/integration/pip_parse/WORKSPACE b/tests/integration/pip_parse/WORKSPACE index e31655dbe4..e69de29bb2 100644 --- a/tests/integration/pip_parse/WORKSPACE +++ b/tests/integration/pip_parse/WORKSPACE @@ -1,25 +0,0 @@ -local_repository( - name = "rules_python", - path = "../../..", -) - -load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains") - -py_repositories() - -python_register_toolchains( - name = "python39", - python_version = "3.9", -) - -load("@rules_python//python:pip.bzl", "pip_parse") - -pip_parse( - name = "pip_empty", - python_interpreter_target = "@python39_host//:python", - requirements_lock = "//empty:requirements.txt", -) - -load("@pip_empty//:requirements.bzl", "install_deps") - -install_deps() diff --git a/tests/integration/pip_parse/WORKSPACE.bzlmod b/tests/integration/pip_parse/WORKSPACE.bzlmod deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/integration/py_cc_toolchain_registered/WORKSPACE b/tests/integration/py_cc_toolchain_registered/WORKSPACE index de908549c0..e69de29bb2 100644 --- a/tests/integration/py_cc_toolchain_registered/WORKSPACE +++ b/tests/integration/py_cc_toolchain_registered/WORKSPACE @@ -1,13 +0,0 @@ -local_repository( - name = "rules_python", - path = "../../..", -) - -load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains") - -py_repositories() - -python_register_toolchains( - name = "python_3_11", - python_version = "3.11", -) diff --git a/tests/integration/toolchain_target_settings/WORKSPACE b/tests/integration/toolchain_target_settings/WORKSPACE index d7be0c96c7..e69de29bb2 100644 --- a/tests/integration/toolchain_target_settings/WORKSPACE +++ b/tests/integration/toolchain_target_settings/WORKSPACE @@ -1 +0,0 @@ -# Intentionally blank; bzlmod is used. diff --git a/tests/integration/toolchain_target_settings/WORKSPACE.bzlmod b/tests/integration/toolchain_target_settings/WORKSPACE.bzlmod deleted file mode 100644 index e69de29bb2..0000000000