diff --git a/ciscoconfparse-1.2.40-fix-tests.patch b/ciscoconfparse-1.2.40-fix-tests.patch new file mode 100644 index 0000000..53f257e --- /dev/null +++ b/ciscoconfparse-1.2.40-fix-tests.patch @@ -0,0 +1,65 @@ +--- a/setup.py ++++ b/setup.py +@@ -15,14 +15,6 @@ def read(fname): + return open(os.path.join(os.path.dirname(__file__), fname)).read() + + +-## Conditionally require the correct ipaddr package in Python2 vs Python3 +-if sys.version_info[0]<3: +- IPADDR = "ipaddr>=2.1.11" +- DNSPYTHON = "dnspython" +-else: +- IPADDR = "ipaddress" +- DNSPYTHON = "dnspython3" +- + setup(name='ciscoconfparse', + version=open(os.path.join(os.path.dirname(os.path.abspath(__file__)), + 'ciscoconfparse', 'version')).read().strip(), +@@ -37,10 +29,7 @@ setup(name='ciscoconfparse', + long_description=read('README.rst'), + include_package_data=True, # See MANIFEST.in for explicit rules + packages=find_packages(), +- use_2to3=True, # Reqd for Windows + Py3 - ref Github issue #32 + zip_safe=False, +- install_requires = [IPADDR, DNSPYTHON, 'colorama'], # Package dependencies here +- #setup_requires=["setuptools_hg"], # setuptools_hg must be installed as a python module + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Plugins', +@@ -57,5 +46,5 @@ setup(name='ciscoconfparse', + 'Topic :: System :: Networking', + 'Topic :: System :: Networking :: Monitoring', + 'Topic :: Software Development :: Libraries :: Python Modules', +- ], ++ ] + ) +--- a/ciscoconfparse/ccp_util.py ++++ b/ciscoconfparse/ccp_util.py +@@ -384,7 +384,7 @@ IPv4Network('172.16.1.0/24') + + + ## Emulate the old behavior of ipaddr.IPv6Network in Python2, which can use +-## IPv6Network with a host address. Google removed that in Python3's ++## IPv6Network with a host address. Google removed that in Python3's + ## ipaddress.py module + class IPv6Obj(object): + """An object to represent IPv6 addresses and IPv6Networks. When :class:`~ccp_util.IPv6Obj` objects are compared or sorted, shorter masks are greater than longer masks. After comparing mask length, numerically higher IP addresses are greater than numerically lower IP addresses. +@@ -651,7 +651,7 @@ class IPv6Obj(object): + + @property + def is_unspecified(self): +- """Returns a boolean for whether this address is not otherwise ++ """Returns a boolean for whether this address is not otherwise + classified""" + return self.network_object.is_unspecified + +--- /dev/null ++++ b/virt_run_tests.sh +@@ -0,0 +1,7 @@ ++#!/bin/sh ++set -xeu ++ ++virtualenv --system-site-packages . ++source bin/activate ++tests/runtests.sh ++deactivate diff --git a/ciscoconfparse-1.2.40.tar.gz b/ciscoconfparse-1.2.40.tar.gz deleted file mode 100644 index 1725f55..0000000 --- a/ciscoconfparse-1.2.40.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:779ac075c4a971ec712d5f3cb0e5284e77ae1dca4e0d2a23a4a54ec33b158e83 -size 260537 diff --git a/ciscoconfparse-1.3.15.tar.gz b/ciscoconfparse-1.3.15.tar.gz new file mode 100644 index 0000000..2414c68 --- /dev/null +++ b/ciscoconfparse-1.3.15.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8f60ea6ee07b6ad922928ac9e91d920d00506e28eb35b6dec417ea209b824ac +size 91490 diff --git a/python-ciscoconfparse.changes b/python-ciscoconfparse.changes index 92c37f7..efd226c 100644 --- a/python-ciscoconfparse.changes +++ b/python-ciscoconfparse.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Tue May 22 08:49:54 UTC 2018 - mcepl@suse.com + +- Uprgade to version 1.3.15 + * Many trivial bug fixes, see CHANGES +- Renamed skip-setuptools-hg-require.patch to + ciscoconfparse-1.2.40-fix-tests.patch + +------------------------------------------------------------------- +Thu Aug 24 13:34:03 UTC 2017 - jmatejek@suse.com + +- singlespec auto-conversion + ------------------------------------------------------------------- Sun Oct 9 17:25:20 UTC 2016 - mardnh@gmx.de @@ -19,3 +32,4 @@ Fri Feb 5 06:59:25 UTC 2016 - tbechtold@suse.com - Initial packaging (version 1.2.39) + diff --git a/python-ciscoconfparse.spec b/python-ciscoconfparse.spec index 17770ed..a0e9634 100644 --- a/python-ciscoconfparse.spec +++ b/python-ciscoconfparse.spec @@ -1,7 +1,7 @@ # # spec file for package python-ciscoconfparse # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,26 +16,31 @@ # +%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-ciscoconfparse -Version: 1.2.40 +Version: 1.3.15 Release: 0 Summary: Parse, Audit, Query, Build, and Modify Cisco IOS-style configurations -License: GPL-3.0+ +License: GPL-3.0-or-later Group: Development/Languages/Python -Url: http://www.pennington.net/py/ciscoconfparse/ -Source: https://pypi.io/packages/source/c/ciscoconfparse/ciscoconfparse-%{version}.tar.gz -# PATCH-FIX-OPENSUSE skip-setuptools-hg-require.patch -Patch0: skip-setuptools-hg-require.patch -BuildRequires: python-colorama -BuildRequires: python-devel -BuildRequires: python-dnspython -BuildRequires: python-ipaddr -BuildRequires: python-setuptools +URL: https://github.com/mpenning/ciscoconfparse +Source: https://files.pythonhosted.org/packages/source/c/ciscoconfparse/ciscoconfparse-%{version}.tar.gz +# PATCH fix tests +Patch0: ciscoconfparse-1.2.40-fix-tests.patch +BuildRequires: %{python_module colorama} +BuildRequires: %{python_module dnspython} +BuildRequires: %{python_module setuptools} +BuildRequires: python2-ipaddress +BuildRequires: python2-mock +# For tests +BuildRequires: %{python_module pytest} +BuildRequires: fdupes +BuildRequires: python-rpm-macros Requires: python-colorama Requires: python-dnspython Requires: python-ipaddr -BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch +%python_subpackages %description ciscoconfparse is a Python library, which parses through Cisco IOS-style @@ -52,19 +57,25 @@ relationships. %prep %setup -q -n ciscoconfparse-%{version} -%patch0 -p1 +%autopatch -p1 %build -python setup.py build +%python_build %install -python setup.py install --prefix=%{_prefix} --root=%{buildroot} +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} -%files -%defattr(-,root,root,-) -%doc CHANGES LICENSE README.rst +%check +# Upstream has broken tests. +# https://github.com/mpenning/ciscoconfparse/issues/106 +# %%python_expand PYTHONPATH=%%{buildroot}%%{$python_sitelib} py.test-%%{$python_version} + +%files %{python_files} +%license LICENSE +%doc CHANGES README.rst %{python_sitelib}/ciscoconfparse %{python_sitelib}/version_info -%{python_sitelib}/ciscoconfparse-%{version}-py%{py_ver}.egg-info +%{python_sitelib}/ciscoconfparse-%{version}-py%{python_version}.egg-info %changelog diff --git a/skip-setuptools-hg-require.patch b/skip-setuptools-hg-require.patch deleted file mode 100644 index 00101cf..0000000 --- a/skip-setuptools-hg-require.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: ciscoconfparse-1.2.39/setup.py -=================================================================== ---- ciscoconfparse-1.2.39.orig/setup.py -+++ ciscoconfparse-1.2.39/setup.py -@@ -42,7 +42,7 @@ setup(name='ciscoconfparse', - use_2to3=True, # Reqd for Windows + Py3 - ref Github issue #32 - zip_safe=False, - install_requires = [IPADDR, DNSPYTHON, 'colorama'], # Package dependencies here -- setup_requires=["setuptools_hg"], # setuptools_hg must be installed as a python module -+ #setup_requires=["setuptools_hg"], # setuptools_hg must be installed as a python module - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Plugins',