Skip to content

Commit

Permalink
Addressing #110
Browse files Browse the repository at this point in the history
  • Loading branch information
dvershinin committed Sep 25, 2023
1 parent 5cb7d04 commit b924c8d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog
All notable changes to this project will be documented in this file.

## [3.3.2] - 2023-09-25
### Fixed
* Fix regression in semver preference

## [3.3.1] - 2023-09-22
### Fixed
* Fixed AppImage installation #107
Expand Down
6 changes: 4 additions & 2 deletions lastversion/Version.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ def fix_letter_post_release(self, match):
return match.group(1) + '.post' + str(ord(match.group(2)))

def is_semver(self):
"""Check if this a semantic version"""
return self.base_version.count('.') == 2
"""
Check if this a semantic version or a shorthand of semantic version
"""
return self.base_version.count('.') >= 1

@staticmethod
def part_to_pypi(part):
Expand Down
2 changes: 1 addition & 1 deletion lastversion/__about__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Package metadata"""
__version__ = '3.3.1'
__version__ = '3.3.2'
__self__ = "dvershinin/lastversion"
11 changes: 11 additions & 0 deletions tests/test_github.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,14 @@ def test_semver_preferred():
output = latest(repo)

assert output == version.parse("8.10.0")


def test_semver_shorthand_preferred():
"""
Test a GitHub project with a shorthand semver version number for releases
"""
repo = "https://github.com/lastversion-test-repos/cgal"

output = latest(repo)

assert output == version.parse("5.6")

0 comments on commit b924c8d

Please sign in to comment.