mirror of
https://github.com/lilydjwg/nvchecker
synced 2024-12-23 23:22:56 +00:00
pypi source: use packaging.version.Version directly
This commit is contained in:
parent
491a71add7
commit
e09750b7a2
@ -1,7 +1,7 @@
|
||||
# MIT licensed
|
||||
# Copyright (c) 2013-2020 lilydjwg <lilydjwg@gmail.com>, et al.
|
||||
# Copyright (c) 2013-2021 lilydjwg <lilydjwg@gmail.com>, et al.
|
||||
|
||||
from pkg_resources import parse_version
|
||||
from packaging.version import Version
|
||||
|
||||
async def get_version(name, conf, *, cache, **kwargs):
|
||||
package = conf.get('pypi') or name
|
||||
@ -14,7 +14,7 @@ async def get_version(name, conf, *, cache, **kwargs):
|
||||
if use_pre_release:
|
||||
version = sorted(
|
||||
data['releases'].keys(),
|
||||
key = parse_version,
|
||||
key = Version,
|
||||
)[-1]
|
||||
else:
|
||||
version = data['info']['version']
|
||||
|
2
setup.py
2
setup.py
@ -21,7 +21,7 @@ setup(
|
||||
zip_safe = True,
|
||||
|
||||
packages = find_namespace_packages(exclude=['tests', 'build*', 'docs']),
|
||||
install_requires = ['setuptools', 'toml', 'structlog', 'appdirs', 'tornado>=6', 'pycurl'],
|
||||
install_requires = ['setuptools', 'packaging', 'toml', 'structlog', 'appdirs', 'tornado>=6', 'pycurl'],
|
||||
extras_require = {
|
||||
'vercmp': ['pyalpm'],
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user