diff options
7 files changed, 25 insertions, 1 deletions
diff --git a/pyproject.toml b/pyproject.toml index da1db2bc..880675c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ requires = [ "pathspec", "tree-sitter>=0.19.0", "snakeoil~=0.10.4", - "pkgcore~=0.12.18", + "pkgcore~=0.12.20", ] build-backend = "setuptools.build_meta" diff --git a/src/pkgcheck/checks/metadata_xml.py b/src/pkgcheck/checks/metadata_xml.py index adba0bdb..f2b43af2 100644 --- a/src/pkgcheck/checks/metadata_xml.py +++ b/src/pkgcheck/checks/metadata_xml.py @@ -653,6 +653,7 @@ class MissingRemoteIdCheck(Check): ("gitlab", rf"https://gitlab.com/{_gitlab_match}"), ("gnome-gitlab", rf"https://gitlab.gnome.org/{_gitlab_match}"), ("heptapod", rf"https://foss.heptapod.net/{_gitlab_match}"), + ("kde-invent", rf"https://invent.kde.org/{_gitlab_match}"), ("launchpad", r"https://launchpad.net/(?P<value>[^/]+)"), ("pypi", r"https://pypi.org/project/(?P<value>[^/]+)"), ("pypi", r"https://files.pythonhosted.org/packages/source/\S/(?P<value>[^/]+)"), diff --git a/src/pkgcheck/checks/network.py b/src/pkgcheck/checks/network.py index f51796e2..4b970716 100644 --- a/src/pkgcheck/checks/network.py +++ b/src/pkgcheck/checks/network.py @@ -293,6 +293,7 @@ class MetadataUrlCheck(_UrlCheck): "gitlab": "https://gitlab.com/{project}", "gnome-gitlab": "https://gitlab.gnome.org/{project}.git/", "hackage": "https://hackage.haskell.org/package/{project}", + "kde-invent": "https://invent.kde.org/{project}", "launchpad": "https://launchpad.net/{project}", "osdn": "https://osdn.net/projects/{project}/", "pecl": "https://pecl.php.net/package/{project}", diff --git a/testdata/data/repos/network/MetadataUrlCheck/DeadUrl-kde-invent/expected.json b/testdata/data/repos/network/MetadataUrlCheck/DeadUrl-kde-invent/expected.json new file mode 100644 index 00000000..f8f2d77b --- /dev/null +++ b/testdata/data/repos/network/MetadataUrlCheck/DeadUrl-kde-invent/expected.json @@ -0,0 +1 @@ +{"__class__": "DeadUrl", "category": "MetadataUrlCheck", "package": "DeadUrl-kde-invent", "version": "0", "attr": "metadata.xml: remote-id", "url": "https://invent.kde.org/pkgcore/pkgcheck", "message": "404 Client Error: Not Found for url: https://invent.kde.org/pkgcore/pkgcheck"} diff --git a/testdata/repos/network/MetadataUrlCheck/DeadUrl-kde-invent/DeadUrl-kde-invent-0.ebuild b/testdata/repos/network/MetadataUrlCheck/DeadUrl-kde-invent/DeadUrl-kde-invent-0.ebuild new file mode 100644 index 00000000..3b5174cb --- /dev/null +++ b/testdata/repos/network/MetadataUrlCheck/DeadUrl-kde-invent/DeadUrl-kde-invent-0.ebuild @@ -0,0 +1,4 @@ +DESCRIPTION="Ebuild with a dead metadata.xml URL" +HOMEPAGE="https://invent.kde.org/pkgcore/pkgcheck.git/" +LICENSE="BSD" +SLOT="0" diff --git a/testdata/repos/network/MetadataUrlCheck/DeadUrl-kde-invent/metadata.xml b/testdata/repos/network/MetadataUrlCheck/DeadUrl-kde-invent/metadata.xml new file mode 100644 index 00000000..536ba78f --- /dev/null +++ b/testdata/repos/network/MetadataUrlCheck/DeadUrl-kde-invent/metadata.xml @@ -0,0 +1,7 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <upstream> + <remote-id type="kde-invent">pkgcore/pkgcheck</remote-id> + </upstream> +</pkgmetadata> diff --git a/testdata/repos/network/MetadataUrlCheck/DeadUrl-kde-invent/responses.py b/testdata/repos/network/MetadataUrlCheck/DeadUrl-kde-invent/responses.py new file mode 100644 index 00000000..32dade73 --- /dev/null +++ b/testdata/repos/network/MetadataUrlCheck/DeadUrl-kde-invent/responses.py @@ -0,0 +1,10 @@ +import io + +from requests.models import Response + +r = Response() +r.status_code = 404 +r.reason = "Not Found" +r.url = "https://invent.kde.org/pkgcore/pkgcheck" +r.raw = io.StringIO() +responses = [r] |