diff --git a/python-acitoolkit-python-310.patch b/python-acitoolkit-python-310.patch new file mode 100644 index 0000000..5c99423 --- /dev/null +++ b/python-acitoolkit-python-310.patch @@ -0,0 +1,20 @@ +diff --git a/acitoolkit/acitoolkit.py b/acitoolkit/acitoolkit.py +index 3c4b0f61..495bf690 100755 +--- a/acitoolkit/acitoolkit.py ++++ b/acitoolkit/acitoolkit.py +@@ -30,7 +30,13 @@ + """ Main ACI Toolkit module + This is the main module that comprises the ACI Toolkit. + """ +-from collections import Sequence ++try: ++ # Python <=3.9 ++ from collections import Sequence ++except ImportError: ++ # Python > 3.8 ++ from collections.abc import Sequence ++ + import logging + from operator import attrgetter, itemgetter + import re + diff --git a/python-acitoolkit.changes b/python-acitoolkit.changes index 8e5d3ae..633f51c 100644 --- a/python-acitoolkit.changes +++ b/python-acitoolkit.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Jan 28 10:10:09 UTC 2022 - pgajdos@suse.com + +- fix for python 3.10 +- added patches + fix https://github.com/datacenter/acitoolkit/commit/629b84887dd0f0183b81efc8adb16817f985541a + + python-acitoolkit-python-310.patch + ------------------------------------------------------------------- Thu Mar 28 10:10:24 UTC 2019 - Tomáš Chvátal diff --git a/python-acitoolkit.spec b/python-acitoolkit.spec index ec76651..1f8e4e7 100644 --- a/python-acitoolkit.spec +++ b/python-acitoolkit.spec @@ -1,7 +1,7 @@ # # spec file for package python-acitoolkit # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,6 +26,8 @@ Group: Development/Languages/Python URL: http://github.com/datacenter/acitoolkit Source: https://github.com/datacenter/acitoolkit/archive/v%{version}.tar.gz Patch0: remove-app-dependency.patch +# https://github.com/datacenter/acitoolkit/commit/629b84887dd0f0183b81efc8adb16817f985541a +Patch1: python-acitoolkit-python-310.patch BuildRequires: %{python_module graphviz} BuildRequires: %{python_module jsonschema} BuildRequires: %{python_module mock} @@ -89,10 +91,11 @@ Python samples for using acitoolkit for programming ACI. %setup -q -n acitoolkit-%{version} # Remove dependencies of applications/ and samples/ from the library %patch0 -p1 +%patch1 -p1 chmod -x LICENSE NOTICE -sed -i '1{/^#!.*env python/d}' acitoolkit/*.py samples/*.py samples/switch-commands/*.py +sed -i '1{/^#!.*env python/d}' acitoolkit/*.py samples/*.py samples/switch-commands/*.py rm applications/cableplan/.coverage applications/eventfeeds/.gitignore