googleapis / googleapis/release-please
Python strategy should honor `--package-name` argument
- 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.**
Currently, when a Python project has a pyproject.toml file, release-please will ignore the `--package-name` argument and overwrite it with the value found on the `project.name` attribute of the TOML file. Although a mechanism was created to assure the strategy can find version variables on **\_\_init\_\_.py** files under different folders, this fails if the module name (actual folder) is more than a few dashes/underscores different from the `project.name`.
**Describe the solution you'd like**
The `--package-name` argument should take precedence over the `project.name` attribute found on pyproject.toml.
**Describe alternatives you've considered**
None
**Additional context**
To give an example, we have a private package that is called `$companyPrefix-$packageName` while the actual folder is just named after `$packageName` 👇
### pyproject.toml
```toml
[project]
name = "company-package"
version = "0.1.0"
```
### project structure
```shell
repo/
├─ package/
│ ├─ __init__.py # <- __version__ = "0.1.0"
├─ pyproject.toml
```
With this setting, only the pyproject.toml is updated on the release PR. The `package/__init__.py` can't be found by the current updater.
Contributor guide
Assessment
This issue has not been assessed yet.