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

MetaStalk.utils.update   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A check_update() 0 6 1
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