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

Cleaner version display format #504

Merged
merged 1 commit into from
Sep 16, 2024
Merged

Cleaner version display format #504

merged 1 commit into from
Sep 16, 2024

Conversation

mvandenburgh
Copy link
Member

@mvandenburgh mvandenburgh commented Sep 12, 2024

Updates the version string in the UI to be more user friendly.

Tagged release versions now look like this:
Screenshot from 2024-09-12 11-55-10

And pre-release versions remain the same:
Screenshot from 2024-09-12 11-56-39

Copy link
Contributor

@floryst floryst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

As a very initial thought, if we want to avoid adding another dependency, it might be sufficient to use a regex to match against the release part of the version string: ^v[0-9]+(\.[0-9]+)*

Comment on lines +50 to +52
post_num: int | None = parsed_version.post
if post_num is not None:
version += f'.post{post_num}+{parsed_version.local}'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference between api.version and the string constructed here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the current version is not a tagged release, they differ only slightly. For example, for the latest commit on this branch

print(api.version)  # prints '1.10.2.post5.dev0+b074e39c'
print(version)  # prints 'v1.10.2.post5+b074e39c'

The main motivation behind this change is to make it look more user friendly when the curent version is a tagged release, which looks like this

print(api.version)  # prints '1.12+b074e39c'
print(version)  # prints 'v1.12'

@mvandenburgh
Copy link
Member Author

Rebased on main to resolve conflicts.

@mvandenburgh mvandenburgh merged commit a192807 into main Sep 16, 2024
8 checks passed
@mvandenburgh mvandenburgh deleted the update-version-format branch September 16, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants