Skip to content

Commit

Permalink
Merge branch 'main' into feat/remove-requirement-marker-from-line
Browse files Browse the repository at this point in the history
  • Loading branch information
aignas authored Dec 11, 2024
2 parents 1ea7e6e + e823657 commit a837589
Show file tree
Hide file tree
Showing 19 changed files with 69 additions and 64 deletions.
23 changes: 10 additions & 13 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ buildifier:
# Use a specific version to avoid skew issues when new versions are released.
version: 6.1.0
warnings: "all"
# NOTE: Minimum supported version is 6.x for workspace; 7.x for bzlmod
# NOTE: Minimum supported version is 7.x
.minimum_supported_version: &minimum_supported_version
# For testing minimum supported version.
# NOTE: Keep in sync with //:version.bzl
bazel: 6.4.0
skip_in_bazel_downstream_pipeline: "Bazel 6 required"
bazel: 7.x
skip_in_bazel_downstream_pipeline: "Bazel 7 required"
.reusable_config: &reusable_config
build_targets:
- "--"
Expand All @@ -34,7 +34,6 @@ buildifier:
build_flags:
- "--keep_going"
- "--build_tag_filters=-integration-test"
- "--config=bazel7.x"
test_targets:
- "--"
- "..."
Expand All @@ -55,6 +54,7 @@ buildifier:
build_flags:
- "--noenable_bzlmod"
- "--enable_workspace"
bazel: 7.x
.common_bazelinbazel_config: &common_bazelinbazel_config
build_flags:
- "--build_tag_filters=integration-test"
Expand Down Expand Up @@ -159,7 +159,6 @@ tasks:
- "--enable_workspace"
- "--keep_going"
- "--build_tag_filters=-integration-test"
- "--config=bazel7.x"
test_targets:
- "--"
- "..."
Expand Down Expand Up @@ -187,7 +186,6 @@ tasks:
<<: *reusable_config
name: "RBE: Ubuntu, minimum Bazel"
platform: rbe_ubuntu2004
bazel: 7.x
build_flags:
# BazelCI sets --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1,
# which prevents cc toolchain autodetection from working correctly
Expand All @@ -206,6 +204,9 @@ tasks:
<<: *reusable_config
name: "RBE: Ubuntu"
platform: rbe_ubuntu2004
# TODO @aignas 2024-12-11: get the RBE working in CI for bazel 8.0
# See https://github.com/bazelbuild/rules_python/issues/2499
bazel: 7.x
test_flags:
- "--test_tag_filters=-integration-test,-acceptance-test"
- "--extra_toolchains=@buildkite_config//config:cc-toolchain"
Expand Down Expand Up @@ -412,25 +413,21 @@ tasks:
name: "examples/pip_parse_vendored: Ubuntu, workspace, minimum Bazel"
working_directory: examples/pip_parse_vendored
platform: ubuntu2004
integration_test_pip_parse_vendored_ubuntu_min_bzlmod:
<<: *minimum_supported_version
<<: *reusable_build_test_all
name: "examples/pip_parse_vendored: Ubuntu, bzlmod, minimum Bazel"
working_directory: examples/pip_parse_vendored
platform: ubuntu2004
bazel: 7.x
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: ubuntu2004
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
Expand Down
4 changes: 2 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ common --incompatible_disallow_struct_provider_syntax
# Windows makes use of runfiles for some rules
build --enable_runfiles

# Make Bazel 6 use bzlmod by default
# Make Bazel 7 use bzlmod by default
common --enable_bzlmod

# Additional config to use for readthedocs builds.
Expand All @@ -33,6 +33,6 @@ build:rtd --stamp
# Some bzl files contain repos only available under bzlmod
build:rtd --enable_bzlmod

common:bazel7.x --incompatible_python_disallow_native_rules
common --incompatible_python_disallow_native_rules

build --lockfile_mode=update
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.x
8.x
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ repos:
- id: update-deleted-packages
name: Update deleted packages
language: system
entry: bazel run @rules_bazel_integration_test//tools:update_deleted_packages
# 7.x is necessary until https://github.com/bazel-contrib/rules_bazel_integration_test/pull/414
# is merged and released
entry: env USE_BAZEL_VERSION=7.x bazel run @rules_bazel_integration_test//tools:update_deleted_packages
files: ^((examples|tests)/.*/(MODULE.bazel|WORKSPACE|WORKSPACE.bzlmod|BUILD.bazel)|.bazelrc)$
pass_filenames: false
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ Unreleased changes template.

{#v0-0-0-changed}
### Changed
* Nothing changed.
* Bazel 6 support is dropped and Bazel 7.4.1 is the minimum supported
version, per our Bazel support matrix. Earlier versions are not
tested by CI, so functionality cannot be guaranteed.

{#v0-0-0-fixed}
### Fixed
Expand All @@ -70,6 +72,11 @@ Unreleased changes template.
automatically includes corresponding stub packages for third-party libraries
that are present and used (e.g., `boto3``boto3-stubs`), improving
type-checking support.
* (pypi) Freethreaded packages are now fully supported in the
{obj}`experimental_index_url` usage or the regular `pip.parse` usage.
To select the free-threaded interpreter in the repo phase, please use
the documented [env](/environment-variables.html) variables.
Fixes [#2386](https://github.com/bazelbuild/rules_python/issues/2386).

{#v0-0-0-removed}
### Removed
Expand Down
8 changes: 4 additions & 4 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ bazel_binaries.local(
name = "self",
path = "tests/integration/bazel_from_env",
)
bazel_binaries.download(version = "6.4.0")
bazel_binaries.download(version = "7.4.0")
bazel_binaries.download(version = "7.4.1")
bazel_binaries.download(version = "8.0.0")

# For now, don't test with rolling, because that's Bazel 9, which is a ways
# away.
Expand All @@ -162,8 +162,8 @@ use_repo(
# These don't appear necessary, but are reported as direct dependencies
# that should be use_repo()'d, so we add them as requested
"bazel_binaries_bazelisk",
"build_bazel_bazel_6_4_0",
"build_bazel_bazel_7_4_0",
"build_bazel_bazel_7_4_1",
"build_bazel_bazel_8_0_0",
# "build_bazel_bazel_rolling",
"build_bazel_bazel_self",
)
Expand Down
15 changes: 15 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@ 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()
Expand Down
6 changes: 3 additions & 3 deletions examples/build_file_generation/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ build --enable_runfiles

# The bzlmod version of this example is in examples/bzlmod_build_file_generation
# Once WORKSPACE support is dropped, this example can be entirely deleted.
build --experimental_enable_bzlmod=false

common:bazel7.x --incompatible_python_disallow_native_rules
common --noenable_bzlmod
common --enable_workspace
common --incompatible_python_disallow_native_rules
2 changes: 1 addition & 1 deletion examples/pip_parse/.bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# https://docs.bazel.build/versions/main/best-practices.html#using-the-bazelrc-file
try-import %workspace%/user.bazelrc
common:bazel7.x --incompatible_python_disallow_native_rules
common --incompatible_python_disallow_native_rules
5 changes: 3 additions & 2 deletions examples/pip_parse_vendored/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ build --enable_runfiles

# Vendoring requirements.bzl files isn't necessary under bzlmod
# When workspace support is dropped, this example can be removed.
build --noexperimental_enable_bzlmod
common:bazel7.x --incompatible_python_disallow_native_rules
common --noenable_bzlmod
common --enable_workspace
common --incompatible_python_disallow_native_rules
5 changes: 3 additions & 2 deletions examples/pip_repository_annotations/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ try-import %workspace%/user.bazelrc

# This example is WORKSPACE specific. The equivalent functionality
# is in examples/bzlmod as the `whl_mods` feature.
build --experimental_enable_bzlmod=false --enable_workspace=true
common:bazel7.x --incompatible_python_disallow_native_rules
common --noenable_bzlmod
common --enable_workspace
common --incompatible_python_disallow_native_rules
5 changes: 3 additions & 2 deletions examples/py_proto_library/.bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# The equivalent bzlmod behavior is covered by examples/bzlmod/py_proto_library
common --noenable_bzlmod --enable_workspace=true
common:bazel7.x --incompatible_python_disallow_native_rules
common --noenable_bzlmod
common --enable_workspace
common --incompatible_python_disallow_native_rules
5 changes: 2 additions & 3 deletions internal_dev_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,9 @@ def rules_python_internal_deps():
http_archive(
name = "rules_java",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_java/releases/download/8.3.1/rules_java-8.3.1.tar.gz",
"https://github.com/bazelbuild/rules_java/releases/download/8.3.1/rules_java-8.3.1.tar.gz",
"https://github.com/bazelbuild/rules_java/releases/download/8.6.2/rules_java-8.6.2.tar.gz",
],
sha256 = "ee786b943e00da4fea7c233e70e5f5b8a01cc69b9341b3f49169f174fe0df1c5",
sha256 = "a64ab04616e76a448c2c2d8165d836f0d2fb0906200d0b7c7376f46dd62e59cc",
)

RULES_JVM_EXTERNAL_TAG = "5.2"
Expand Down
4 changes: 0 additions & 4 deletions internal_dev_setup.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ load("@cgrindel_bazel_starlib//:deps.bzl", "bazel_starlib_dependencies")
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
load("@rules_bazel_integration_test//bazel_integration_test:deps.bzl", "bazel_integration_test_rules_dependencies")
load("@rules_bazel_integration_test//bazel_integration_test:repo_defs.bzl", "bazel_binaries")
load("@rules_java//java:repositories.bzl", "rules_java_dependencies", "rules_java_toolchains")
load("@rules_shell//shell:repositories.bzl", "rules_shell_dependencies", "rules_shell_toolchains")
load("//:version.bzl", "SUPPORTED_BAZEL_VERSIONS")
load("//python:versions.bzl", "MINOR_MAPPING", "TOOL_VERSIONS")
Expand All @@ -47,9 +46,6 @@ def rules_python_internal_setup():

protobuf_deps()

rules_java_dependencies()
rules_java_toolchains()

bazel_integration_test_rules_dependencies()
bazel_starlib_dependencies()
bazel_binaries(versions = SUPPORTED_BAZEL_VERSIONS)
Expand Down
1 change: 1 addition & 0 deletions python/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ filegroup(
"//python/pip_install:distribution",
"//python/private:distribution",
"//python/runfiles:distribution",
"//python/runtime_env_toolchains:distribution",
"//python/uv:distribution",
],
visibility = ["//:__pkg__"],
Expand Down
2 changes: 1 addition & 1 deletion python/private/pypi/parse_simpleapi_html.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,4 @@ def _absolute_url(index_url, candidate):
return "{}/{}".format(index_url, last.strip("/"))

# relative path without up-references
return "{}/{}".format(index_url, candidate)
return "{}/{}".format(index_url.rstrip("/"), candidate)
6 changes: 6 additions & 0 deletions python/runtime_env_toolchains/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ load("//python/private:runtime_env_toolchain.bzl", "define_runtime_env_toolchain
package(default_visibility = ["//:__subpackages__"])

define_runtime_env_toolchain(name = "runtime_env_toolchain")

filegroup(
name = "distribution",
srcs = glob(["**"]),
visibility = ["//python:__pkg__"],
)
23 changes: 1 addition & 22 deletions tests/integration/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ load(":integration_test.bzl", "rules_python_integration_test")

licenses(["notice"])

_LEGACY_WORKSPACE_FLAGS = [
_WORKSPACE_FLAGS = [
"--noenable_bzlmod",
]

_WORKSPACE_FLAGS = _LEGACY_WORKSPACE_FLAGS + [
"--enable_workspace",
]

Expand All @@ -35,24 +32,6 @@ _GAZELLE_PLUGIN_FLAGS = [
"--override_module=rules_python_gazelle_plugin=../../../rules_python_gazelle_plugin",
]

default_test_runner(
name = "bazel_6_4_workspace_test_runner",
bazel_cmds = [
"info {}".format(" ".join(_LEGACY_WORKSPACE_FLAGS)),
"test {} //...".format(" ".join(_LEGACY_WORKSPACE_FLAGS)),
],
visibility = ["//visibility:public"],
)

default_test_runner(
name = "bazel_6_4_workspace_test_runner_gazelle_plugin",
bazel_cmds = [
"info {}".format(" ".join(_LEGACY_WORKSPACE_FLAGS + _WORKSPACE_GAZELLE_PLUGIN_FLAGS)),
"test {} //...".format(" ".join(_LEGACY_WORKSPACE_FLAGS + _WORKSPACE_GAZELLE_PLUGIN_FLAGS)),
],
visibility = ["//visibility:public"],
)

default_test_runner(
name = "workspace_test_runner",
bazel_cmds = [
Expand Down
4 changes: 2 additions & 2 deletions version.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
# against.
# This version should be updated together with the version of Bazel
# in .bazelversion.
BAZEL_VERSION = "7.x"
BAZEL_VERSION = "8.x"

# NOTE: Keep in sync with .bazelci/presubmit.yml
# This is the minimum supported bazel version, that we have some tests for.
MINIMUM_BAZEL_VERSION = "6.4.0"
MINIMUM_BAZEL_VERSION = "7.4.1"

# Versions of Bazel which users should be able to use.
# Ensures we don't break backwards-compatibility,
Expand Down

0 comments on commit a837589

Please sign in to comment.