-
Notifications
You must be signed in to change notification settings - Fork 237
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
fix(changelog): use base version without tag format by default #653
fix(changelog): use base version without tag format by default #653
Conversation
please @bernardcooke53 when you get some chance 👀 |
Was just coming back to this @roggervalf - I'm not the biggest fan of having "one special format" but I agree it's better to keep the old behaviour in place. Functionally the code looks good - thank you for the PR 🙏 I don't think "base_version" is a good name for the method though, I think we should call it |
sounds good to me, let me update it |
@bernardcooke53 it should be addressed |
@@ -205,6 +205,9 @@ def __repr__(self) -> str: | |||
def as_tag(self) -> str: | |||
return self.tag_format.format(version=str(self)) | |||
|
|||
def as_base_version(self) -> str: | |||
return "v{version}".format(version=str(self)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(just an fyi) you can actually just return f"v{self}", f-strings will automatically format
selfwith
self.str()if it's defined, and if not it will try to format with
self.repr()` - from the docs:
Called by str(object) and the built-in functions format() and print() to compute the “informal” or nicely printable string representation of an object. The return value must be a string object.
and from the PEP , f-string call the builtin format
method on expressions:
The expression is then formatted using the format protocol, using the format specifier as an argument. The resulting value is used when building the value of the f-string.
Note that format() is not called directly on each value. The actual code uses the equivalent of type(value).format(value, format_spec), or format(value, format_spec). See the documentation of the builtin format() function for more details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
5984c77
into
python-semantic-release:master
when release notes are generated, tag version is set instead of baser version. Before breaking change we were having base version format "v{version}" that reflects the actual published version. I think tag formatting is used for avoiding multi packages conflicts in the same repo.