nvchecker/nvchecker/source/hackage.py
lilydjwg 903b414183 cache result during a run
so that different entries can refer to a same software without much overhead.

This is needed because entries may be generated, and only nvchecker can
tell if two entries are expecting the same result because the name may
or may not be relevant.

Closes #81.
2018-10-10 17:03:20 +08:00

15 lines
354 B
Python

# MIT licensed
# Copyright (c) 2013-2017 lilydjwg <lilydjwg@gmail.com>, et al.
from .simple_json import simple_json
HACKAGE_URL = 'https://hackage.haskell.org/package/%s/preferred.json'
def _version_from_json(data):
return data['normal-version'][0]
get_version, get_cacheable_conf = simple_json(
HACKAGE_URL,
'hackage',
_version_from_json,
)