mirror of
https://github.com/lilydjwg/nvchecker
synced 2025-03-09 12:57:39 +00:00
Merge pull request #292 from JeanChristopheMorinPerso/skip_yanked_pypi_releases
Exclude yanked PyPI releases
This commit is contained in:
commit
7cacd9edaf
@ -589,7 +589,7 @@ Check PyPI
|
||||
|
||||
source = "pypi"
|
||||
|
||||
Check `PyPI <https://pypi.python.org/>`_ for updates.
|
||||
Check `PyPI <https://pypi.python.org/>`_ for updates. Yanked releases are ignored.
|
||||
|
||||
pypi
|
||||
The name used on PyPI, e.g. ``PySide``.
|
||||
@ -683,7 +683,7 @@ Check crates.io
|
||||
|
||||
source = "cratesio"
|
||||
|
||||
Check `crates.io <https://crates.io/>`_ for updates.
|
||||
Check `crates.io <https://crates.io/>`_ for updates. Yanked releases are ignored.
|
||||
|
||||
cratesio
|
||||
The crate name on crates.io, e.g. ``tokio``.
|
||||
|
@ -19,6 +19,10 @@ async def get_version(name, conf, *, cache, **kwargs):
|
||||
data = await cache.get_json(url)
|
||||
|
||||
for version in data['releases'].keys():
|
||||
# Skip versions that are marked as yanked.
|
||||
if (vers := data['releases'][version]) and vers[0]['yanked']:
|
||||
continue
|
||||
|
||||
try:
|
||||
parsed_version = Version(version)
|
||||
except InvalidVersion:
|
||||
|
@ -39,10 +39,10 @@ classifiers =
|
||||
|
||||
[options]
|
||||
zip_safe = True
|
||||
python_requires = >=3.8
|
||||
|
||||
packages = find_namespace:
|
||||
install_requires =
|
||||
setuptools; python_version<"3.8"
|
||||
tomli; python_version<"3.11"
|
||||
structlog
|
||||
platformdirs
|
||||
|
@ -32,3 +32,8 @@ async def test_pypi_invalid_version(get_version):
|
||||
"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…
Reference in New Issue
Block a user