Description
Python-semantic-release does not detect and update version variables in Python files when they include type annotations (type hints).
Version
- python-semantic-release: 10.5.3
Desired workflow
- Create a Python file with a version variable that includes a type hint:
# src/my_package/__init__.py
__version__: str = "1.6.0"
- Configure
version_variables in pyproject.toml:
[tool.semantic_release]
version_variables = [
"src/my_package/__init__.py:__version__",
]
- Run
semantic-release version
Desired behavior
The __version__ variable should be updated to the new version (e.g., "1.7.0")
Current behavior
The __version__ variable is NOT updated. Only version_toml entries are updated.
Workaround
Remove the type hint from the version variable:
__version__ = "1.6.0" # without type hint
Description
Python-semantic-release does not detect and update version variables in Python files when they include type annotations (type hints).
Version
Desired workflow
version_variablesinpyproject.toml:semantic-release versionDesired behavior
The
__version__variable should be updated to the new version (e.g.,"1.7.0")Current behavior
The
__version__variable is NOT updated. Onlyversion_tomlentries are updated.Workaround
Remove the type hint from the version variable: