aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-05-23 19:02:18 +0200
committerArthur Zamarin <arthurzam@gentoo.org>2022-05-24 21:48:31 +0300
commitc9aba2c23686bf2aa2eed7ffbdad88ae73272d51 (patch)
tree566c845f7989a8151a344242dab9578d3ff1c309 /testdata
parentnetwork: Do not attempt to verify URL with unknown protocol (diff)
downloadpkgcheck-c9aba2c23686bf2aa2eed7ffbdad88ae73272d51.tar.gz
pkgcheck-c9aba2c23686bf2aa2eed7ffbdad88ae73272d51.tar.bz2
pkgcheck-c9aba2c23686bf2aa2eed7ffbdad88ae73272d51.zip
new check: GH archives missing .gh suffix when pypi is available
Add a new check that verifies that Python packages using GitHub archives use the `.gh.tar.gz` suffix to make them distinct from the sdist tarballs on PyPI. Resolves: https://github.com/pkgcore/pkgcheck/issues/382 Closes: https://github.com/pkgcore/pkgcheck/pull/383 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'testdata')
-rw-r--r--testdata/data/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/expected.json1
-rw-r--r--testdata/data/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/fix.patch18
-rw-r--r--testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/Manifest2
-rw-r--r--testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/PythonGHDistfileSuffix-0.ebuild14
-rw-r--r--testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/PythonGHDistfileSuffix-1.ebuild14
-rw-r--r--testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/PythonGHDistfileSuffix-2.ebuild10
-rw-r--r--testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/metadata.xml7
-rw-r--r--testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffixNoPyPI/Manifest1
-rw-r--r--testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffixNoPyPI/PythonGHDistfileSuffixNoPyPI-1.ebuild14
-rw-r--r--testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffixNoPyPI/metadata.xml4
10 files changed, 85 insertions, 0 deletions
diff --git a/testdata/data/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/expected.json b/testdata/data/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/expected.json
new file mode 100644
index 00000000..7a81666a
--- /dev/null
+++ b/testdata/data/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/expected.json
@@ -0,0 +1 @@
+{"__class__": "PythonGHDistfileSuffix", "category": "PythonGHDistfileSuffixCheck", "package": "PythonGHDistfileSuffix", "version": "1", "filename": "PythonGHDistfileSuffix-1.tar.gz", "uri": "https://github.com/examplesoft/example/archive/v1.tar.gz"}
diff --git a/testdata/data/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/fix.patch b/testdata/data/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/fix.patch
new file mode 100644
index 00000000..64fa2747
--- /dev/null
+++ b/testdata/data/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/fix.patch
@@ -0,0 +1,18 @@
+diff -dupr python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/Manifest fixed/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/Manifest
+--- python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/Manifest 2022-05-23 18:46:35.688579562 +0200
++++ fixed/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/Manifest 2022-05-23 18:57:56.720475178 +0200
+@@ -1 +1 @@
+-DIST PythonGHDistfileSuffix-1.tar.gz 153310 BLAKE2B b7484cd9bebe912f9c8877c0f09df059130c2dc5c4da8c926f8df7945bcb7b255cdf810ce8cd16a987fb5bca3d1e71c088cd894968641db5dfae1c4c059df836 SHA512 86ff9e1c4b9353b1fbb475c7bb9d2a97bd9db8421ea5190b5a84832930b34cb5b79f8c3da68a5eb8db334f06851ec129cc6611a371e47b7c5de7a615feec5e05
++DIST PythonGHDistfileSuffix-1.gh.tar.gz 153310 BLAKE2B b7484cd9bebe912f9c8877c0f09df059130c2dc5c4da8c926f8df7945bcb7b255cdf810ce8cd16a987fb5bca3d1e71c088cd894968641db5dfae1c4c059df836 SHA512 86ff9e1c4b9353b1fbb475c7bb9d2a97bd9db8421ea5190b5a84832930b34cb5b79f8c3da68a5eb8db334f06851ec129cc6611a371e47b7c5de7a615feec5e05
+diff -dupr python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/PythonGHDistfileSuffix-1.ebuild fixed/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/PythonGHDistfileSuffix-1.ebuild
+--- python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/PythonGHDistfileSuffix-1.ebuild 2022-05-23 18:44:44.916287099 +0200
++++ fixed/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/PythonGHDistfileSuffix-1.ebuild 2022-05-23 18:58:08.377420003 +0200
+@@ -7,7 +7,7 @@ DESCRIPTION="Ebuild with tarball missing
+ HOMEPAGE="https://github.com/pkgcore/pkgcheck"
+ SRC_URI="
+ https://github.com/examplesoft/example/archive/v${PV}.tar.gz
+- -> ${P}.tar.gz
++ -> ${P}.gh.tar.gz
+ "
+
+ LICENSE="BSD"
diff --git a/testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/Manifest b/testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/Manifest
new file mode 100644
index 00000000..c56cc71f
--- /dev/null
+++ b/testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/Manifest
@@ -0,0 +1,2 @@
+DIST PythonGHDistfileSuffix-1.zip 153310 BLAKE2B b7484cd9bebe912f9c8877c0f09df059130c2dc5c4da8c926f8df7945bcb7b255cdf810ce8cd16a987fb5bca3d1e71c088cd894968641db5dfae1c4c059df836 SHA512 86ff9e1c4b9353b1fbb475c7bb9d2a97bd9db8421ea5190b5a84832930b34cb5b79f8c3da68a5eb8db334f06851ec129cc6611a371e47b7c5de7a615feec5e05
+DIST PythonGHDistfileSuffix-1.tar.gz 153310 BLAKE2B b7484cd9bebe912f9c8877c0f09df059130c2dc5c4da8c926f8df7945bcb7b255cdf810ce8cd16a987fb5bca3d1e71c088cd894968641db5dfae1c4c059df836 SHA512 86ff9e1c4b9353b1fbb475c7bb9d2a97bd9db8421ea5190b5a84832930b34cb5b79f8c3da68a5eb8db334f06851ec129cc6611a371e47b7c5de7a615feec5e05
diff --git a/testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/PythonGHDistfileSuffix-0.ebuild b/testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/PythonGHDistfileSuffix-0.ebuild
new file mode 100644
index 00000000..f15d6b60
--- /dev/null
+++ b/testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/PythonGHDistfileSuffix-0.ebuild
@@ -0,0 +1,14 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Ebuild with pypi remote-id and no GitHub archives"
+HOMEPAGE="https://github.com/pkgcore/pkgcheck"
+SRC_URI="
+ https://example.com/${P}.tar.gz
+ https://example.com/${P}.zip
+"
+
+LICENSE="BSD"
+SLOT="0"
diff --git a/testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/PythonGHDistfileSuffix-1.ebuild b/testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/PythonGHDistfileSuffix-1.ebuild
new file mode 100644
index 00000000..2699e859
--- /dev/null
+++ b/testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/PythonGHDistfileSuffix-1.ebuild
@@ -0,0 +1,14 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Ebuild with pypi remote-id and missing .gh.tar.gz suffix"
+HOMEPAGE="https://github.com/pkgcore/pkgcheck"
+SRC_URI="
+ https://github.com/examplesoft/example/archive/v${PV}.tar.gz
+ -> ${P}.tar.gz
+"
+
+LICENSE="BSD"
+SLOT="0"
diff --git a/testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/PythonGHDistfileSuffix-2.ebuild b/testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/PythonGHDistfileSuffix-2.ebuild
new file mode 100644
index 00000000..d543b9d2
--- /dev/null
+++ b/testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/PythonGHDistfileSuffix-2.ebuild
@@ -0,0 +1,10 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Ebuild with pypi remote-id and no distfiles"
+HOMEPAGE="https://github.com/pkgcore/pkgcheck"
+
+LICENSE="BSD"
+SLOT="0"
diff --git a/testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/metadata.xml b/testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/metadata.xml
new file mode 100644
index 00000000..74fae2ac
--- /dev/null
+++ b/testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffix/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <upstream>
+ <remote-id type="pypi">frobnicate</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffixNoPyPI/Manifest b/testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffixNoPyPI/Manifest
new file mode 100644
index 00000000..60a16a4e
--- /dev/null
+++ b/testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffixNoPyPI/Manifest
@@ -0,0 +1 @@
+DIST PythonGHDistfileSuffixNoPyPI-1.tar.gz 153310 BLAKE2B b7484cd9bebe912f9c8877c0f09df059130c2dc5c4da8c926f8df7945bcb7b255cdf810ce8cd16a987fb5bca3d1e71c088cd894968641db5dfae1c4c059df836 SHA512 86ff9e1c4b9353b1fbb475c7bb9d2a97bd9db8421ea5190b5a84832930b34cb5b79f8c3da68a5eb8db334f06851ec129cc6611a371e47b7c5de7a615feec5e05
diff --git a/testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffixNoPyPI/PythonGHDistfileSuffixNoPyPI-1.ebuild b/testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffixNoPyPI/PythonGHDistfileSuffixNoPyPI-1.ebuild
new file mode 100644
index 00000000..be35814f
--- /dev/null
+++ b/testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffixNoPyPI/PythonGHDistfileSuffixNoPyPI-1.ebuild
@@ -0,0 +1,14 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Ebuild with missing .gh.tar.gz suffix but without pypi remote-id"
+HOMEPAGE="https://github.com/pkgcore/pkgcheck"
+SRC_URI="
+ https://github.com/examplesoft/example/archive/v${PV}.tar.gz
+ -> ${P}.tar.gz
+"
+
+LICENSE="BSD"
+SLOT="0"
diff --git a/testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffixNoPyPI/metadata.xml b/testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffixNoPyPI/metadata.xml
new file mode 100644
index 00000000..7c900b19
--- /dev/null
+++ b/testdata/repos/python/PythonGHDistfileSuffixCheck/PythonGHDistfileSuffixNoPyPI/metadata.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+</pkgmetadata>