commit 4d87721810d8322d78de118ee7df0d4b9e9f495fcb6b1682e1664c3d5acce663 Author: Steve Kowalik Date: Fri Dec 20 04:17:25 2024 +0000 - Switch to autosetup, pyproject and pyunittest macros. - No more greedy globs in %files. - Add patch no-makesuite.patch: * Use the load tests protocol to run the testsuite. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-BitVector?expand=0&rev=6 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/BitVector-3.5.0.tar.gz b/BitVector-3.5.0.tar.gz new file mode 100644 index 0000000..b913606 --- /dev/null +++ b/BitVector-3.5.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cac2fbccf11e325115827ed7be03e5fd62615227b0bbf3fa5a18a842a221839c +size 161704 diff --git a/no-makesuite.patch b/no-makesuite.patch new file mode 100644 index 0000000..672ee25 --- /dev/null +++ b/no-makesuite.patch @@ -0,0 +1,142 @@ +Index: BitVector-3.5.0/TestBitVector/Test.py +=================================================================== +--- BitVector-3.5.0.orig/TestBitVector/Test.py ++++ BitVector-3.5.0/TestBitVector/Test.py +@@ -1,38 +1,8 @@ + #!/usr/bin/env python + + import unittest +-import TestBooleanLogic +-import TestConstructors +-import TestComparisonOps +-import TestPermutations +-import TestCircularShifts ++ + + class BitVectorTestCase( unittest.TestCase ): + def checkVersion(self): + import BitVector +- +- +-testSuites = [unittest.makeSuite(BitVectorTestCase, 'check')] +- +-for test_type in [ +- TestConstructors, +- TestBooleanLogic, +- TestComparisonOps, +- TestPermutations, +- TestCircularShifts, +- ]: +- testSuites.append(test_type.getTestSuites('check')) +- +-def getTestDirectory(): +- try: +- return os.path.abspath(os.path.dirname(__file__)) +- except: +- return '.' +- +-import os +- +-os.chdir(getTestDirectory()) +- +-runner = unittest.TextTestRunner() +-runner.run(unittest.TestSuite(testSuites)) +- +Index: BitVector-3.5.0/TestBitVector/TestBooleanLogic.py +=================================================================== +--- BitVector-3.5.0.orig/TestBitVector/TestBooleanLogic.py ++++ BitVector-3.5.0/TestBitVector/TestBooleanLogic.py +@@ -36,8 +36,3 @@ class BooleanLogicTestCase(unittest.Test + if ( args[0].size == args[1].size ): + print(e) + print(" BOOLEAN LOGIC TEST FAILED") +- +-def getTestSuites(type): +- return unittest.TestSuite([ +- unittest.makeSuite(BooleanLogicTestCase, type) +- ]) +Index: BitVector-3.5.0/TestBitVector/TestCircularShifts.py +=================================================================== +--- BitVector-3.5.0.orig/TestBitVector/TestCircularShifts.py ++++ BitVector-3.5.0/TestBitVector/TestCircularShifts.py +@@ -24,8 +24,3 @@ class CircularShiftTestCase(unittest.Tes + except Exception as e: + print(e) + print(" CIRCULAR SHIFT TEST FAILED") +- +-def getTestSuites(type): +- return unittest.TestSuite([ +- unittest.makeSuite(CircularShiftTestCase, type) +- ]) +Index: BitVector-3.5.0/TestBitVector/TestComparisonOps.py +=================================================================== +--- BitVector-3.5.0.orig/TestBitVector/TestComparisonOps.py ++++ BitVector-3.5.0/TestBitVector/TestComparisonOps.py +@@ -39,8 +39,3 @@ class ComparisonTestCases(unittest.TestC + except Exception as e: + print(e) + print(" COMPARISON TEST FAILED") +- +-def getTestSuites(type): +- return unittest.TestSuite([ +- unittest.makeSuite(ComparisonTestCases, type) +- ]) +Index: BitVector-3.5.0/TestBitVector/TestConstructors.py +=================================================================== +--- BitVector-3.5.0.orig/TestBitVector/TestConstructors.py ++++ BitVector-3.5.0/TestBitVector/TestConstructors.py +@@ -11,7 +11,7 @@ constructorTests = [ + (('intVal', '5678'), '1011000101110'), + (('bitstring', '00110011'), '00110011'), + (('streamobject', '111100001111'), '111100001111'), +- (('filename', 'testinput1.txt'), '0100000100100000011010000111010101101110011001110111001001111001'), ++ (('filename', 'TestBitVector/testinput1.txt'), '0100000100100000011010000111010101101110011001110111001001111001'), + ] + + class ConstructorTestCases(unittest.TestCase): +@@ -43,8 +43,3 @@ class ConstructorTestCases(unittest.Test + except Exception as e: + print(e) + print(" CONSTRUCTOR TEST FAILED") +- +-def getTestSuites(type): +- return unittest.TestSuite([ +- unittest.makeSuite(ConstructorTestCases, type) +- ]) +Index: BitVector-3.5.0/TestBitVector/TestPermutations.py +=================================================================== +--- BitVector-3.5.0.orig/TestBitVector/TestPermutations.py ++++ BitVector-3.5.0/TestBitVector/TestPermutations.py +@@ -24,8 +24,3 @@ class PermutationTestCase(unittest.TestC + except Exception as e: + print(e) + print("Permutation test failed") +- +-def getTestSuites(type): +- return unittest.TestSuite([ +- unittest.makeSuite(PermutationTestCase, type) +- ]) +Index: BitVector-3.5.0/TestBitVector/__init__.py +=================================================================== +--- /dev/null ++++ BitVector-3.5.0/TestBitVector/__init__.py +@@ -0,0 +1,19 @@ ++import os ++import unittest ++ ++ ++def getTestDirectory(): ++ try: ++ return os.path.abspath(os.path.dirname(__file__)) ++ except: ++ return '.' ++ ++ ++def load_tests(loader, tests, pattern): ++ loader.testMethodPrefix = 'check' ++ tests.addTests(loader.discover(start_dir=getTestDirectory(), pattern="Test*.py")) ++ return tests ++ ++ ++if __name__ == '__main__': ++ unittest.main() diff --git a/python-BitVector.changes b/python-BitVector.changes new file mode 100644 index 0000000..e1c9d0b --- /dev/null +++ b/python-BitVector.changes @@ -0,0 +1,33 @@ +------------------------------------------------------------------- +Fri Dec 20 04:15:58 UTC 2024 - Steve Kowalik + +- Switch to autosetup, pyproject and pyunittest macros. +- No more greedy globs in %files. +- Add patch no-makesuite.patch: + * Use the load tests protocol to run the testsuite. + +------------------------------------------------------------------- +Fri Aug 13 13:55:15 UTC 2021 - John Paul Adrian Glaubitz + +- Update to 3.5.0: + * Version 3.5.0 makes the module ready for Python 3.9. The methods + "array.fromstring" and "array.tostring" will not exist in Python 3.9. + One additional change that I have made is that I have gone back to my + older implementation for __add__ on account of a bug in the new + implementation that I had incorporated in Version 3.4.9. + +------------------------------------------------------------------- +Mon Apr 1 12:55:55 UTC 2019 - Tomáš Chvátal + +- Update to 3.4.9: + * Version 3.4.9, in addition to implementing __iadd__, also includes a + significantly faster implementation for __add__. For extending a given + instance of BitVector, the implementation for __iadd__ adds bits to the + existing instance as opposed to creating a new instance. These changes + to the module should make it easier to solve larger problems more + quickly with BitVector. + +------------------------------------------------------------------- +Fri Aug 10 15:46:03 UTC 2018 - tchvatal@suse.com + +- Initial version, needed by python-raet diff --git a/python-BitVector.spec b/python-BitVector.spec new file mode 100644 index 0000000..141003c --- /dev/null +++ b/python-BitVector.spec @@ -0,0 +1,62 @@ +# +# spec file for package python-BitVector +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: python-BitVector +Version: 3.5.0 +Release: 0 +Summary: A memory-efficient packed representation for bit arrays in pure Python +License: Python-2.0 +URL: https://engineering.purdue.edu/kak/dist/ +Source: https://files.pythonhosted.org/packages/source/B/BitVector/BitVector-%{version}.tar.gz +# PATCH-FIX-OPENSUSE Use load tests protocol to run the testsuite +Patch0: no-makesuite.patch +BuildRequires: %{python_module pip} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +BuildArch: noarch +%python_subpackages + +%description +With regard to the basic purpose of the module, it defines +the BitVector class as a memory-efficient packed +representation for bit arrays. The class comes with a large +number of methods for using the representation in diverse +applications such as computer security, computer vision, +etc. + +%prep +%autosetup -p1 -n BitVector-%{version} + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pyunittest -v TestBitVector + +%files %{python_files} +%doc README +%{python_sitelib}/BitVector +%{python_sitelib}/BitVector-%{version}.dist-info + +%changelog