Skip to content

Commit beb8a7e

Browse files
bouwewManneW
andauthored
Fix semver issue the proper way (#9)
* Fix semver issue * Correct use of semver --------- Co-authored-by: Emanuel Winblad <emanuel.winblad@sportality.se>
1 parent d37c119 commit beb8a7e

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

requirements.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
-i https://pypi.org/simple
99
certifi==2022.12.7
1010
charset-normalizer==2.0.7; python_version >= '3'
11-
getmac==0.8.2
11+
getmac==0.9.4
1212
idna==3.3; python_version >= '3'
13-
requests==2.26.0
14-
semver==2.13.0
13+
requests==2.31.0
14+
responses==0.25.0
15+
semver==3.0.2
1516
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'

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ keywords =
1414
[options]
1515
packages = find:
1616
install_requires =
17-
requests
1817
getmac
18+
requests
1919
semver
2020
setup_requires =
2121
setuptools_scm

vilfo/client.py

Lines changed: 2 additions & 2 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 import compare as semver_compare
7+
from semver import Version as Version
88

99
import vilfo.exceptions
1010

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

42-
self._api_v1_supported = semver_compare(self._firmware_version, "1.1.0") >= 0
42+
self._api_v1_supported = Version.parse(self._firmware_version).compare("1.1.0") >= 0
4343

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

0 commit comments

Comments
 (0)