Skip to content

Commit 5eae601

Browse files
committed
Merge remote-tracking branch 'origin/main' into HEAD
2 parents 77a75d7 + 0a3704d commit 5eae601

File tree

18 files changed

+129
-429
lines changed

18 files changed

+129
-429
lines changed

CHANGELOG.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,30 @@ Unreleased changes template.
5252

5353
{#v0-0-0-changed}
5454
### Changed
55+
* Nothing changed.
56+
57+
{#v0-0-0-fixed}
58+
### Fixed
59+
* Nothing fixed.
60+
61+
{#v0-0-0-added}
62+
### Added
63+
* Nothing added.
64+
65+
{#v0-0-0-removed}
66+
### Removed
67+
* Nothing removed.
68+
69+
{#v1-2-0}
70+
## Unreleased
71+
72+
[1.2.0]: https://github.com/bazelbuild/rules_python/releases/tag/1.2.0
73+
74+
{#v1-2-0-changed}
75+
### Changed
76+
* (rules) `py_proto_library` is deprecated in favour of the
77+
implementation in https://github.com/protocolbuffers/protobuf. It will be
78+
removed in the future release.
5579
* (pypi) {obj}`pip.override` will now be ignored instead of raising an error,
5680
fixes [#2550](https://github.com/bazelbuild/rules_python/issues/2550).
5781
* (rules) deprecation warnings for deprecated symbols have been turned off by
@@ -60,7 +84,7 @@ Unreleased changes template.
6084
* (pypi) Downgraded versions of packages: `pip` from `24.3.2` to `24.0.0` and
6185
`packaging` from `24.2` to `24.0`.
6286

63-
{#v0-0-0-fixed}
87+
{#v1-2-0-fixed}
6488
### Fixed
6589
* (rules) `python_zip_file` output with `--bootstrap_impl=script` works again
6690
([#2596](https://github.com/bazelbuild/rules_python/issues/2596)).
@@ -82,11 +106,11 @@ Unreleased changes template.
82106
build time (they will be created at runtime instead).
83107
(Fixes [#2489](https://github.com/bazelbuild/rules_python/issues/2489))
84108

85-
{#v0-0-0-added}
109+
{#v1-2-0-added}
86110
### Added
87111
* Nothing added.
88112

89-
{#v0-0-0-removed}
113+
{#v1-2-0-removed}
90114
### Removed
91115
* Nothing removed.
92116

CONTRIBUTING.md

Lines changed: 15 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@
33
We'd love to accept your patches and contributions to this project. There are
44
just a few small guidelines you need to follow.
55

6+
## Contributor License Agreement
7+
8+
First, the most important step: signing the Contributor License Agreement. We
9+
cannot look at any of your code unless one is signed.
10+
11+
Contributions to this project must be accompanied by a Contributor License
12+
Agreement. You (or your employer) retain the copyright to your contribution,
13+
this simply gives us permission to use and redistribute your contributions as
14+
part of the project. Head over to <https://cla.developers.google.com/> to see
15+
your current agreements on file or to sign a new one.
16+
17+
You generally only need to submit a CLA once, so if you've already submitted one
18+
(even if it was for a different project), you probably don't need to do it
19+
again.
20+
621
## Getting started
722

823
Before we can work on the code, we need to get a copy of it and setup some
@@ -65,15 +80,6 @@ and setup. Subsequent runs will be faster, but there are many tests, and some of
6580
them are slow. If you're working on a particular area of code, you can run just
6681
the tests in those directories instead, which can speed up your edit-run cycle.
6782

68-
## Updating tool dependencies
69-
70-
It's suggested to routinely update the tool versions within our repo - some of the
71-
tools are using requirement files compiled by `uv` and others use other means. In order
72-
to have everything self-documented, we have a special target -
73-
`//private:requirements.update`, which uses `rules_multirun` to run in sequence all
74-
of the requirement updating scripts in one go. This can be done once per release as
75-
we prepare for releases.
76-
7783
## Formatting
7884

7985
Starlark files should be formatted by
@@ -99,18 +105,6 @@ $ buildifier --lint=fix --warnings=native-py -warnings=all WORKSPACE
99105

100106
Replace the argument "WORKSPACE" with the file that you are linting.
101107

102-
## Contributor License Agreement
103-
104-
Contributions to this project must be accompanied by a Contributor License
105-
Agreement. You (or your employer) retain the copyright to your contribution,
106-
this simply gives us permission to use and redistribute your contributions as
107-
part of the project. Head over to <https://cla.developers.google.com/> to see
108-
your current agreements on file or to sign a new one.
109-
110-
You generally only need to submit a CLA once, so if you've already submitted one
111-
(even if it was for a different project), you probably don't need to do it
112-
again.
113-
114108
## Code reviews
115109

116110
All submissions, including submissions by project members, require review. We
@@ -198,31 +192,6 @@ merged:
198192
`compile_pip_requirements` update target, which is usually in the same directory.
199193
e.g. `bazel run //docs:requirements.update`
200194

201-
## Core rules
202-
203-
The bulk of this repo is owned and maintained by the Bazel Python community.
204-
However, since the core Python rules (`py_binary` and friends) are still
205-
bundled with Bazel itself, the Bazel team retains ownership of their stubs in
206-
this repository. This will be the case at least until the Python rules are
207-
fully migrated to Starlark code.
208-
209-
Practically, this means that a Bazel team member should approve any PR
210-
concerning the core Python logic. This includes everything under the `python/`
211-
directory except for `pip.bzl` and `requirements.txt`.
212-
213-
Issues should be triaged as follows:
214-
215-
- Anything concerning the way Bazel implements the core Python rules should be
216-
filed under [bazelbuild/bazel](https://github.com/bazelbuild/bazel), using
217-
the label `team-Rules-python`.
218-
219-
- If the issue specifically concerns the rules_python stubs, it should be filed
220-
here in this repository and use the label `core-rules`.
221-
222-
- Anything else, such as feature requests not related to existing core rules
223-
functionality, should also be filed in this repository but without the
224-
`core-rules` label.
225-
226195
(breaking-changes)=
227196
## Breaking Changes
228197

DEVELOPING.md

Lines changed: 8 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -17,63 +17,11 @@
1717
# bazel run //tools/private/update_deps:update_coverage_deps 7.6.1
1818
```
1919

20-
## Releasing
21-
22-
Start from a clean checkout at `main`.
23-
24-
Before running through the release it's good to run the build and the tests locally, and make sure CI is passing. You can
25-
also test-drive the commit in an existing Bazel workspace to sanity check functionality.
26-
27-
### Releasing from HEAD
28-
29-
#### Steps
30-
1. [Determine the next semantic version number](#determining-semantic-version)
31-
1. Create a tag and push, e.g. `git tag 0.5.0 upstream/main && git push upstream --tags`
32-
NOTE: Pushing the tag will trigger release automation.
33-
1. Watch the release automation run on https://github.com/bazelbuild/rules_python/actions
34-
1. Add missing information to the release notes. The automatic release note
35-
generation only includes commits associated with issues.
36-
37-
#### Determining Semantic Version
38-
39-
**rules_python** is currently using [Zero-based versioning](https://0ver.org/) and thus backwards-incompatible API
40-
changes still come under the minor-version digit. So releases with API changes and new features bump the minor, and
41-
those with only bug fixes and other minor changes bump the patch digit.
42-
43-
To find if there were any features added or incompatible changes made, review
44-
the commit history. This can be done using github by going to the url:
45-
`https://github.com/bazelbuild/rules_python/compare/<VERSION>...main`.
46-
47-
### Patch release with cherry picks
48-
49-
If a patch release from head would contain changes that aren't appropriate for
50-
a patch release, then the patch release needs to be based on the original
51-
release tag and the patch changes cherry-picked into it.
52-
53-
In this example, release `0.37.0` is being patched to create release `0.37.1`.
54-
The fix being included is commit `deadbeef`.
55-
56-
1. `git checkout -b release/0.37 0.37.0`
57-
1. `git push upstream release/0.37`
58-
1. `git cherry-pick -x deadbeef`
59-
1. Fix merge conflicts, if any.
60-
1. `git cherry-pick --continue` (if applicable)
61-
1. `git push upstream`
62-
63-
If multiple commits need to be applied, repeat the `git cherry-pick` step for
64-
each.
65-
66-
Once the release branch is in the desired state, use `git tag` to tag it, as
67-
done with a release from head. Release automation will do the rest.
68-
69-
#### After release creation in Github
70-
71-
1. Announce the release in the #python channel in the Bazel slack (bazelbuild.slack.com).
72-
73-
## Secrets
74-
75-
### PyPI user rules-python
76-
77-
Part of the release process uploads packages to PyPI as the user `rules-python`.
78-
This account is managed by Google; contact [email protected] if
79-
something needs to be done with the PyPI account.
20+
## Updating tool dependencies
21+
22+
It's suggested to routinely update the tool versions within our repo - some of the
23+
tools are using requirement files compiled by `uv` and others use other means. In order
24+
to have everything self-documented, we have a special target -
25+
`//private:requirements.update`, which uses `rules_multirun` to run in sequence all
26+
of the requirement updating scripts in one go. This can be done once per release as
27+
we prepare for releases.

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ bazel_dep(name = "rules_cc", version = "0.0.16")
1010
bazel_dep(name = "platforms", version = "0.0.4")
1111

1212
# Those are loaded only when using py_proto_library
13-
bazel_dep(name = "rules_proto", version = "7.0.2")
13+
# Use py_proto_library directly from protobuf repository
1414
bazel_dep(name = "protobuf", version = "29.0-rc2", repo_name = "com_google_protobuf")
1515

1616
internal_deps = use_extension("//python/private:internal_deps.bzl", "internal_deps")

RELEASING.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Releasing
2+
3+
Start from a clean checkout at `main`.
4+
5+
Before running through the release it's good to run the build and the tests locally, and make sure CI is passing. You can
6+
also test-drive the commit in an existing Bazel workspace to sanity check functionality.
7+
8+
## Releasing from HEAD
9+
10+
### Steps
11+
1. [Determine the next semantic version number](#determining-semantic-version).
12+
1. Update CHANGELOG.md: replace the `v0-0-0` and `0.0.0` with `X.Y.0`.
13+
1. Replace `VERSION_NEXT_*` strings with `X.Y.0`.
14+
1. Send these changes for review and get them merged.
15+
1. Create a branch for the new release, named `release/X.Y`
16+
```
17+
git branch --no-track release/X.Y upstream/main && git push upstream release/X.Y
18+
```
19+
1. Create a tag and push:
20+
```
21+
git tag X.Y.0 upstream/release/X.Y && git push upstream --tags
22+
```
23+
**NOTE:** Pushing the tag will trigger release automation.
24+
1. Release automation will create a GitHub release and BCR pull request.
25+
26+
### Determining Semantic Version
27+
28+
**rules_python** uses [semantic version](https://semver.org), so releases with
29+
API changes and new features bump the minor, and those with only bug fixes and
30+
other minor changes bump the patch digit.
31+
32+
To find if there were any features added or incompatible changes made, review
33+
[CHANGELOG.md](CHANGELOG.md) and the commit history. This can be done using
34+
github by going to the url:
35+
`https://github.com/bazelbuild/rules_python/compare/<VERSION>...main`.
36+
37+
## Patch release with cherry picks
38+
39+
If a patch release from head would contain changes that aren't appropriate for
40+
a patch release, then the patch release needs to be based on the original
41+
release tag and the patch changes cherry-picked into it.
42+
43+
In this example, release `0.37.0` is being patched to create release `0.37.1`.
44+
The fix being included is commit `deadbeef`.
45+
46+
1. `git checkout release/0.37`
47+
1. `git cherry-pick -x deadbeef`
48+
1. Fix merge conflicts, if any.
49+
1. `git cherry-pick --continue` (if applicable)
50+
1. `git push upstream`
51+
52+
If multiple commits need to be applied, repeat the `git cherry-pick` step for
53+
each.
54+
55+
Once the release branch is in the desired state, use `git tag` to tag it, as
56+
done with a release from head. Release automation will do the rest.
57+
58+
### After release creation in Github
59+
60+
1. Announce the release in the #python channel in the Bazel slack (bazelbuild.slack.com).
61+
62+
## Secrets
63+
64+
### PyPI user rules-python
65+
66+
Part of the release process uploads packages to PyPI as the user `rules-python`.
67+
This account is managed by Google; contact [email protected] if
68+
something needs to be done with the PyPI account.

WORKSPACE

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,3 @@ http_file(
166166
"https://files.pythonhosted.org/packages/50/67/3e966d99a07d60a21a21d7ec016e9e4c2642a86fea251ec68677daf71d4d/numpy-1.25.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
167167
],
168168
)
169-
170-
# rules_proto expects //external:python_headers to point at the python headers.
171-
bind(
172-
name = "python_headers",
173-
actual = "//python/cc:current_py_cc_headers",
174-
)

docs/api/rules_python/python/config_settings/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,6 @@ Values:
279279
is created.
280280
:::
281281

282-
:::{versionadded} VERSION_NEXT_PATCH
282+
:::{versionadded} 1.2.0
283283
:::
284284
::::

docs/environment-variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ being cleaned up by the OS.
4444
If not set, then a temporary directory will be created and deleted upon program
4545
exit.
4646

47-
:::{versionadded} VERSION_NEXT_PATCH
47+
:::{versionadded} 1.2.0
4848
:::
4949
::::
5050

examples/bzlmod/MODULE.bazel

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ local_path_override(
1212
path = "../..",
1313
)
1414

15-
# (py_proto_library specific) We are using rules_proto to define rules_proto targets to be consumed by py_proto_library.
16-
bazel_dep(name = "rules_proto", version = "6.0.0-rc1")
17-
1815
# (py_proto_library specific) Add the protobuf library for well-known types (e.g. `Any`, `Timestamp`, etc)
1916
bazel_dep(name = "protobuf", version = "27.0", repo_name = "com_google_protobuf")
2017

examples/bzlmod/py_proto_library/BUILD.bazel

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ py_test(
2020

2121
# Regression test for https://github.com/bazelbuild/rules_python/issues/2515
2222
#
23-
# This test failed before https://github.com/bazelbuild/rules_python/pull/2516
23+
# This test fails before protobuf 30.0 release
2424
# when ran with --legacy_external_runfiles=False (default in Bazel 8.0.0).
2525
native_test(
2626
name = "external_import_test",
2727
src = "@foo_external//:py_binary_with_proto",
28+
tags = ["manual"], # TODO: reenable when com_google_protobuf is upgraded
2829
# Incompatible with Windows: native_test wrapping a py_binary doesn't work
2930
# on Windows.
3031
target_compatible_with = select({

0 commit comments

Comments
 (0)