Gentoo Archives: gentoo-commits

From: Arthur Zamarin <arthurzam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/pkgcore/pkgcheck:master commit in: testdata/repos/network/MetadataUrlCheck/DeadUrl-kde-invent/, ...
Date: Thu, 02 Mar 2023 19:32:08
Message-Id: 1677785291.fd7cf070467fd7cf2e9019fd7a0347f3b5f2bba6.arthurzam@gentoo
1 commit: fd7cf070467fd7cf2e9019fd7a0347f3b5f2bba6
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Thu Feb 23 21:43:24 2023 +0000
4 Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
5 CommitDate: Thu Mar 2 19:28:11 2023 +0000
6 URL: https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=fd7cf070
7
8 network: add kde-invent remote-id
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11 Closes: https://github.com/pkgcore/pkgcheck/pull/551
12 Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
13
14 pyproject.toml | 2 +-
15 src/pkgcheck/checks/metadata_xml.py | 1 +
16 src/pkgcheck/checks/network.py | 1 +
17 .../network/MetadataUrlCheck/DeadUrl-kde-invent/expected.json | 1 +
18 .../DeadUrl-kde-invent/DeadUrl-kde-invent-0.ebuild | 4 ++++
19 .../network/MetadataUrlCheck/DeadUrl-kde-invent/metadata.xml | 7 +++++++
20 .../network/MetadataUrlCheck/DeadUrl-kde-invent/responses.py | 10 ++++++++++
21 7 files changed, 25 insertions(+), 1 deletion(-)
22
23 diff --git a/pyproject.toml b/pyproject.toml
24 index da1db2bc..880675c3 100644
25 --- a/pyproject.toml
26 +++ b/pyproject.toml
27 @@ -9,7 +9,7 @@ requires = [
28 "pathspec",
29 "tree-sitter>=0.19.0",
30 "snakeoil~=0.10.4",
31 - "pkgcore~=0.12.18",
32 + "pkgcore~=0.12.20",
33 ]
34 build-backend = "setuptools.build_meta"
35
36
37 diff --git a/src/pkgcheck/checks/metadata_xml.py b/src/pkgcheck/checks/metadata_xml.py
38 index adba0bdb..f2b43af2 100644
39 --- a/src/pkgcheck/checks/metadata_xml.py
40 +++ b/src/pkgcheck/checks/metadata_xml.py
41 @@ -653,6 +653,7 @@ class MissingRemoteIdCheck(Check):
42 ("gitlab", rf"https://gitlab.com/{_gitlab_match}"),
43 ("gnome-gitlab", rf"https://gitlab.gnome.org/{_gitlab_match}"),
44 ("heptapod", rf"https://foss.heptapod.net/{_gitlab_match}"),
45 + ("kde-invent", rf"https://invent.kde.org/{_gitlab_match}"),
46 ("launchpad", r"https://launchpad.net/(?P<value>[^/]+)"),
47 ("pypi", r"https://pypi.org/project/(?P<value>[^/]+)"),
48 ("pypi", r"https://files.pythonhosted.org/packages/source/\S/(?P<value>[^/]+)"),
49
50 diff --git a/src/pkgcheck/checks/network.py b/src/pkgcheck/checks/network.py
51 index f51796e2..4b970716 100644
52 --- a/src/pkgcheck/checks/network.py
53 +++ b/src/pkgcheck/checks/network.py
54 @@ -293,6 +293,7 @@ class MetadataUrlCheck(_UrlCheck):
55 "gitlab": "https://gitlab.com/{project}",
56 "gnome-gitlab": "https://gitlab.gnome.org/{project}.git/",
57 "hackage": "https://hackage.haskell.org/package/{project}",
58 + "kde-invent": "https://invent.kde.org/{project}",
59 "launchpad": "https://launchpad.net/{project}",
60 "osdn": "https://osdn.net/projects/{project}/",
61 "pecl": "https://pecl.php.net/package/{project}",
62
63 diff --git a/testdata/data/repos/network/MetadataUrlCheck/DeadUrl-kde-invent/expected.json b/testdata/data/repos/network/MetadataUrlCheck/DeadUrl-kde-invent/expected.json
64 new file mode 100644
65 index 00000000..f8f2d77b
66 --- /dev/null
67 +++ b/testdata/data/repos/network/MetadataUrlCheck/DeadUrl-kde-invent/expected.json
68 @@ -0,0 +1 @@
69 +{"__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"}
70
71 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
72 new file mode 100644
73 index 00000000..3b5174cb
74 --- /dev/null
75 +++ b/testdata/repos/network/MetadataUrlCheck/DeadUrl-kde-invent/DeadUrl-kde-invent-0.ebuild
76 @@ -0,0 +1,4 @@
77 +DESCRIPTION="Ebuild with a dead metadata.xml URL"
78 +HOMEPAGE="https://invent.kde.org/pkgcore/pkgcheck.git/"
79 +LICENSE="BSD"
80 +SLOT="0"
81
82 diff --git a/testdata/repos/network/MetadataUrlCheck/DeadUrl-kde-invent/metadata.xml b/testdata/repos/network/MetadataUrlCheck/DeadUrl-kde-invent/metadata.xml
83 new file mode 100644
84 index 00000000..536ba78f
85 --- /dev/null
86 +++ b/testdata/repos/network/MetadataUrlCheck/DeadUrl-kde-invent/metadata.xml
87 @@ -0,0 +1,7 @@
88 +<?xml version='1.0' encoding='UTF-8'?>
89 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
90 +<pkgmetadata>
91 + <upstream>
92 + <remote-id type="kde-invent">pkgcore/pkgcheck</remote-id>
93 + </upstream>
94 +</pkgmetadata>
95
96 diff --git a/testdata/repos/network/MetadataUrlCheck/DeadUrl-kde-invent/responses.py b/testdata/repos/network/MetadataUrlCheck/DeadUrl-kde-invent/responses.py
97 new file mode 100644
98 index 00000000..32dade73
99 --- /dev/null
100 +++ b/testdata/repos/network/MetadataUrlCheck/DeadUrl-kde-invent/responses.py
101 @@ -0,0 +1,10 @@
102 +import io
103 +
104 +from requests.models import Response
105 +
106 +r = Response()
107 +r.status_code = 404
108 +r.reason = "Not Found"
109 +r.url = "https://invent.kde.org/pkgcore/pkgcheck"
110 +r.raw = io.StringIO()
111 +responses = [r]