SHA256
1
0
forked from pool/python-astor

Accepting request 788279 from home:polslinux:branches:devel:languages:python

- 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

OBS-URL: https://build.opensuse.org/request/show/788279
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-astor?expand=0&rev=13
This commit is contained in:
Tomáš Chvátal 2020-03-26 05:06:49 +00:00 committed by Git OBS Bridge
parent ba8055c912
commit c8dc2273b2
3 changed files with 26 additions and 4 deletions

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Mar 25 15:11:49 UTC 2020 - Paolo Stivanin <info@paolostivanin.com>
- 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 <mcalabkova@suse.com>

View File

@ -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

12
remove_nose.patch Normal file
View File

@ -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