mirror of
https://github.com/lilydjwg/nvchecker.git
synced 2025-03-10 06:14:02 +00:00
Exclude yanked PyPI releases
Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
This commit is contained in:
parent
4364759b29
commit
6f5870787a
2 changed files with 9 additions and 0 deletions
|
@ -19,6 +19,10 @@ async def get_version(name, conf, *, cache, **kwargs):
|
||||||
data = await cache.get_json(url)
|
data = await cache.get_json(url)
|
||||||
|
|
||||||
for version in data['releases'].keys():
|
for version in data['releases'].keys():
|
||||||
|
# Skip versions that are marked as yanked.
|
||||||
|
if len(data['releases'][version]) != 0 and data['releases'][version][0]['yanked']:
|
||||||
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
parsed_version = Version(version)
|
parsed_version = Version(version)
|
||||||
except InvalidVersion:
|
except InvalidVersion:
|
||||||
|
|
|
@ -32,3 +32,8 @@ async def test_pypi_invalid_version(get_version):
|
||||||
"source": "pypi",
|
"source": "pypi",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
async def test_pypi_yanked_version(get_version):
|
||||||
|
assert await get_version("urllib3", {
|
||||||
|
"source": "pypi",
|
||||||
|
"include_regex": "^(1\\..*)|(2\\.0\\.[0,1])",
|
||||||
|
}) == "1.26.20"
|
||||||
|
|
Loading…
Add table
Reference in a new issue