mirror of
https://github.com/lilydjwg/nvchecker
synced 2025-03-09 21:07:33 +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"
|
source = "pypi"
|
||||||
|
|
||||||
Check `PyPI <https://pypi.python.org/>`_ for updates.
|
Check `PyPI <https://pypi.python.org/>`_ for updates. Yanked releases are ignored.
|
||||||
|
|
||||||
pypi
|
pypi
|
||||||
The name used on PyPI, e.g. ``PySide``.
|
The name used on PyPI, e.g. ``PySide``.
|
||||||
@ -683,7 +683,7 @@ Check crates.io
|
|||||||
|
|
||||||
source = "cratesio"
|
source = "cratesio"
|
||||||
|
|
||||||
Check `crates.io <https://crates.io/>`_ for updates.
|
Check `crates.io <https://crates.io/>`_ for updates. Yanked releases are ignored.
|
||||||
|
|
||||||
cratesio
|
cratesio
|
||||||
The crate name on crates.io, e.g. ``tokio``.
|
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)
|
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 (vers := data['releases'][version]) and vers[0]['yanked']:
|
||||||
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
parsed_version = Version(version)
|
parsed_version = Version(version)
|
||||||
except InvalidVersion:
|
except InvalidVersion:
|
||||||
|
@ -39,10 +39,10 @@ classifiers =
|
|||||||
|
|
||||||
[options]
|
[options]
|
||||||
zip_safe = True
|
zip_safe = True
|
||||||
|
python_requires = >=3.8
|
||||||
|
|
||||||
packages = find_namespace:
|
packages = find_namespace:
|
||||||
install_requires =
|
install_requires =
|
||||||
setuptools; python_version<"3.8"
|
|
||||||
tomli; python_version<"3.11"
|
tomli; python_version<"3.11"
|
||||||
structlog
|
structlog
|
||||||
platformdirs
|
platformdirs
|
||||||
|
@ -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…
Reference in New Issue
Block a user