aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-03-04 09:20:28 +0000
committerArthur Zamarin <arthurzam@gentoo.org>2023-03-05 19:13:22 +0200
commite8d16ecb9765c32694b7a518381aee94ef5d9108 (patch)
treecad4cd6b3a4153e43d735b1108dc44d2a96e37f8 /tests
parentPythonMissingSCMDependency: update to new pkg names (diff)
downloadpkgcheck-e8d16ecb9765c32694b7a518381aee94ef5d9108.tar.gz
pkgcheck-e8d16ecb9765c32694b7a518381aee94ef5d9108.tar.bz2
pkgcheck-e8d16ecb9765c32694b7a518381aee94ef5d9108.zip
checks: git: add PythonPEP517WithoutRevbump
Warn when DISTUTILS_USE_PEP517 is added or removed from an ebuild without a new revision. This is important because PEP517 affects a package's installed files anyway and it's important to ensure that dependencies work correctly against it, but also because e.g. config files or other data files might either now be installed to the wrong location or not installed at all. Developers must inspect the image before/after (e.g. using iwdevtools) to avoid issues. Fixes: https://github.com/pkgcore/pkgcheck/issues/498 Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/checks/test_git.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/checks/test_git.py b/tests/checks/test_git.py
index 57fc28ac..5deaad71 100644
--- a/tests/checks/test_git.py
+++ b/tests/checks/test_git.py
@@ -675,6 +675,25 @@ class TestGitPkgCommitsCheck(ReportTestCase):
r = self.assertReport(self.check, self.source)
assert r == git_mod.SrcUriChecksumChange(distfile[1], pkg=CP("cat/pkg"))
+ def test_python_pep517_change(self):
+ with open(pjoin(self.parent_git_repo.path, "eclass/distutils-r1.eclass"), "w") as f:
+ f.write("# Copyright 1999-2019 Gentoo Authors")
+ self.parent_git_repo.add_all("eclass: add distutils-r1")
+
+ # add pkgs to parent repo
+ self.parent_repo.create_ebuild("newcat/newpkg-1", data="inherit distutils-r1")
+ self.parent_git_repo.add_all("newcat/newpkg: initial import")
+ # pull changes to child repo
+ self.child_git_repo.run(["git", "pull", "origin", "main"])
+ # change an existing ebuild to have DISTUTILS_USE_PEP517 with no revbump
+ with open(pjoin(self.child_git_repo.path, "newcat/newpkg/newpkg-1.ebuild"), "a") as f:
+ f.write("\nDISTUTILS_USE_PEP517=setuptools\n")
+ self.child_git_repo.add_all("newcat/newpkg: use PEP517")
+ self.init_check()
+ r = self.assertReport(self.check, self.source)
+ expected = git_mod.PythonPEP517WithoutRevbump(pkg=CPV("newcat/newpkg-1"))
+ assert r == expected
+
def test_src_uri_change(self):
distfile = [
"DIST",