From 227a0e669aca54875c21db7a6e5baf511608bce4 Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Fri, 5 Sep 2025 22:19:58 +0100 Subject: [PATCH] gnu: Remove python-unittest2. This package is no longer needed as per: "unittest2 is a backport of the new features added to the unittest testing framework in Python 2.7 and onwards.", it has no users in Guix. * gnu/packages/check.scm (python-unittest2): Delete variable. * gnu/local.mk (dist_patch_DATA): Deregister 2 patches. * gnu/packages/patches/python-unittest2-python3-compat.patch: Delete file. * gnu/packages/patches/python-unittest2-remove-argparse.patch: Likewise. Change-Id: I7d67223cdd5a0e656a299d83ac28248d7db7c321 --- gnu/local.mk | 2 - gnu/packages/check.scm | 30 ------------ .../python-unittest2-python3-compat.patch | 46 ------------------- .../python-unittest2-remove-argparse.patch | 11 ----- 4 files changed, 89 deletions(-) delete mode 100644 gnu/packages/patches/python-unittest2-python3-compat.patch delete mode 100644 gnu/packages/patches/python-unittest2-remove-argparse.patch diff --git a/gnu/local.mk b/gnu/local.mk index 0e56f89e52bfbd220dab6deb7386de9467393a2e..d32d80e732ffb2efc83c5358033c017d307ee700 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2177,8 +2177,6 @@ dist_patch_DATA = \ %D%/packages/patches/python-pytorch-system-libraries.patch \ %D%/packages/patches/python-pytorch-without-kineto.patch \ %D%/packages/patches/python-robotframework-sshlibrary-rf5-compat.patch \ - %D%/packages/patches/python-unittest2-python3-compat.patch \ - %D%/packages/patches/python-unittest2-remove-argparse.patch \ %D%/packages/patches/python-vaex-core-fix-tsl-use.patch \ %D%/packages/patches/python-vega-datasets-remove-la-riots-code.patch \ %D%/packages/patches/python-versioneer-guix-support.patch \ diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index c320ba13baa97b043ad1e11780cd1c5ab4a23ef3..085119a6603515fa24a7a3528a82c9707e0a6859 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -1557,36 +1557,6 @@ better plugin api, being easier for users to configure, and simplifying internal interfaces and processes.") (license license:bsd-2))) -(define-public python-unittest2 - (package - (name "python-unittest2") - (version "1.1.0") - (source - (origin - (method url-fetch) - (uri (pypi-uri "unittest2" version)) - (patches - (search-patches "python-unittest2-python3-compat.patch" - "python-unittest2-remove-argparse.patch")) - (sha256 - (base32 - "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212")))) - (build-system python-build-system) - (arguments - '(#:phases - (modify-phases %standard-phases - (replace 'check - (lambda _ - (zero? (system* "python" "-m" "unittest2" "discover" "--verbose"))))))) - (propagated-inputs - (list python-six python-traceback2)) - (home-page "https://pypi.org/project/unittest2/") - (synopsis "Python unit testing library") - (description - "Unittest2 is a replacement for the unittest module in the Python -standard library.") - (license license:psfl))) - (define-public python-pytest (package (name "python-pytest") diff --git a/gnu/packages/patches/python-unittest2-python3-compat.patch b/gnu/packages/patches/python-unittest2-python3-compat.patch deleted file mode 100644 index 68fbccacd06bf38e66460c12846b7bca66fc2d8e..0000000000000000000000000000000000000000 --- a/gnu/packages/patches/python-unittest2-python3-compat.patch +++ /dev/null @@ -1,46 +0,0 @@ -Skip tests that fail with newer versions of Python. - -Patch copied from Gentoo: - -https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-python/unittest2/files/unittest2-1.1.0-python3.5-test.patch - -diff --git a/unittest2/test/test_loader.py b/unittest2/test/test_loader.py -index 683f662..347eea5 100644 ---- a/unittest2/test/test_loader.py -+++ b/unittest2/test/test_loader.py -@@ -509,6 +509,7 @@ class Test_TestLoader(unittest2.TestCase): - # - # What happens when an impossible name is given, relative to the provided - # `module`? -+ @unittest.skipIf(sys.version_info[:2] >= (3, 5), "python 3.5 has problems here") - def test_loadTestsFromName__relative_malformed_name(self): - loader = unittest.TestLoader() - -@@ -811,6 +812,7 @@ class Test_TestLoader(unittest2.TestCase): - # TestCase or TestSuite instance." - # - # What happens when presented with an impossible module name? -+ @unittest.skipIf(sys.version_info[:2] >= (3, 5), "python 3.5 has problems here") - def test_loadTestsFromNames__malformed_name(self): - loader = unittest2.TestLoader() - -@@ -918,6 +920,7 @@ class Test_TestLoader(unittest2.TestCase): - # "The method optionally resolves name relative to the given module" - # - # What happens when presented with an impossible attribute name? -+ @unittest.skipIf(sys.version_info[:2] >= (3, 5), "python 3.5 has problems here") - def test_loadTestsFromNames__relative_malformed_name(self): - loader = unittest.TestLoader() - -diff --git a/unittest2/compatibility.py b/unittest2/compatibility.py -index 9e5f1a5..2d20c19 100644 ---- a/unittest2/compatibility.py -+++ b/unittest2/compatibility.py -@@ -140,6 +140,6 @@ except ImportError: - ### ChainMap (helper for configparser and string.Template) - ######################################################################## - --class ChainMap(collections.MutableMapping): -+class ChainMap(collections.abc.MutableMapping): - ''' A ChainMap groups multiple dicts (or other mappings) together - to create a single, updateable view. diff --git a/gnu/packages/patches/python-unittest2-remove-argparse.patch b/gnu/packages/patches/python-unittest2-remove-argparse.patch deleted file mode 100644 index c96738757ef82c8a064a82990d8a6981f8b0f37c..0000000000000000000000000000000000000000 --- a/gnu/packages/patches/python-unittest2-remove-argparse.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/setup.py 2017-09-12 01:22:06.273997788 +0200 -+++ b/setup.py 2017-09-12 01:22:14.297918757 +0200 -@@ -57,7 +57,7 @@ - # Both install and setup requires - because we read VERSION from within the - # package, and the package also exports all the APIs. - # six for compat helpers --REQUIRES = ['argparse', 'six>=1.4', 'traceback2'], -+REQUIRES = ['six>=1.4', 'traceback2'], - - params = dict( - name=NAME,