aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2023-03-21 17:37:28 +0100
committerArthur Zamarin <arthurzam@gentoo.org>2023-03-24 16:56:06 +0300
commit583f156d0d89e946104f8bc92921d0206ff7d89e (patch)
tree1fe343ae61304327b83263cc4d26e9f62d2f0275 /testdata/repos
parentpython: Rewrite "one PyPI URL" check to reuse PYPI_SDIST_URI_RE (diff)
downloadpkgcheck-583f156d0d89e946104f8bc92921d0206ff7d89e.tar.gz
pkgcheck-583f156d0d89e946104f8bc92921d0206ff7d89e.tar.bz2
pkgcheck-583f156d0d89e946104f8bc92921d0206ff7d89e.zip
python: Include PYPI_PN opportunities in PythonInlinePyPIURI
Fixes #568 Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/pkgcore/pkgcheck/pull/569 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'testdata/repos')
-rw-r--r--testdata/repos/python/PythonFetchableCheck/python-inline-pypi-url/Manifest2
-rw-r--r--testdata/repos/python/PythonFetchableCheck/python-inline-pypi-url/python-inline-pypi-url-2000.ebuild15
-rw-r--r--testdata/repos/python/eclass/pypi.eclass15
3 files changed, 27 insertions, 5 deletions
diff --git a/testdata/repos/python/PythonFetchableCheck/python-inline-pypi-url/Manifest b/testdata/repos/python/PythonFetchableCheck/python-inline-pypi-url/Manifest
index d541566b..b9341b16 100644
--- a/testdata/repos/python/PythonFetchableCheck/python-inline-pypi-url/Manifest
+++ b/testdata/repos/python/PythonFetchableCheck/python-inline-pypi-url/Manifest
@@ -3,3 +3,5 @@ DIST python.inline.pypi.url-1.tar.gz 153310 BLAKE2B b7484cd9bebe912f9c8877c0f09d
DIST python_inline-pypi-url-100.tar.gz 153310 BLAKE2B b7484cd9bebe912f9c8877c0f09df059130c2dc5c4da8c926f8df7945bcb7b255cdf810ce8cd16a987fb5bca3d1e71c088cd894968641db5dfae1c4c059df836 SHA512 86ff9e1c4b9353b1fbb475c7bb9d2a97bd9db8421ea5190b5a84832930b34cb5b79f8c3da68a5eb8db334f06851ec129cc6611a371e47b7c5de7a615feec5e05
DIST Python-inline-pypi-url-200.tar.gz 153310 BLAKE2B b7484cd9bebe912f9c8877c0f09df059130c2dc5c4da8c926f8df7945bcb7b255cdf810ce8cd16a987fb5bca3d1e71c088cd894968641db5dfae1c4c059df836 SHA512 86ff9e1c4b9353b1fbb475c7bb9d2a97bd9db8421ea5190b5a84832930b34cb5b79f8c3da68a5eb8db334f06851ec129cc6611a371e47b7c5de7a615feec5e05
DIST python_inline_pypi_url-1000.tar.gz 153310 BLAKE2B b7484cd9bebe912f9c8877c0f09df059130c2dc5c4da8c926f8df7945bcb7b255cdf810ce8cd16a987fb5bca3d1e71c088cd894968641db5dfae1c4c059df836 SHA512 86ff9e1c4b9353b1fbb475c7bb9d2a97bd9db8421ea5190b5a84832930b34cb5b79f8c3da68a5eb8db334f06851ec129cc6611a371e47b7c5de7a615feec5e05
+DIST python_inline_pypi_url-2000.tar.gz 153310 BLAKE2B b7484cd9bebe912f9c8877c0f09df059130c2dc5c4da8c926f8df7945bcb7b255cdf810ce8cd16a987fb5bca3d1e71c088cd894968641db5dfae1c4c059df836 SHA512 86ff9e1c4b9353b1fbb475c7bb9d2a97bd9db8421ea5190b5a84832930b34cb5b79f8c3da68a5eb8db334f06851ec129cc6611a371e47b7c5de7a615feec5e05
+DIST python.inline-pypi-url_vectors-151.tar.gz 153310 BLAKE2B b7484cd9bebe912f9c8877c0f09df059130c2dc5c4da8c926f8df7945bcb7b255cdf810ce8cd16a987fb5bca3d1e71c088cd894968641db5dfae1c4c059df836 SHA512 86ff9e1c4b9353b1fbb475c7bb9d2a97bd9db8421ea5190b5a84832930b34cb5b79f8c3da68a5eb8db334f06851ec129cc6611a371e47b7c5de7a615feec5e05
diff --git a/testdata/repos/python/PythonFetchableCheck/python-inline-pypi-url/python-inline-pypi-url-2000.ebuild b/testdata/repos/python/PythonFetchableCheck/python-inline-pypi-url/python-inline-pypi-url-2000.ebuild
new file mode 100644
index 00000000..2598d665
--- /dev/null
+++ b/testdata/repos/python/PythonFetchableCheck/python-inline-pypi-url/python-inline-pypi-url-2000.ebuild
@@ -0,0 +1,15 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Ebuild with two PyPI URLs"
+HOMEPAGE="https://example.com"
+SRC_URI="
+ mirror://pypi/${PN::1}/${PN/-/.}/${PN//-/_}-${PV}.tar.gz
+ mirror://pypi/${PN::1}/${PN/-/.}_vectors/${PN/-/.}_vectors-151.tar.gz
+"
+S=${WORKDIR}/${PN//-/_}-${PV}
+
+LICENSE="BSD"
+SLOT="0"
diff --git a/testdata/repos/python/eclass/pypi.eclass b/testdata/repos/python/eclass/pypi.eclass
index af21dc7f..8485bf6e 100644
--- a/testdata/repos/python/eclass/pypi.eclass
+++ b/testdata/repos/python/eclass/pypi.eclass
@@ -13,6 +13,11 @@
# @DEFAULT_UNSET
# @DESCRIPTION:
+# @ECLASS_VARIABLE: PYPI_PN
+# @PRE_INHERIT
+# @DESCRIPTION:
+: ${PYPI_PN:=${PN}}
+
# @FUNCTION: pypi_normalize_name
# @USAGE: <name>
# @DESCRIPTION:
@@ -56,7 +61,7 @@ pypi_sdist_url() {
shift
fi
- local project=${1-"${PN}"}
+ local project=${1-"${PYPI_PN}"}
local version=${2-"$(pypi_translate_version "${PV}")"}
local suffix=${3-.tar.gz}
local fn_project=${project}
@@ -69,7 +74,7 @@ pypi_sdist_url() {
# @USAGE: [<project> [<version> [<python-tag> [<abi-platform-tag>]]]]
# @DESCRIPTION:
pypi_wheel_name() {
- local project=$(pypi_normalize_name "${1-"${PN}"}")
+ local project=$(pypi_normalize_name "${1-"${PYPI_PN}"}")
local version=${2-"$(pypi_translate_version "${PV}")"}
local pytag=${3-py3}
local abitag=${4-none-any}
@@ -87,7 +92,7 @@ pypi_wheel_url() {
fi
local filename=$(pypi_wheel_name "${@}")
- local project=${1-"${PN}"}
+ local project=${1-"${PYPI_PN}"}
local version=${2-"$(pypi_translate_version "${PV}")"}
local pytag=${3-py3}
printf "https://files.pythonhosted.org/packages/%s" \
@@ -100,8 +105,8 @@ pypi_wheel_url() {
if [[ ${PYPI_NO_NORMALIZE} ]]; then
SRC_URI="$(pypi_sdist_url --no-normalize)"
- S="${WORKDIR}/${PN}-$(pypi_translate_version "${PV}")"
+ S="${WORKDIR}/${PYPI_PN}-$(pypi_translate_version "${PV}")"
else
SRC_URI="$(pypi_sdist_url)"
- S="${WORKDIR}/$(pypi_normalize_name "${PN}")-$(pypi_translate_version "${PV}")"
+ S="${WORKDIR}/$(pypi_normalize_name "${PYPI_PN}")-$(pypi_translate_version "${PV}")"
fi