Skip to content

Commit

Permalink
Downgrade semver to version 2
Browse files Browse the repository at this point in the history
To avoid conflict with other version of the package used by home-assistant/core.
  • Loading branch information
ManneW committed Nov 6, 2021
1 parent 84ec4c4 commit 6b4bdc3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name = "pypi"
[packages]
requests = "*"
getmac = "~=0.8"
semver = "*"
semver = "~=2.0"

[dev-packages]
black = "*"
Expand Down
8 changes: 4 additions & 4 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ charset-normalizer==2.0.7; python_version >= '3'
getmac==0.8.2
idna==3.3; python_version >= '3'
requests==2.26.0
semver==3.0.0.dev2
semver==2.13.0
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'
6 changes: 2 additions & 4 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.version import Version as SemverVersion
from semver import compare as semver_compare

import vilfo.exceptions

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

self._api_v1_supported = SemverVersion.parse(self._firmware_version) >= "1.1.0"

print(self._api_v1_supported)
self._api_v1_supported = semver_compare(self._firmware_version, "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 6b4bdc3

Please sign in to comment.