Skip to content

Commit 8eb4ac9

Browse files
authored
Merge branch 'main' into feat/do-not-merge-check
2 parents b209154 + 2ed714f commit 8eb4ac9

File tree

9 files changed

+378
-31
lines changed

9 files changed

+378
-31
lines changed

CHANGELOG.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ END_UNRELEASED_TEMPLATE
7070
### Removed
7171
* Nothing removed.
7272

73-
{#1-6-0}
73+
{#v1-6-0}
7474
## [1.6.0] - 2025-08-23
7575

7676
[1.6.0]: https://github.com/bazel-contrib/rules_python/releases/tag/1.6.0
7777

78-
{#1-6-0-changed}
78+
{#v1-6-0-changed}
7979
### Changed
8080
* (gazelle) update minimum gazelle version to 0.36.0 - may cause BUILD file changes
8181
* (gazelle) update minimum rules_go version to 0.55.1
@@ -107,7 +107,7 @@ END_UNRELEASED_TEMPLATE
107107

108108
[20250808]: https://github.com/astral-sh/python-build-standalone/releases/tag/20250808
109109

110-
{#1-6-0-fixed}
110+
{#v1-6-0-fixed}
111111
### Fixed
112112
* (toolchains) `local_runtime_repo` now respects changes to the `DEVELOPER_DIR` and `XCODE_VERSION`
113113
repo env vars, fixing stale cache issues on macOS with system (i.e. Xcode-supplied) Python
@@ -154,7 +154,7 @@ END_UNRELEASED_TEMPLATE
154154
([#2797](https://github.com/bazel-contrib/rules_python/issues/2797)).
155155
* (py_wheel) Add directories in deterministic order.
156156

157-
{#1-6-0-added}
157+
{#v1-6-0-added}
158158
### Added
159159
* (repl) Default stub now has tab completion, where `readline` support is available,
160160
see ([#3114](https://github.com/bazel-contrib/rules_python/pull/3114)).
@@ -182,14 +182,16 @@ END_UNRELEASED_TEMPLATE
182182
dep is not added to the {obj}`py_test` target.
183183
* (gazelle) New directive `gazelle:python_generate_proto`; when `true`,
184184
Gazelle generates `py_proto_library` rules for `proto_library`. `false` by default.
185+
* Note: Users must manually configure their Gazelle target to support the
186+
proto language.
185187
* (gazelle) New directive `gazelle:python_proto_naming_convention`; controls
186188
naming of `py_proto_library` rules.
187189

188-
{#1-6-0-removed}
190+
{#v1-6-0-removed}
189191
### Removed
190192
* Nothing removed.
191193

192-
{#1-5-3}
194+
{#v1-5-3}
193195
## [1.5.3] - 2025-08-11
194196

195197
[1.5.3]: https://github.com/bazel-contrib/rules_python/releases/tag/1.5.3
@@ -199,7 +201,7 @@ END_UNRELEASED_TEMPLATE
199201
before attempting to watch it, fixing issues on macOS with system Python
200202
([#3043](https://github.com/bazel-contrib/rules_python/issues/3043)).
201203

202-
{#1-5-2}
204+
{#v1-5-2}
203205
## [1.5.2] - 2025-08-11
204206

205207
[1.5.2]: https://github.com/bazel-contrib/rules_python/releases/tag/1.5.2
@@ -217,7 +219,7 @@ END_UNRELEASED_TEMPLATE
217219
* (core) builds work again on `7.x` `WORKSPACE` configurations
218220
([#3119](https://github.com/bazel-contrib/rules_python/issues/3119)).
219221

220-
{#1-5-1}
222+
{#v1-5-1}
221223
## [1.5.1] - 2025-07-06
222224

223225
[1.5.1]: https://github.com/bazel-contrib/rules_python/releases/tag/1.5.1
@@ -229,12 +231,12 @@ END_UNRELEASED_TEMPLATE
229231
by default again)
230232
([#3038](https://github.com/bazel-contrib/rules_python/issues/3038)).
231233

232-
{#1-5-0}
234+
{#v1-5-0}
233235
## [1.5.0] - 2025-06-11
234236

235237
[1.5.0]: https://github.com/bazel-contrib/rules_python/releases/tag/1.5.0
236238

237-
{#1-5-0-changed}
239+
{#v1-5-0-changed}
238240
### Changed
239241

240242
* (toolchain) Bundled toolchain version updates:
@@ -255,7 +257,7 @@ END_UNRELEASED_TEMPLATE
255257
* (deps) Updated setuptools to 78.1.1 to patch CVE-2025-47273. This effectively makes
256258
Python 3.9 the minimum supported version for using `pip_parse`.
257259

258-
{#1-5-0-fixed}
260+
{#v1-5-0-fixed}
259261
### Fixed
260262

261263
* (rules) PyInfo provider is now advertised by py_test, py_binary, and py_library;
@@ -284,7 +286,7 @@ END_UNRELEASED_TEMPLATE
284286
* (toolchains) The hermetic toolchains now correctly statically advertise the
285287
`releaselevel` and `serial` for pre-release hermetic toolchains ({gh-issue}`2837`).
286288

287-
{#1-5-0-added}
289+
{#v1-5-0-added}
288290
### Added
289291
* Repo utilities `execute_unchecked`, `execute_checked`, and `execute_checked_stdout` now
290292
support `log_stdout` and `log_stderr` keyword arg booleans. When these are `True`
@@ -307,11 +309,11 @@ END_UNRELEASED_TEMPLATE
307309
security patches.
308310
* (toolchains): 3.14.0b2 has been added as a preview.
309311

310-
{#1-5-0-removed}
312+
{#v1-5-0-removed}
311313
### Removed
312314
* Nothing removed.
313315

314-
{#1-4-2}
316+
{#v1-4-2}
315317
## [1.4.2] - 2025-08-13
316318

317319
[1.4.2]: https://github.com/bazel-contrib/rules_python/releases/tag/1.4.2
@@ -321,23 +323,23 @@ END_UNRELEASED_TEMPLATE
321323
before attempting to watch it, fixing issues on macOS with system Python
322324
([#3043](https://github.com/bazel-contrib/rules_python/issues/3043)).
323325

324-
{#1-4-1}
326+
{#v1-4-1}
325327
## [1.4.1] - 2025-05-08
326328

327329
[1.4.1]: https://github.com/bazel-contrib/rules_python/releases/tag/1.4.1
328330

329-
{#1-4-1-fixed}
331+
{#v1-4-1-fixed}
330332
### Fixed
331333
* (pypi) Fix a typo not allowing users to benefit from using the downloader when the hashes in the
332334
requirements file are not present. Fixes
333335
[#2863](https://github.com/bazel-contrib/rules_python/issues/2863).
334336

335-
{#1-4-0}
337+
{#v1-4-0}
336338
## [1.4.0] - 2025-04-19
337339

338340
[1.4.0]: https://github.com/bazel-contrib/rules_python/releases/tag/1.4.0
339341

340-
{#1-4-0-changed}
342+
{#v1-4-0-changed}
341343
### Changed
342344
* (toolchain) The `exec` configuration toolchain now has the forwarded
343345
`exec_interpreter` now also forwards the `ToolchainInfo` provider. This is
@@ -368,7 +370,7 @@ END_UNRELEASED_TEMPLATE
368370

369371
[20250317]: https://github.com/astral-sh/python-build-standalone/releases/tag/20250317
370372

371-
{#1-4-0-fixed}
373+
{#v1-4-0-fixed}
372374
### Fixed
373375
* (pypi) Platform specific extras are now correctly handled when using
374376
universal lock files with environment markers. Fixes [#2690](https://github.com/bazel-contrib/rules_python/pull/2690).
@@ -394,7 +396,7 @@ END_UNRELEASED_TEMPLATE
394396
{obj}`compile_pip_requirements` rule.
395397
See [#2819](https://github.com/bazel-contrib/rules_python/pull/2819).
396398

397-
{#1-4-0-added}
399+
{#v1-4-0-added}
398400
### Added
399401
* (pypi) From now on `sha256` values in the `requirements.txt` is no longer
400402
mandatory when enabling {attr}`pip.parse.experimental_index_url` feature.
@@ -425,7 +427,7 @@ END_UNRELEASED_TEMPLATE
425427
locations equivalents of `$(PYTHON2)` and `$(PYTHON3) respectively.
426428

427429

428-
{#1-4-0-removed}
430+
{#v1-4-0-removed}
429431
### Removed
430432
* Nothing removed.
431433

RELEASING.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,10 @@ These are the steps for a regularly scheduled release from HEAD.
1313
### Steps
1414

1515
1. [Determine the next semantic version number](#determining-semantic-version).
16-
1. Update CHANGELOG.md: replace the `v0-0-0` and `0.0.0` with `X.Y.0`.
17-
```
18-
awk -v version=X.Y.0 'BEGIN { hv=version; gsub(/\./, "-", hv) } /END_UNRELEASED_TEMPLATE/ { found_marker = 1 } found_marker { gsub(/v0-0-0/, hv, $0); gsub(/Unreleased/, "[" version "] - " strftime("%Y-%m-%d"), $0); gsub(/0.0.0/, version, $0); } { print } ' CHANGELOG.md > /tmp/changelog && cp /tmp/changelog CHANGELOG.md
19-
```
20-
1. Replace `VERSION_NEXT_*` strings with `X.Y.0`.
21-
```
22-
grep -l --exclude=CONTRIBUTING.md --exclude=RELEASING.md --exclude-dir=.* VERSION_NEXT_ -r \
23-
| xargs sed -i -e 's/VERSION_NEXT_FEATURE/X.Y.0/' -e 's/VERSION_NEXT_PATCH/X.Y.0/'
16+
1. Update the changelog and replace the version placeholders by running the
17+
release tool:
18+
```shell
19+
bazel run //tools/private/release -- X.Y.Z
2420
```
2521
1. Send these changes for review and get them merged.
2622
1. Create a branch for the new release, named `release/X.Y`

gazelle/docs/directives.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,30 @@ the configured name for the `@protobuf` / `@com_google_protobuf` repo in your
636636
`MODULE.bazel`, and otherwise falling back to `@com_google_protobuf` for
637637
compatibility with `WORKSPACE`.
638638

639+
:::{note}
640+
In order to use this, you must manually configure Gazelle to target multiple
641+
languages. Place this in your root `BUILD.bazel` file:
642+
643+
```
644+
load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_binary")
645+
646+
gazelle_binary(
647+
name = "gazelle_multilang",
648+
languages = [
649+
"@bazel_gazelle//language/proto",
650+
# The python gazelle plugin must be listed _after_ the proto language.
651+
"@rules_python_gazelle_plugin//python",
652+
],
653+
)
654+
655+
gazelle(
656+
name = "gazelle",
657+
gazelle = "//:gazelle_multilang",
658+
)
659+
```
660+
:::
661+
662+
639663
For example, in a package with `# gazelle:python_generate_proto true` and a
640664
`foo.proto`, if you have both the proto extension and the Python extension
641665
loaded into Gazelle, you'll get something like:

gazelle/python/BUILD.bazel

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ gazelle_test(
7070
name = "python_test",
7171
srcs = ["python_test.go"],
7272
data = [
73+
":_gazelle_binary_with_proto",
7374
":gazelle_binary",
7475
],
7576
test_dirs = glob(
@@ -90,11 +91,18 @@ gazelle_test(
9091

9192
gazelle_binary(
9293
name = "gazelle_binary",
94+
languages = [":python"],
95+
visibility = ["//visibility:public"],
96+
)
97+
98+
# Only used by testing
99+
gazelle_binary(
100+
name = "_gazelle_binary_with_proto",
93101
languages = [
94102
"@bazel_gazelle//language/proto",
95103
":python",
96104
],
97-
visibility = ["//visibility:public"],
105+
visibility = ["//visibility:private"],
98106
)
99107

100108
filegroup(

gazelle/python/python_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import (
3838
const (
3939
extensionDir = "python" + string(os.PathSeparator)
4040
testDataPath = extensionDir + "testdata" + string(os.PathSeparator)
41-
gazelleBinaryName = "gazelle_binary"
41+
gazelleBinaryName = "_gazelle_binary_with_proto"
4242
)
4343

4444
func TestGazelleBinary(t *testing.T) {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
load("@rules_python//python:defs.bzl", "py_test")
2+
3+
py_test(
4+
name = "release_test",
5+
srcs = ["release_test.py"],
6+
deps = ["//tools/private/release"],
7+
)

0 commit comments

Comments
 (0)