diff --git a/python-astor.changes b/python-astor.changes index 590fd70..9a1aa4a 100644 --- a/python-astor.changes +++ b/python-astor.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Mar 25 15:11:49 UTC 2020 - Paolo Stivanin + +- Add remove_nose.patch + * test suite runs fine without nose, because it was written for unittest2 + and, because nose won't work with Python 3.9/3.10, this patch removes + the requirement from setup.cfg and use unittest2 in the spec file + instead of nose + ------------------------------------------------------------------- Fri Jan 17 12:59:09 UTC 2020 - Marketa Calabkova diff --git a/python-astor.spec b/python-astor.spec index bec24bd..6405354 100644 --- a/python-astor.spec +++ b/python-astor.spec @@ -25,13 +25,14 @@ License: BSD-3-Clause Group: Development/Languages/Python URL: https://github.com/berkerpeksag/astor Source: https://github.com/berkerpeksag/astor/archive/%{version}.tar.gz#/astor-%{version}.tar.gz +# https://github.com/berkerpeksag/astor/pull/177 +Patch0: remove_nose.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros BuildArch: noarch # SECTION test requirements -BuildRequires: %{python_module nose} -BuildRequires: python2-unittest2 +BuildRequires: %{python_module unittest2} # /SECTION %python_subpackages @@ -61,7 +62,7 @@ There are some other similar libraries, but astor focuses on the following areas %prep %setup -q -n astor-%{version} -%autopatch -p1 +%patch0 -p1 # ugly fix for the use of /usr/bin/env sed -i 's@env @@' astor/rtrip.py @@ -75,7 +76,7 @@ sed -i 's@env @@' astor/rtrip.py %python_expand chmod 755 %{buildroot}%{$python_sitelib}/astor/rtrip.py %check -%python_expand nosetests-%{$python_bin_suffix} -v +%python_exec -m unittest2 discover -v %files %{python_files} %doc AUTHORS README.rst docs/*.rst diff --git a/remove_nose.patch b/remove_nose.patch new file mode 100644 index 0000000..928dcc4 --- /dev/null +++ b/remove_nose.patch @@ -0,0 +1,12 @@ +--- a/setup.cfg.orig 2020-03-25 16:06:14.496510596 +0100 ++++ b/setup.cfg 2020-03-25 16:08:28.672752421 +0100 +@@ -35,8 +35,7 @@ + include_package_data = True + packages = find: + python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* +-tests_requires = ["nose", "astunparse"] +-test_suite = nose.collector ++tests_requires = ["astunparse"] + + [options.packages.find] + exclude = tests