Test Failed
Push — master ( eb8f9d...e6cb19 )
by Cyb3r
04:31 queued 10s
created

MetaStalk.utils.update.check_update()   A

Complexity

Conditions 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
"""Script to check for available MetaStalk updates"""
2
3
from distutils.version import LooseVersion
4
import requests
5
6
7
def check_update(current_version: str) -> bool:
8
    """Check version against pypi.org information"""
9
    latest = LooseVersion(
10
        requests.get("https://pypi.org/pypi/MetaStalk/json").json()["info"]["version"]
11
    )
12
    return latest > current_version
13