Skip to content

Commit 6b4bdc3

Browse files
committed
Downgrade semver to version 2
To avoid conflict with other version of the package used by home-assistant/core.
1 parent 84ec4c4 commit 6b4bdc3

4 files changed

Lines changed: 8 additions & 10 deletions

File tree

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name = "pypi"
66
[packages]
77
requests = "*"
88
getmac = "~=0.8"
9-
semver = "*"
9+
semver = "~=2.0"
1010

1111
[dev-packages]
1212
black = "*"

Pipfile.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ charset-normalizer==2.0.7; python_version >= '3'
1111
getmac==0.8.2
1212
idna==3.3; python_version >= '3'
1313
requests==2.26.0
14-
semver==3.0.0.dev2
14+
semver==2.13.0
1515
urllib3==1.26.7; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'

vilfo/client.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import ipaddress
55
import json
66
import requests
7-
from semver.version import Version as SemverVersion
7+
from semver import compare as semver_compare
88

99
import vilfo.exceptions
1010

@@ -39,9 +39,7 @@ def __init__(self, host, token, ssl=False):
3939
except vilfo.exceptions.VilfoException:
4040
pass
4141

42-
self._api_v1_supported = SemverVersion.parse(self._firmware_version) >= "1.1.0"
43-
44-
print(self._api_v1_supported)
42+
self._api_v1_supported = semver_compare(self._firmware_version, "1.1.0") >= 0
4543

4644
def _request(self, method, endpoint, headers=None, data=None, params=None, timeout=None):
4745
"""Internal method to facilitate performing requests with authentication added to them

0 commit comments

Comments
 (0)