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