Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…o chore.deps
  • Loading branch information
rickeylev committed Nov 8, 2024
2 parents 6691075 + 772b1cc commit 4c7a12a
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 100 deletions.
2 changes: 1 addition & 1 deletion .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ tasks:
integration_test_bzlmod_build_file_generation_debian:
<<: *reusable_build_test_all
<<: *coverage_targets_example_bzlmod_build_file_generation
name: "examples/bzlmod_build_file_integration: Debian"
name: "examples/bzlmod_build_file_generation: Debian"
working_directory: examples/bzlmod_build_file_generation
platform: debian11
integration_test_bzlmod_build_file_generation_macos:
Expand Down
53 changes: 40 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,27 @@ A brief description of the categories of changes:

{#v0-0-0-changed}
### Changed
* Nothing yet

{#v0-0-0-fixed}
### Fixed
* Nothing yet

{#v0-0-0-added}
### Added
* Nothing yet

{#v0-0-0-removed}
### Removed
* Nothing yet

{#v0-38-0}
## [0.38.0] - 2024-11-08

[0.38.0]: https://github.com/bazelbuild/rules_python/releases/tag/0.38.0

{#v0-38-0-changed}
### Changed
* (deps) (WORKSPACE only) rules_cc 0.0.13 and protobuf 27.0 is now the default
version used; this for Bazel 8+ support (previously version was rules_cc 0.0.9
and no protobuf version specified)
Expand All @@ -41,16 +62,13 @@ A brief description of the categories of changes:
and now `pyyaml` and `PyYAML` will both work.
* (bzlmod) `pip.parse` spoke repository naming will be changed in an upcoming
release in places where the users specify different package versions per
platform in the same hub repository. The naming of the spoke repos is considered
an implementation detail and we advise the users to use the `hub` repository
directly to avoid such breakage in the future. If `rules_python` is missing
features to allow one to do that, please raise tickets.
platform in the same hub repository. The naming of the spoke repos is
considered an implementation detail and we advise the users to use the `hub`
repository directly and make use of {bzl:obj}`pip.parse.extra_hub_aliases`
feature added in this release.

{#v0-0-0-fixed}
{#v0-38-0-fixed}
### Fixed
* (bzlmod) Generate `config_setting` values for all available toolchains instead
of only the registered toolchains, which restores the previous behaviour that
`bzlmod` users would have observed.
* (pypi) (Bazel 7.4+) Allow spaces in filenames included in `whl_library`s
([617](https://github.com/bazelbuild/rules_python/issues/617)).
* (pypi) When {attr}`pip.parse.experimental_index_url` is set, we need to still
Expand All @@ -59,12 +77,14 @@ A brief description of the categories of changes:
which fixes usage of the said wheels using standard package managers.
* (bzlmod) The extension evaluation has been adjusted to always generate the
same lock file irrespective if `experimental_index_url` is set by any module
or not. Fixes
or not. To opt into this behavior, set
{bzl:obj}`pip.parse.parse_all_requirements_files`, which will become the
default in future releases leading up to `1.0.0`. Fixes
[#2268](https://github.com/bazelbuild/rules_python/issues/2268). A known
issue is that it may break `bazel query` and in these use cases it is
advisable to use `cquery` or switch to `download_only = True`

{#v0-0-0-added}
{#v0-38-0-added}
### Added
* (publish) The requirements file for the `twine` publishing rules have been
updated to have a new convention: `requirements_darwin.txt`,
Expand All @@ -81,9 +101,16 @@ A brief description of the categories of changes:
users setting {bzl:obj}`pip.parse.experimental_index_url`, but now users have
more options whilst we continue to work on stabilizing the experimental feature.

{#v0-0-0-removed}
### Removed
* Nothing yet
{#v0-37-2}
## [0.37.2] - 2024-10-27

[0.37.2]: https://github.com/bazelbuild/rules_python/releases/tag/0.37.2

{#v0-37-2-fixed}
### Fixed
* (bzlmod) Generate `config_setting` values for all available toolchains instead
of only the registered toolchains, which restores the previous behaviour that
`bzlmod` users would have observed.

{#v0-37-1}
## [0.37.1] - 2024-10-22
Expand Down
16 changes: 16 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,27 @@ bazel_dep(name = "rules_bazel_integration_test", version = "0.26.1", dev_depende
bazel_dep(name = "rules_testing", version = "0.6.0", dev_dependency = True)
bazel_dep(name = "rules_shell", version = "0.3.0", dev_dependency = True)
bazel_dep(name = "rules_multirun", version = "0.9.0", dev_dependency = True)
bazel_dep(name = "bazel_ci_rules", version = "1.0.0", dev_dependency = True)

# Extra gazelle plugin deps so that WORKSPACE.bzlmod can continue including it for e2e tests.
# We use `WORKSPACE.bzlmod` because it is impossible to have dev-only local overrides.
bazel_dep(name = "rules_go", version = "0.41.0", dev_dependency = True, repo_name = "io_bazel_rules_go")
bazel_dep(name = "gazelle", version = "0.33.0", dev_dependency = True, repo_name = "bazel_gazelle")
bazel_dep(name = "rules_python_gazelle_plugin", version = "0", dev_dependency = True)

internal_dev_deps = use_extension(
"//python/private:internal_dev_deps.bzl",
"internal_dev_deps",
dev_dependency = True,
)
use_repo(internal_dev_deps, "buildkite_config", "wheel_for_testing")

# Add gazelle plugin so that we can run the gazelle example as an e2e integration
# test and include the distribution files.
local_path_override(
module_name = "rules_python_gazelle_plugin",
path = "gazelle",
)

dev_python = use_extension(
"//python/extensions:python.bzl",
Expand Down
62 changes: 0 additions & 62 deletions WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
@@ -1,62 +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 everything that is needed when using bzlmod
workspace(name = "rules_python")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")

# 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 = "ubuntu1804-bazel-java11",
)

# Add gazelle plugin so that we can run the gazelle example as an e2e integration
# test and include the distribution files.
local_repository(
name = "rules_python_gazelle_plugin",
path = "gazelle",
)

#####################

# This wheel is purely here to validate the wheel extraction code. It's not
# intended for anything else.
http_file(
name = "wheel_for_testing",
downloaded_file_path = "numpy-1.25.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
sha256 = "0d60fbae8e0019865fc4784745814cff1c421df5afee233db6d88ab4f14655a2",
urls = [
"https://files.pythonhosted.org/packages/50/67/3e966d99a07d60a21a21d7ec016e9e4c2642a86fea251ec68677daf71d4d/numpy-1.25.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
],
)

# rules_proto expects //external:python_headers to point at the python headers.
bind(
name = "python_headers",
actual = "//python/cc:current_py_cc_headers",
)
49 changes: 25 additions & 24 deletions python/private/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ bzl_library(
srcs = ["attributes.bzl"],
deps = [
":common_bzl",
":enum_bzl",
":flags_bzl",
":py_info_bzl",
":py_internal_bzl",
":reexports_bzl",
":rules_cc_srcs_bzl",
":semantics_bzl",
"//python/private:enum_bzl",
"//python/private:flags_bzl",
"//python/private:py_info_bzl",
"//python/private:reexports_bzl",
"//python/private:rules_cc_srcs_bzl",
"@bazel_skylib//rules:common_settings",
],
)
Expand Down Expand Up @@ -109,10 +109,10 @@ bzl_library(
deps = [
":attributes_bzl",
":common_bzl",
":py_cc_link_params_info_bzl",
":py_internal_bzl",
"//python/private:py_cc_link_params_info_bzl",
"//python/private:py_interpreter_program_bzl",
"//python/private:toolchain_types_bzl",
":py_interpreter_program_bzl",
":toolchain_types_bzl",
"@bazel_skylib//lib:paths",
],
)
Expand All @@ -122,11 +122,11 @@ bzl_library(
srcs = ["common.bzl"],
deps = [
":cc_helper_bzl",
":py_info_bzl",
":py_internal_bzl",
":reexports_bzl",
":rules_cc_srcs_bzl",
":semantics_bzl",
"//python/private:py_info_bzl",
"//python/private:reexports_bzl",
"//python/private:rules_cc_srcs_bzl",
],
)

Expand Down Expand Up @@ -350,8 +350,8 @@ bzl_library(
":common_bzl",
":py_executable_bzl",
":py_internal_bzl",
":py_runtime_info_bzl",
":semantics_bzl",
"//python/private:py_runtime_info_bzl",
],
)

Expand All @@ -362,14 +362,14 @@ bzl_library(
":attributes_bzl",
":cc_helper_bzl",
":common_bzl",
":flags_bzl",
":py_cc_link_params_info_bzl",
":py_executable_info_bzl",
":py_info_bzl",
":py_internal_bzl",
"//python/private:flags_bzl",
"//python/private:py_cc_link_params_info_bzl",
"//python/private:py_executable_info_bzl",
"//python/private:py_info_bzl",
"//python/private:py_runtime_info_bzl",
"//python/private:rules_cc_srcs_bzl",
"//python/private:toolchain_types_bzl",
":py_runtime_info_bzl",
":rules_cc_srcs_bzl",
":toolchain_types_bzl",
"@bazel_skylib//lib:dicts",
"@bazel_skylib//lib:structs",
"@bazel_skylib//rules:common_settings",
Expand Down Expand Up @@ -410,10 +410,10 @@ bzl_library(
deps = [
":attributes_bzl",
":common_bzl",
":flags_bzl",
":py_cc_link_params_info_bzl",
":py_internal_bzl",
"//python/private:flags_bzl",
"//python/private:py_cc_link_params_info_bzl",
"//python/private:toolchain_types_bzl",
":toolchain_types_bzl",
"@bazel_skylib//lib:dicts",
"@bazel_skylib//rules:common_settings",
],
Expand Down Expand Up @@ -473,13 +473,14 @@ bzl_library(
name = "py_runtime_rule_bzl",
srcs = ["py_runtime_rule.bzl"],
deps = [
":attributes_bzl",
":py_internal_bzl",
":py_runtime_info_bzl",
":reexports_bzl",
":util_bzl",
"//python/private:attributes_bzl",
"//python/private:py_internal_bzl",
"@bazel_skylib//lib:dicts",
"@bazel_skylib//lib:paths",
"@bazel_skylib//rules:common_settings",
],
)

Expand Down
44 changes: 44 additions & 0 deletions python/private/internal_dev_deps.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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.
"""Module extension for internal dev_dependency=True setup."""

load("@bazel_ci_rules//:rbe_repo.bzl", "rbe_preconfig")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")

def _internal_dev_deps_impl(mctx):
_ = mctx # @unused

# This wheel is purely here to validate the wheel extraction code. It's not
# intended for anything else.
http_file(
name = "wheel_for_testing",
downloaded_file_path = "numpy-1.25.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
sha256 = "0d60fbae8e0019865fc4784745814cff1c421df5afee233db6d88ab4f14655a2",
urls = [
"https://files.pythonhosted.org/packages/50/67/3e966d99a07d60a21a21d7ec016e9e4c2642a86fea251ec68677daf71d4d/numpy-1.25.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
],
)

# 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 = "ubuntu1804-bazel-java11",
)

internal_dev_deps = module_extension(
implementation = _internal_dev_deps_impl,
doc = "This extension creates internal rules_python dev dependencies.",
)

0 comments on commit 4c7a12a

Please sign in to comment.