Skip to content

Commit 4fe0a4e

Browse files
committed
chore: bump version 1.1.0
1 parent ab31268 commit 4fe0a4e

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

github_random_star/api.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from httpx import Client, codes
1010

11-
from github_random_star.version import __version__, process_version
11+
from github_random_star.version import __version__, VersionNo
1212

1313
log = logging.getLogger("GitHub Random Star")
1414

@@ -62,7 +62,7 @@ def __init__(
6262
self.cache_path = cache_location
6363
self.refresh = refresh
6464
self.max_results = max_results
65-
self.version = process_version(__version__)
65+
self.version = VersionNo.process_version(__version__)
6666
self.client = Client(
6767
headers=self.create_headers(token),
6868
base_url=self.API_BASE_URL,
@@ -164,7 +164,7 @@ def load_items(self) -> dict[str, Any] | None:
164164
datetime.fromisoformat(cache_data["date"]).date().isoformat(),
165165
)
166166

167-
version = process_version(cache_data.get("version", "0.0.0"))
167+
version = VersionNo.process_version(cache_data.get("version", "0.0.0"))
168168
if self.version != version:
169169
log.warning(
170170
"Cache is from a different version. Current: %s - Stored: %s",

github_random_star/version.py

+12-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from typing import NamedTuple
44

5-
__version__ = "1.0.0"
5+
__version__ = "1.1.0"
66

77

88
class VersionNo(NamedTuple):
@@ -13,7 +13,9 @@ class VersionNo(NamedTuple):
1313
def __str__(self) -> str:
1414
return f"{self.major}.{self.minor}.{self.patch}"
1515

16-
def __gt__(self, other: VersionNo) -> bool:
16+
def __gt__(self, other: object) -> bool:
17+
if not isinstance(other, VersionNo):
18+
return False
1719
if self == other:
1820
return False
1921
if self.major > other.major:
@@ -28,17 +30,18 @@ def __gt__(self, other: VersionNo) -> bool:
2830
return True
2931
return False
3032

31-
def __eq__(self, other: VersionNo) -> bool:
33+
def __eq__(self, other: object) -> bool:
3234
return (
33-
self.major == other.major
35+
isinstance(other, VersionNo)
36+
and self.major == other.major
3437
and self.minor == other.minor
3538
and self.patch == other.patch
3639
)
3740

38-
def __ne__(self, other: VersionNo) -> bool:
41+
def __ne__(self, other: object) -> bool:
3942
return not self.__eq__(other)
4043

41-
42-
def process_version(version: str) -> VersionNo:
43-
major, minor, patch = version.split(".")
44-
return VersionNo(int(major), int(minor), int(patch))
44+
@staticmethod
45+
def process_version(version: str) -> VersionNo:
46+
major, minor, patch = version.split(".")
47+
return VersionNo(int(major), int(minor), int(patch))

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "github-random-star"
3-
version = "1.0.0"
3+
version = "1.1.0"
44
description = "Simple CLI tool to fetch random starred repositories from a users GitHub profile."
55
authors = ["David Kasakaitis <[email protected]>"]
66
readme = "README.md"

0 commit comments

Comments
 (0)