diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2019-03-06 14:07:37 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2019-03-06 14:07:37 +0100 |
commit | facfd9d9b824123f83977b125f5f4442f724cd11 (patch) | |
tree | 26fb9e3f240fb574ad6b7e54c33d2fc36e6e8c53 | |
parent | 384393a671b6ee4852c0c52b679ca5a3f31bcd94 (diff) | |
download | dlp_check_version_PyPI-facfd9d9b824123f83977b125f5f4442f724cd11.tar.gz |
Start collecting cleanups for weird PyPI versioning.
Fixes #2
-rwxr-xr-x | dlpcvp.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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') |