Skip to content

Commit 4c7a12a

Browse files
committed
Merge branch 'main' of https://github.com/bazelbuild/rules_python into chore.deps
2 parents 6691075 + 772b1cc commit 4c7a12a

File tree

6 files changed

+126
-100
lines changed

6 files changed

+126
-100
lines changed

.bazelci/presubmit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ tasks:
301301
integration_test_bzlmod_build_file_generation_debian:
302302
<<: *reusable_build_test_all
303303
<<: *coverage_targets_example_bzlmod_build_file_generation
304-
name: "examples/bzlmod_build_file_integration: Debian"
304+
name: "examples/bzlmod_build_file_generation: Debian"
305305
working_directory: examples/bzlmod_build_file_generation
306306
platform: debian11
307307
integration_test_bzlmod_build_file_generation_macos:

CHANGELOG.md

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,27 @@ A brief description of the categories of changes:
2727

2828
{#v0-0-0-changed}
2929
### Changed
30+
* Nothing yet
31+
32+
{#v0-0-0-fixed}
33+
### Fixed
34+
* Nothing yet
35+
36+
{#v0-0-0-added}
37+
### Added
38+
* Nothing yet
39+
40+
{#v0-0-0-removed}
41+
### Removed
42+
* Nothing yet
43+
44+
{#v0-38-0}
45+
## [0.38.0] - 2024-11-08
46+
47+
[0.38.0]: https://github.com/bazelbuild/rules_python/releases/tag/0.38.0
48+
49+
{#v0-38-0-changed}
50+
### Changed
3051
* (deps) (WORKSPACE only) rules_cc 0.0.13 and protobuf 27.0 is now the default
3152
version used; this for Bazel 8+ support (previously version was rules_cc 0.0.9
3253
and no protobuf version specified)
@@ -41,16 +62,13 @@ A brief description of the categories of changes:
4162
and now `pyyaml` and `PyYAML` will both work.
4263
* (bzlmod) `pip.parse` spoke repository naming will be changed in an upcoming
4364
release in places where the users specify different package versions per
44-
platform in the same hub repository. The naming of the spoke repos is considered
45-
an implementation detail and we advise the users to use the `hub` repository
46-
directly to avoid such breakage in the future. If `rules_python` is missing
47-
features to allow one to do that, please raise tickets.
65+
platform in the same hub repository. The naming of the spoke repos is
66+
considered an implementation detail and we advise the users to use the `hub`
67+
repository directly and make use of {bzl:obj}`pip.parse.extra_hub_aliases`
68+
feature added in this release.
4869

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

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

84-
{#v0-0-0-removed}
85-
### Removed
86-
* Nothing yet
104+
{#v0-37-2}
105+
## [0.37.2] - 2024-10-27
106+
107+
[0.37.2]: https://github.com/bazelbuild/rules_python/releases/tag/0.37.2
108+
109+
{#v0-37-2-fixed}
110+
### Fixed
111+
* (bzlmod) Generate `config_setting` values for all available toolchains instead
112+
of only the registered toolchains, which restores the previous behaviour that
113+
`bzlmod` users would have observed.
87114

88115
{#v0-37-1}
89116
## [0.37.1] - 2024-10-22

MODULE.bazel

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,27 @@ bazel_dep(name = "rules_bazel_integration_test", version = "0.26.1", dev_depende
7878
bazel_dep(name = "rules_testing", version = "0.6.0", dev_dependency = True)
7979
bazel_dep(name = "rules_shell", version = "0.3.0", dev_dependency = True)
8080
bazel_dep(name = "rules_multirun", version = "0.9.0", dev_dependency = True)
81+
bazel_dep(name = "bazel_ci_rules", version = "1.0.0", dev_dependency = True)
8182

8283
# Extra gazelle plugin deps so that WORKSPACE.bzlmod can continue including it for e2e tests.
8384
# We use `WORKSPACE.bzlmod` because it is impossible to have dev-only local overrides.
8485
bazel_dep(name = "rules_go", version = "0.41.0", dev_dependency = True, repo_name = "io_bazel_rules_go")
8586
bazel_dep(name = "gazelle", version = "0.33.0", dev_dependency = True, repo_name = "bazel_gazelle")
87+
bazel_dep(name = "rules_python_gazelle_plugin", version = "0", dev_dependency = True)
88+
89+
internal_dev_deps = use_extension(
90+
"//python/private:internal_dev_deps.bzl",
91+
"internal_dev_deps",
92+
dev_dependency = True,
93+
)
94+
use_repo(internal_dev_deps, "buildkite_config", "wheel_for_testing")
95+
96+
# Add gazelle plugin so that we can run the gazelle example as an e2e integration
97+
# test and include the distribution files.
98+
local_path_override(
99+
module_name = "rules_python_gazelle_plugin",
100+
path = "gazelle",
101+
)
86102

87103
dev_python = use_extension(
88104
"//python/extensions:python.bzl",

WORKSPACE.bzlmod

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +0,0 @@
1-
# Copyright 2024 The Bazel Authors. All rights reserved.
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
14-
15-
# This file contains everything that is needed when using bzlmod
16-
workspace(name = "rules_python")
17-
18-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
19-
20-
# Used for Bazel CI
21-
http_archive(
22-
name = "bazelci_rules",
23-
sha256 = "eca21884e6f66a88c358e580fd67a6b148d30ab57b1680f62a96c00f9bc6a07e",
24-
strip_prefix = "bazelci_rules-1.0.0",
25-
url = "https://github.com/bazelbuild/continuous-integration/releases/download/rules-1.0.0/bazelci_rules-1.0.0.tar.gz",
26-
)
27-
28-
load("@bazelci_rules//:rbe_repo.bzl", "rbe_preconfig")
29-
30-
# Creates a default toolchain config for RBE.
31-
# Use this as is if you are using the rbe_ubuntu16_04 container,
32-
# otherwise refer to RBE docs.
33-
rbe_preconfig(
34-
name = "buildkite_config",
35-
toolchain = "ubuntu1804-bazel-java11",
36-
)
37-
38-
# Add gazelle plugin so that we can run the gazelle example as an e2e integration
39-
# test and include the distribution files.
40-
local_repository(
41-
name = "rules_python_gazelle_plugin",
42-
path = "gazelle",
43-
)
44-
45-
#####################
46-
47-
# This wheel is purely here to validate the wheel extraction code. It's not
48-
# intended for anything else.
49-
http_file(
50-
name = "wheel_for_testing",
51-
downloaded_file_path = "numpy-1.25.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
52-
sha256 = "0d60fbae8e0019865fc4784745814cff1c421df5afee233db6d88ab4f14655a2",
53-
urls = [
54-
"https://files.pythonhosted.org/packages/50/67/3e966d99a07d60a21a21d7ec016e9e4c2642a86fea251ec68677daf71d4d/numpy-1.25.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
55-
],
56-
)
57-
58-
# rules_proto expects //external:python_headers to point at the python headers.
59-
bind(
60-
name = "python_headers",
61-
actual = "//python/cc:current_py_cc_headers",
62-
)

python/private/BUILD.bazel

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ bzl_library(
5656
srcs = ["attributes.bzl"],
5757
deps = [
5858
":common_bzl",
59+
":enum_bzl",
60+
":flags_bzl",
61+
":py_info_bzl",
5962
":py_internal_bzl",
63+
":reexports_bzl",
64+
":rules_cc_srcs_bzl",
6065
":semantics_bzl",
61-
"//python/private:enum_bzl",
62-
"//python/private:flags_bzl",
63-
"//python/private:py_info_bzl",
64-
"//python/private:reexports_bzl",
65-
"//python/private:rules_cc_srcs_bzl",
6666
"@bazel_skylib//rules:common_settings",
6767
],
6868
)
@@ -109,10 +109,10 @@ bzl_library(
109109
deps = [
110110
":attributes_bzl",
111111
":common_bzl",
112+
":py_cc_link_params_info_bzl",
112113
":py_internal_bzl",
113-
"//python/private:py_cc_link_params_info_bzl",
114-
"//python/private:py_interpreter_program_bzl",
115-
"//python/private:toolchain_types_bzl",
114+
":py_interpreter_program_bzl",
115+
":toolchain_types_bzl",
116116
"@bazel_skylib//lib:paths",
117117
],
118118
)
@@ -122,11 +122,11 @@ bzl_library(
122122
srcs = ["common.bzl"],
123123
deps = [
124124
":cc_helper_bzl",
125+
":py_info_bzl",
125126
":py_internal_bzl",
127+
":reexports_bzl",
128+
":rules_cc_srcs_bzl",
126129
":semantics_bzl",
127-
"//python/private:py_info_bzl",
128-
"//python/private:reexports_bzl",
129-
"//python/private:rules_cc_srcs_bzl",
130130
],
131131
)
132132

@@ -350,8 +350,8 @@ bzl_library(
350350
":common_bzl",
351351
":py_executable_bzl",
352352
":py_internal_bzl",
353+
":py_runtime_info_bzl",
353354
":semantics_bzl",
354-
"//python/private:py_runtime_info_bzl",
355355
],
356356
)
357357

@@ -362,14 +362,14 @@ bzl_library(
362362
":attributes_bzl",
363363
":cc_helper_bzl",
364364
":common_bzl",
365+
":flags_bzl",
366+
":py_cc_link_params_info_bzl",
367+
":py_executable_info_bzl",
368+
":py_info_bzl",
365369
":py_internal_bzl",
366-
"//python/private:flags_bzl",
367-
"//python/private:py_cc_link_params_info_bzl",
368-
"//python/private:py_executable_info_bzl",
369-
"//python/private:py_info_bzl",
370-
"//python/private:py_runtime_info_bzl",
371-
"//python/private:rules_cc_srcs_bzl",
372-
"//python/private:toolchain_types_bzl",
370+
":py_runtime_info_bzl",
371+
":rules_cc_srcs_bzl",
372+
":toolchain_types_bzl",
373373
"@bazel_skylib//lib:dicts",
374374
"@bazel_skylib//lib:structs",
375375
"@bazel_skylib//rules:common_settings",
@@ -410,10 +410,10 @@ bzl_library(
410410
deps = [
411411
":attributes_bzl",
412412
":common_bzl",
413+
":flags_bzl",
414+
":py_cc_link_params_info_bzl",
413415
":py_internal_bzl",
414-
"//python/private:flags_bzl",
415-
"//python/private:py_cc_link_params_info_bzl",
416-
"//python/private:toolchain_types_bzl",
416+
":toolchain_types_bzl",
417417
"@bazel_skylib//lib:dicts",
418418
"@bazel_skylib//rules:common_settings",
419419
],
@@ -473,13 +473,14 @@ bzl_library(
473473
name = "py_runtime_rule_bzl",
474474
srcs = ["py_runtime_rule.bzl"],
475475
deps = [
476+
":attributes_bzl",
477+
":py_internal_bzl",
476478
":py_runtime_info_bzl",
477479
":reexports_bzl",
478480
":util_bzl",
479-
"//python/private:attributes_bzl",
480-
"//python/private:py_internal_bzl",
481481
"@bazel_skylib//lib:dicts",
482482
"@bazel_skylib//lib:paths",
483+
"@bazel_skylib//rules:common_settings",
483484
],
484485
)
485486

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Copyright 2024 The Bazel Authors. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
"""Module extension for internal dev_dependency=True setup."""
15+
16+
load("@bazel_ci_rules//:rbe_repo.bzl", "rbe_preconfig")
17+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
18+
19+
def _internal_dev_deps_impl(mctx):
20+
_ = mctx # @unused
21+
22+
# This wheel is purely here to validate the wheel extraction code. It's not
23+
# intended for anything else.
24+
http_file(
25+
name = "wheel_for_testing",
26+
downloaded_file_path = "numpy-1.25.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
27+
sha256 = "0d60fbae8e0019865fc4784745814cff1c421df5afee233db6d88ab4f14655a2",
28+
urls = [
29+
"https://files.pythonhosted.org/packages/50/67/3e966d99a07d60a21a21d7ec016e9e4c2642a86fea251ec68677daf71d4d/numpy-1.25.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
30+
],
31+
)
32+
33+
# Creates a default toolchain config for RBE.
34+
# Use this as is if you are using the rbe_ubuntu16_04 container,
35+
# otherwise refer to RBE docs.
36+
rbe_preconfig(
37+
name = "buildkite_config",
38+
toolchain = "ubuntu1804-bazel-java11",
39+
)
40+
41+
internal_dev_deps = module_extension(
42+
implementation = _internal_dev_deps_impl,
43+
doc = "This extension creates internal rules_python dev dependencies.",
44+
)

0 commit comments

Comments
 (0)