aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2019-03-06 14:07:37 +0100
committerMatěj Cepl <mcepl@cepl.eu>2019-03-06 14:07:37 +0100
commitfacfd9d9b824123f83977b125f5f4442f724cd11 (patch)
tree26fb9e3f240fb574ad6b7e54c33d2fc36e6e8c53
parent384393a671b6ee4852c0c52b679ca5a3f31bcd94 (diff)
downloaddlp_check_version_PyPI-facfd9d9b824123f83977b125f5f4442f724cd11.tar.gz
Start collecting cleanups for weird PyPI versioning.
Fixes #2
-rwxr-xr-xdlpcvp.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/dlpcvp.py b/dlpcvp.py
index fdf6a75..af4378d 100755
--- a/dlpcvp.py
+++ b/dlpcvp.py
@@ -186,7 +186,11 @@ def get_version_from_pypi(name: str, con: DBConnType = None) -> Optional[LooseVe
curr_etag = str(resp.info()['ETag'])
if curr_etag:
update_etags(con, name, None, None, curr_etag)
- return LooseVersion(info_dict['version'])
+
+ # Cleanup version
+ version = info_dict['version'].replace('-', '.')
+
+ return LooseVersion(version)
except HTTPError as ex:
if ex.getcode() == 404:
log.warning(f'Cannot find {name} on PyPI')