| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
… variable Signed-off-by: codejedi365 <codejedi365@users.noreply.github.com>
…on variables Implements: #1443 Signed-off-by: codejedi365 <codejedi365@users.noreply.github.com>
…sion_variables` Co-authored-by: codejedi365 <17354856+codejedi365@users.noreply.github.com> Signed-off-by: codejedi365 <codejedi365@users.noreply.github.com>
There was a problem hiding this comment.
@copilot, can you make sure that the documentation is up to date to match this
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Version variables with PEP 526 type annotations (e.g., __version__: str = "1.0.0") were silently skipped during version stamping because the pattern regex had no support for the : <type> segment between variable name and assignment operator.
Changes
src/semantic_release/version/declarations/pattern.py: Insert an optional non-capturing regex group (?:\s*:\s*[^\s=:][^=:=]*)? between the variable name and assignment operator in from_string_definition. The character class [^\s=:] as the first character after the colon prevents matching := (walrus) or ::, preserving all existing operator handling.
tests/unit/semantic_release/version/declarations/test_pattern_declaration.py: Add four parametrized cases covering str, Optional[str], typing.Final[str] annotations, and tag-format with annotation.
Example
Fixes #1443