From 021b05bb8d384114517cbc0272b66a773e434e683a768f960740783438a0b2e8 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 30 Jul 2020 15:44:34 +0000 Subject: [PATCH 1/2] - Add denose_tests.patch removing the need for nose (gh#dsoprea/PyEasyArchive#44). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-libarchive?expand=0&rev=15 --- denose_tests.patch | 46 +++++++++++++++++++++++++++++++++++++++ python-libarchive.changes | 6 +++++ python-libarchive.spec | 10 ++++++--- 3 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 denose_tests.patch diff --git a/denose_tests.patch b/denose_tests.patch new file mode 100644 index 0000000..eb981db --- /dev/null +++ b/denose_tests.patch @@ -0,0 +1,46 @@ +--- /dev/null ++++ b/tests/__init__.py +@@ -0,0 +1 @@ ++# This file intentionally left blank. +--- a/tests/adapters/test_archive_read.py ++++ b/tests/adapters/test_archive_read.py +@@ -86,4 +86,4 @@ class TestArchiveRead(unittest.TestCase) + u'README.rst': u'libarchive/resources/README.rst', + } + +- self.assertEquals(index, expected) ++ self.assertEqual(index, expected) +--- a/tests/adapters/test_archive_write.py ++++ b/tests/adapters/test_archive_write.py +@@ -51,7 +51,7 @@ class TestArchiveWrite(unittest.TestCase + 'libarchive/resources/requirements.txt', + ] + +- self.assertEquals(actual, expected) ++ self.assertEqual(actual, expected) + + def test_create_file__unicode(self): + with libarchive.test_support.chdir(_APP_PATH): +@@ -101,4 +101,4 @@ class TestArchiveWrite(unittest.TestCase + unicode_test_filepath.lstrip(os.sep), + ] + +- self.assertEquals(actual, expected) ++ self.assertEqual(actual, expected) +--- a/tests/types/test_archive_entry.py ++++ b/tests/types/test_archive_entry.py +@@ -29,7 +29,7 @@ class TestArchiveEntry(unittest.TestCase + libarchive.constants.archive_entry.AE_IFBLK | \ + libarchive.constants.archive_entry.AE_IFMT + +- self.assertEquals(n, expected_n) ++ self.assertEqual(n, expected_n) + + recovered = libarchive.types.archive_entry.int_to_ef(n) + +@@ -43,4 +43,4 @@ class TestArchiveEntry(unittest.TestCase + IFDIR=True, + IFIFO=True) + +- self.assertEquals(recovered, expected_ef) ++ self.assertEqual(recovered, expected_ef) diff --git a/python-libarchive.changes b/python-libarchive.changes index f5bd14a..46aa9e2 100644 --- a/python-libarchive.changes +++ b/python-libarchive.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jul 30 15:43:52 UTC 2020 - Matej Cepl + +- Add denose_tests.patch removing the need for nose + (gh#dsoprea/PyEasyArchive#44). + ------------------------------------------------------------------- Tue Mar 3 12:13:41 UTC 2020 - Tomáš Chvátal diff --git a/python-libarchive.spec b/python-libarchive.spec index f4bb48f..107eba6 100644 --- a/python-libarchive.spec +++ b/python-libarchive.spec @@ -25,6 +25,9 @@ Summary: Python adapter for universal, libarchive-based archive access License: GPL-2.0-only URL: https://github.com/dsoprea/PyEasyArchive Source: https://files.pythonhosted.org/packages/source/l/libarchive/libarchive-%{version}.tar.gz +# PATCH-FEATURE-UPSTREAM denose_tests.patch gh#dsoprea/PyEasyArchive#44 mcepl@suse.com +# Removes the need for nose test requirement +Patch0: denose_tests.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: libarchive-devel @@ -33,7 +36,7 @@ Requires: libarchive-devel Conflicts: python-libarchive-c BuildArch: noarch # SECTION test requirements -BuildRequires: %{python_module nose} +BuildRequires: %{python_module pytest} # /SECTION %ifpython2 Conflicts: %{oldpython}-libarchive-c @@ -46,14 +49,15 @@ A ctypes-based adapter to libarchive. %prep %setup -q -n libarchive-%{version} +%autopatch -p1 %build %python_build %check -# https://github.com/dsoprea/PyEasyArchive/issues/33 export LANG=en_US.UTF8 -%python_expand nosetests-%{$python_bin_suffix} -v -e test_read_symlinks +# excluded test due to gh#dsoprea/PyEasyArchive#33 +%pytest -k 'not test_read_symlinks' %install %python_install From c20eabf76dede657805f175a12683167385486fdf8a9285cd94c60b3afd70bf7 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 12 Aug 2020 10:40:47 +0000 Subject: [PATCH 2/2] Accepting request 825957 from home:pgajdos:python - run test_read_symlinks but make README.rst to be a symlink to libarchive/resources/README.rst OBS-URL: https://build.opensuse.org/request/show/825957 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-libarchive?expand=0&rev=16 --- python-libarchive.changes | 6 ++++++ python-libarchive.spec | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/python-libarchive.changes b/python-libarchive.changes index 46aa9e2..8adabd2 100644 --- a/python-libarchive.changes +++ b/python-libarchive.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Aug 12 09:31:58 UTC 2020 - pgajdos@suse.com + +- run test_read_symlinks but make README.rst to be a symlink to + libarchive/resources/README.rst + ------------------------------------------------------------------- Thu Jul 30 15:43:52 UTC 2020 - Matej Cepl diff --git a/python-libarchive.spec b/python-libarchive.spec index 107eba6..aeec995 100644 --- a/python-libarchive.spec +++ b/python-libarchive.spec @@ -56,8 +56,9 @@ A ctypes-based adapter to libarchive. %check export LANG=en_US.UTF8 -# excluded test due to gh#dsoprea/PyEasyArchive#33 -%pytest -k 'not test_read_symlinks' +# test_read_symlinks expects README.rst to be symlink +ln -sf libarchive/resources/README.rst README.rst +%pytest %install %python_install