Compare commits

...

7 Commits
v2 ... v3

Author SHA1 Message Date
William Douglas c1050fe40c Add more bits to the blacklist
A poorly parsed license file caused these to need to be added.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-12-04 15:28:00 -08:00
William Douglas e661f3a625 Update test function assert call name
Signed-off-by: William Douglas <william.douglas@intel.com>
2023-11-13 10:08:32 -08:00
William Douglas 874204ec31 Correct tests based on warnings
Previous code would emit:
SyntaxWarning: invalid escape sequence

Correct this by removing the escapes as they are not necessary.

Also add a missing buildreq that is detected correctly after the
fix.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-11-13 10:08:32 -08:00
Brett T. Warden 80d20893c2 Stop redirecting libproxy dep to pacrunner-dev
We fixed the real libproxy a while back to query pacrunner itself via
dbus, so pacrunner no longer provides a libproxy shim, nor the
pacrunner-dev package.
2023-11-13 09:21:01 -08:00
William Douglas 250a6667eb Add global requires ban handling logic
Some packages should not be able to be added to any subpkg. Add
handling for this case.

Also as pypi-nose is no longer usable so ban it from being added as a
dependency.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-10-20 12:23:35 -07:00
William Douglas c644c18072 Update license bans
Signed-off-by: William Douglas <william.douglas@intel.com>
2023-10-18 13:35:42 -07:00
William Douglas 94f0e995b2 Ban setuptools submodule that is no longer needed
The submodule's function is now incorporated into setuptools so
banlist it.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-10-18 13:35:42 -07:00
6 changed files with 42 additions and 17 deletions
+15 -6
View File
@@ -268,10 +268,13 @@ class Requirements(object):
def __init__(self, url):
"""Initialize Default requirements settings."""
self.banned_requires = {None: set(["futures",
"configparser",
"typing",
"ipaddress"])}
self.banned_anywhere_requires = set(["futures",
"configparser",
"typing",
"ipaddress",
"pypi-nose",
"pypi(nose)"])
self.banned_requires = {None: set()}
self.buildreqs = set()
self.buildreqs_cache = set()
self.requires = {None: set(), "pypi": set()}
@@ -293,7 +296,11 @@ class Requirements(object):
"configparser",
"setuptools_scm[toml]",
"typing",
"ipaddress"])
"ipaddress",
"pypi-nose",
"pypi(setuptools_scm_git_archive)",
"pypi(setuptools_changelog_shortener)",
"pypi(nose)"])
self.autoreconf_reqs = ["gettext-bin",
"automake-dev",
"automake",
@@ -346,6 +353,8 @@ class Requirements(object):
banned_requires = self.banned_requires[subpkg] = set()
if req in banned_requires:
return False
if req in self.banned_anywhere_requires:
return False
if req not in self.buildreqs and req not in packages and not override:
if req:
@@ -397,7 +406,7 @@ class Requirements(object):
if line.startswith('#'):
return
pat_reqs = [(r"AC_CHECK_FUNC\([tgetent]", ["ncurses-devel"]),
pat_reqs = [(r"AC_CHECK_FUNC([tgetent]", ["ncurses-devel"]),
("PROG_INTLTOOL", ["intltool"]),
("GETTEXT_PACKAGE", ["gettext", "perl(XML::Parser)"]),
("AM_GLIB_GNU_GETTEXT", ["gettext", "perl(XML::Parser)"]),
-5
View File
@@ -3,7 +3,6 @@
# This file is sorted with LC_COLLATE=C
# Lines beginning with '#' are ignored.
# For patterns that start with '#', escape the '#' as '\#'.
'nose', pypi(nose)
'numpy', pypi(numpy)
'pexpect', pypi(pexpect)
-lEGL, mesa-dev
@@ -97,7 +96,6 @@
-lpcap, libpcap-dev
-lpcre, pcre-dev
-lpopt, popt-dev
-lproxy, pacrunner-dev
-lrdmacm, rdma-core-dev
-lreadline, readline-dev
-lsecret, libsecret-dev
@@ -1037,8 +1035,6 @@ libpng, pkgconfig(libpng)
libpng-config, pkgconfig(libpng)
libpng/png.h, pkgconfig(libpng)
libportal, libportal-dev
libproxy-1.0 pkg-config data, pacrunner-dev
libproxy-1.0, pacrunner-dev
libpsl, libpsl-dev
libqhull/libqhull.h, qhull-dev
library ldap, openldap-dev
@@ -1132,7 +1128,6 @@ nfsidmap.h, libnfsidmap-dev
nghttp, nghttp2-dev
nl_handle_alloc, libnl-dev
node, nodejs
nose, pypi-nose
nosexcover, nosexcover
notmuch.h, notmuch-dev
nroff, groff
+13
View File
@@ -3,6 +3,7 @@
# This file is sorted with LC_COLLATE=C
# Lines beginning with '#' are ignored.
# For strings that start with '#', escape the '#' as '\#'.
=========================
%
%license
(LGPL)
@@ -13,6 +14,7 @@
-MIT
-or-
.git
.md
.mit
.txt
/
@@ -25,6 +27,7 @@
3-clause
3BSD
@CPACK_RPM_PACKAGE_LICENSE@
AGPLv3+
ALv2
AND
APL-2.0
@@ -157,3 +160,13 @@ with
your
|
~
Permission
a
charge
copy
granted
hereby
obtaining
of
person
to
+11 -3
View File
@@ -80,6 +80,13 @@ class TestBuildreq(unittest.TestCase):
self.assertFalse(self.reqs.add_requires('testreq', []))
self.assertNotIn('testreq', self.reqs.requires[None])
def test_add_banned_requires(self):
"""
Test add_requires with banned new req (override buildreq).
"""
self.assertFalse(self.reqs.add_requires('pypi(nose)', [], override=True))
self.assertNotIn('testreq', self.reqs.requires[None])
def test_ban_provides(self):
"""
Test ban_provides with prov already present in provides
@@ -129,20 +136,20 @@ class TestBuildreq(unittest.TestCase):
"""
Test configure_ac_line with standard pattern
"""
self.reqs.configure_ac_line('AC_CHECK_FUNC\([tgetent])', False)
self.reqs.configure_ac_line('AC_CHECK_FUNC([tgetent])', False)
self.assertIn('ncurses-devel', self.reqs.buildreqs)
def test_configure_ac_line_comment(self):
"""
Test configure_ac_line with commented line
"""
self.reqs.configure_ac_line('# AC_CHECK_FUNC\([tgetent])', False)
self.reqs.configure_ac_line('# AC_CHECK_FUNC([tgetent])', False)
self.assertEqual(self.reqs.buildreqs, set())
def test_configure_ac_line_pkg_check_modules(self):
"""
Test the somewhat complicated logic of configure_ac_line check for the
PKG_CHECK_MODULES\((.*?)\) line.
PKG_CHECK_MODULES((.*?)) line.
"""
self.reqs.configure_ac_line(
'PKG_CHECK_MODULES(prefix, '
@@ -193,6 +200,7 @@ class TestBuildreq(unittest.TestCase):
self.assertEqual(self.reqs.buildreqs,
set(['gettext',
'ncurses-devel',
'perl(XML::Parser)',
'pkgconfig(module2)',
'pkgconfig(module)',
+1 -1
View File
@@ -10,7 +10,7 @@ class TestGeneral(unittest.TestCase):
interpolation=None argument
"""
grep_cmd = ["grep", "-re",
"ConfigParser(.*\(^interpolation=None\).*)",
"ConfigParser(.*(^interpolation=None).*)",
"autospec"]
try:
output = subprocess.check_output(grep_cmd).decode('utf-8')
+2 -2
View File
@@ -75,7 +75,7 @@ class TestLicense(unittest.TestCase):
conf.license_show = "license.show.url"
license.license_from_copying_hash('tests/COPYING_TEST', '', conf, '')
self.assertEquals(license.licenses, [])
self.assertEqual(license.licenses, [])
def test_license_from_copying_hash_bad_license(self):
"""
@@ -89,7 +89,7 @@ class TestLicense(unittest.TestCase):
with patch('license.get_contents', m_open, create=True):
license.license_from_copying_hash('copying.txt', '', conf, '')
self.assertEquals(license.licenses, [])
self.assertEqual(license.licenses, [])
def test_license_from_copying_hash_license_server_excep(self):
"""