googleapis / googleapis/release-please

Python: add support for `__about__.py`

Open
#2,433 0 comments 0 reactions 1 assignee Claimed by @chingor13 View on GitHub
priority: p3 type: feature request
Dominant language
TypeScript
Stars
7.5k
Forks
588
Avg merge
12h 16m
Merged PRs (30d)
7

Description

**Is your feature request related to a problem? Please describe.**

I cannot make release-please bump the version string inside any other Python file than `__init__.py`, as this is today hard-coded:

https://github.com/googleapis/release-please/blob/52594b194fdd0ae516776128e6511d5e4cd21518/src/strategies/python.ts#L105-L120

Some Python projects doesn't use `__init__.py` to store the version string. Some projects like to place this in a `__about__.py` file or `__version__.py` file instead. In short, this separates concerns so that the version string can be watched outside of any other potential code changes. In my case, I wanted release-please to bump an `__about__.py` file.

**Describe the solution you'd like**

* I'd like to have release-please attempt to bump `__init__.py` like it does today for backwards compatibility reasons.
* I'd like to define the desired filename in which the version string will be bumped, using the [`version-file` manifest configuration](https://github.com/googleapis/release-please-action#package-options) (but this is currently not taken into consideration for release-please's Python strategy).

**Describe alternatives you've considered**

N/A

## PR proposal

This enables the use of `version-file`: https://github.com/googleapis/release-please/pull/2434

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.