Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python: add support for __about__.py #2433

Open
fredrikaverpil opened this issue Nov 16, 2024 · 0 comments · May be fixed by #2434
Open

Python: add support for __about__.py #2433

fredrikaverpil opened this issue Nov 16, 2024 · 0 comments · May be fixed by #2434
Assignees
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@fredrikaverpil
Copy link

fredrikaverpil commented Nov 16, 2024

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:

if (!projectName) {
this.logger.warn('No project/component found.');
} else {
[projectName, projectName.replace(/-/g, '_')]
.flatMap(packageName => [
`${packageName}/__init__.py`,
`src/${packageName}/__init__.py`,
])
.forEach(packagePath =>
updates.push({
path: this.addPath(packagePath),
createIfMissing: false,
updater: new PythonFileWithVersion({version}),
})
);
}

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 (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: #2434

@fredrikaverpil fredrikaverpil added priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants