mirror of
https://github.com/lilydjwg/nvchecker
synced 2024-12-26 08:32:21 +00:00
implement url results for AUR and PyPI
see https://github.com/lilydjwg/nvchecker/issues/238.
This commit is contained in:
parent
cc4a0cd301
commit
bdd025d995
@ -3,7 +3,7 @@
|
||||
|
||||
from .httpclient import session, TemporaryError, HTTPError
|
||||
from .util import (
|
||||
Entry, BaseWorker, RawResult, VersionResult,
|
||||
Entry, BaseWorker, RawResult, VersionResult, RichResult,
|
||||
AsyncCache, KeyManager, GetVersionError, EntryWaiter,
|
||||
)
|
||||
from .sortversion import sort_version_keys
|
||||
|
@ -6,7 +6,7 @@ import asyncio
|
||||
from typing import Iterable, Dict, List, Tuple, Any, Optional
|
||||
|
||||
from nvchecker.api import (
|
||||
session, GetVersionError, VersionResult,
|
||||
session, GetVersionError, VersionResult, RichResult,
|
||||
Entry, BaseWorker, RawResult,
|
||||
)
|
||||
|
||||
@ -99,7 +99,10 @@ async def _run_batch_impl(
|
||||
if strip_release and '-' in version:
|
||||
version = version.rsplit('-', 1)[0]
|
||||
|
||||
ret[name] = version
|
||||
ret[name] = RichResult(
|
||||
version = version,
|
||||
url = f'https://aur.archlinux.org/packages/{name}',
|
||||
)
|
||||
|
||||
return ret
|
||||
|
||||
|
@ -3,6 +3,8 @@
|
||||
|
||||
from packaging.version import Version
|
||||
|
||||
from nvchecker.api import RichResult
|
||||
|
||||
async def get_version(name, conf, *, cache, **kwargs):
|
||||
package = conf.get('pypi') or name
|
||||
use_pre_release = conf.get('use_pre_release', False)
|
||||
@ -18,4 +20,7 @@ async def get_version(name, conf, *, cache, **kwargs):
|
||||
)[-1]
|
||||
else:
|
||||
version = data['info']['version']
|
||||
return version
|
||||
return RichResult(
|
||||
version = version,
|
||||
url = f'https://pypi.org/project/{package}/{version}/',
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user