xref: /aosp_15_r20/external/bazelbuild-rules_python/DEVELOPING.md (revision 60517a1edbc8ecf509223e9af94a7adec7d736b8)
1*60517a1eSAndroid Build Coastguard Worker# For Developers
2*60517a1eSAndroid Build Coastguard Worker
3*60517a1eSAndroid Build Coastguard Worker## Updating internal dependencies
4*60517a1eSAndroid Build Coastguard Worker
5*60517a1eSAndroid Build Coastguard Worker1. Modify the `./python/private/pypi/requirements.txt` file and run:
6*60517a1eSAndroid Build Coastguard Worker   ```
7*60517a1eSAndroid Build Coastguard Worker   bazel run //tools/private/update_deps:update_pip_deps
8*60517a1eSAndroid Build Coastguard Worker   ```
9*60517a1eSAndroid Build Coastguard Worker1. Bump the coverage dependencies using the script using:
10*60517a1eSAndroid Build Coastguard Worker   ```
11*60517a1eSAndroid Build Coastguard Worker   bazel run //tools/private/update_deps:update_coverage_deps <VERSION>
12*60517a1eSAndroid Build Coastguard Worker   ```
13*60517a1eSAndroid Build Coastguard Worker
14*60517a1eSAndroid Build Coastguard Worker## Releasing
15*60517a1eSAndroid Build Coastguard Worker
16*60517a1eSAndroid Build Coastguard WorkerStart from a clean checkout at `main`.
17*60517a1eSAndroid Build Coastguard Worker
18*60517a1eSAndroid Build Coastguard WorkerBefore running through the release it's good to run the build and the tests locally, and make sure CI is passing. You can
19*60517a1eSAndroid Build Coastguard Workeralso test-drive the commit in an existing Bazel workspace to sanity check functionality.
20*60517a1eSAndroid Build Coastguard Worker
21*60517a1eSAndroid Build Coastguard Worker#### Steps
22*60517a1eSAndroid Build Coastguard Worker1. [Determine the next semantic version number](#determining-semantic-version)
23*60517a1eSAndroid Build Coastguard Worker1. Create a tag and push, e.g. `git tag 0.5.0 upstream/main && git push upstream --tags`
24*60517a1eSAndroid Build Coastguard Worker   NOTE: Pushing the tag will trigger release automation.
25*60517a1eSAndroid Build Coastguard Worker1. Watch the release automation run on https://github.com/bazelbuild/rules_python/actions
26*60517a1eSAndroid Build Coastguard Worker1. Add missing information to the release notes. The automatic release note
27*60517a1eSAndroid Build Coastguard Worker   generation only includes commits associated with issues.
28*60517a1eSAndroid Build Coastguard Worker
29*60517a1eSAndroid Build Coastguard Worker#### Determining Semantic Version
30*60517a1eSAndroid Build Coastguard Worker
31*60517a1eSAndroid Build Coastguard Worker**rules_python** is currently using [Zero-based versioning](https://0ver.org/) and thus backwards-incompatible API
32*60517a1eSAndroid Build Coastguard Workerchanges still come under the minor-version digit. So releases with API changes and new features bump the minor, and
33*60517a1eSAndroid Build Coastguard Workerthose with only bug fixes and other minor changes bump the patch digit.
34*60517a1eSAndroid Build Coastguard Worker
35*60517a1eSAndroid Build Coastguard WorkerTo find if there were any features added or incompatible changes made, review
36*60517a1eSAndroid Build Coastguard Workerthe commit history. This can be done using github by going to the url:
37*60517a1eSAndroid Build Coastguard Worker`https://github.com/bazelbuild/rules_python/compare/<VERSION>...main`.
38*60517a1eSAndroid Build Coastguard Worker
39*60517a1eSAndroid Build Coastguard Worker#### After release creation in Github
40*60517a1eSAndroid Build Coastguard Worker
41*60517a1eSAndroid Build Coastguard Worker1. Ping @philwo to get the new release added to mirror.bazel.build. See [this comment on issue #400](https://github.com/bazelbuild/rules_python/issues/400#issuecomment-779159530) for more context.
42*60517a1eSAndroid Build Coastguard Worker1. Announce the release in the #python channel in the Bazel slack (bazelbuild.slack.com).
43*60517a1eSAndroid Build Coastguard Worker
44*60517a1eSAndroid Build Coastguard Worker## Secrets
45*60517a1eSAndroid Build Coastguard Worker
46*60517a1eSAndroid Build Coastguard Worker### PyPI user rules-python
47*60517a1eSAndroid Build Coastguard Worker
48*60517a1eSAndroid Build Coastguard WorkerPart of the release process uploads packages to PyPI as the user `rules-python`.
49*60517a1eSAndroid Build Coastguard WorkerThis account is managed by Google; contact [email protected] if
50*60517a1eSAndroid Build Coastguard Workersomething needs to be done with the PyPI account.
51