mirror of
https://github.com/lilydjwg/nvchecker.git
synced 2025-03-10 06:14:02 +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 changed files with 12 additions and 4 deletions
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
from .httpclient import session, TemporaryError, HTTPError
|
from .httpclient import session, TemporaryError, HTTPError
|
||||||
from .util import (
|
from .util import (
|
||||||
Entry, BaseWorker, RawResult, VersionResult,
|
Entry, BaseWorker, RawResult, VersionResult, RichResult,
|
||||||
AsyncCache, KeyManager, GetVersionError, EntryWaiter,
|
AsyncCache, KeyManager, GetVersionError, EntryWaiter,
|
||||||
)
|
)
|
||||||
from .sortversion import sort_version_keys
|
from .sortversion import sort_version_keys
|
||||||
|
|
|
@ -6,7 +6,7 @@ import asyncio
|
||||||
from typing import Iterable, Dict, List, Tuple, Any, Optional
|
from typing import Iterable, Dict, List, Tuple, Any, Optional
|
||||||
|
|
||||||
from nvchecker.api import (
|
from nvchecker.api import (
|
||||||
session, GetVersionError, VersionResult,
|
session, GetVersionError, VersionResult, RichResult,
|
||||||
Entry, BaseWorker, RawResult,
|
Entry, BaseWorker, RawResult,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -99,7 +99,10 @@ async def _run_batch_impl(
|
||||||
if strip_release and '-' in version:
|
if strip_release and '-' in version:
|
||||||
version = version.rsplit('-', 1)[0]
|
version = version.rsplit('-', 1)[0]
|
||||||
|
|
||||||
ret[name] = version
|
ret[name] = RichResult(
|
||||||
|
version = version,
|
||||||
|
url = f'https://aur.archlinux.org/packages/{name}',
|
||||||
|
)
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
from packaging.version import Version
|
from packaging.version import Version
|
||||||
|
|
||||||
|
from nvchecker.api import RichResult
|
||||||
|
|
||||||
async def get_version(name, conf, *, cache, **kwargs):
|
async def get_version(name, conf, *, cache, **kwargs):
|
||||||
package = conf.get('pypi') or name
|
package = conf.get('pypi') or name
|
||||||
use_pre_release = conf.get('use_pre_release', False)
|
use_pre_release = conf.get('use_pre_release', False)
|
||||||
|
@ -18,4 +20,7 @@ async def get_version(name, conf, *, cache, **kwargs):
|
||||||
)[-1]
|
)[-1]
|
||||||
else:
|
else:
|
||||||
version = data['info']['version']
|
version = data['info']['version']
|
||||||
return version
|
return RichResult(
|
||||||
|
version = version,
|
||||||
|
url = f'https://pypi.org/project/{package}/{version}/',
|
||||||
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue