Skip to content

Commit

Permalink
Fix semver issue the proper way (#9)
Browse files Browse the repository at this point in the history
* Fix semver issue

* Correct use of semver

---------

Co-authored-by: Emanuel Winblad <emanuel.winblad@sportality.se>
  • Loading branch information
bouwew and ManneW authored Mar 23, 2024
1 parent d37c119 commit beb8a7e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
-i https://pypi.org/simple
certifi==2022.12.7
charset-normalizer==2.0.7; python_version >= '3'
getmac==0.8.2
getmac==0.9.4
idna==3.3; python_version >= '3'
requests==2.26.0
semver==2.13.0
requests==2.31.0
responses==0.25.0
semver==3.0.2
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'
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ keywords =
[options]
packages = find:
install_requires =
requests
getmac
requests
semver
setup_requires =
setuptools_scm
Expand Down
4 changes: 2 additions & 2 deletions vilfo/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import ipaddress
import json
import requests
from semver import compare as semver_compare
from semver import Version as Version

import vilfo.exceptions

Expand Down Expand Up @@ -39,7 +39,7 @@ def __init__(self, host, token, ssl=False):
except vilfo.exceptions.VilfoException:
pass

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

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

0 comments on commit beb8a7e

Please sign in to comment.