mirror of
https://github.com/clearlinux/autospec.git
synced 2026-06-16 02:45:56 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c1050fe40c | |||
| e661f3a625 | |||
| 874204ec31 | |||
| 80d20893c2 | |||
| 250a6667eb | |||
| c644c18072 | |||
| 94f0e995b2 |
+15
-6
@@ -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)"]),
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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)',
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user