Skip to content

Commit

Permalink
make the public/base_version comparison clearer (#818)
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii authored Aug 8, 2024
1 parent f655175 commit 24e5350
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/packaging/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ def public(self) -> str:
'1.2.3'
>>> Version("1.2.3+abc").public
'1.2.3'
>>> Version("1.2.3+abc.dev1").public
'1.2.3'
>>> Version("1!1.2.3dev1+abc").public
'1!1.2.3.dev1'
"""
return str(self).split("+", 1)[0]

Expand All @@ -363,7 +363,7 @@ def base_version(self) -> str:
'1.2.3'
>>> Version("1.2.3+abc").base_version
'1.2.3'
>>> Version("1!1.2.3+abc.dev1").base_version
>>> Version("1!1.2.3dev1+abc").base_version
'1!1.2.3'
The "base version" is the public version of the project without any pre or post
Expand Down

0 comments on commit 24e5350

Please sign in to comment.