diff --git a/python-requirements-parser.changes b/python-requirements-parser.changes index c15dafa..e889cb1 100644 --- a/python-requirements-parser.changes +++ b/python-requirements-parser.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Sep 21 01:02:21 UTC 2021 - Steve Kowalik + +- Add remove-nose.patch: + * Use pytest, rather than nose. + ------------------------------------------------------------------- Wed Apr 15 08:39:06 UTC 2020 - Antonio Larrosa diff --git a/python-requirements-parser.spec b/python-requirements-parser.spec index 70a8b87..a5c0e66 100644 --- a/python-requirements-parser.spec +++ b/python-requirements-parser.spec @@ -1,7 +1,7 @@ # # spec file for package python-requirements-parser # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -27,10 +27,11 @@ URL: https://github.com/davidfischer/requirements-parser Source: https://github.com/davidfischer/requirements-parser/archive/v%{version}.tar.gz#/requirements-parser-%{version}.tar.gz # PATCH-FIX-UPSTREAM 0001-Dont-fail-with-valid-options-in-requirements_txt-files.patch alarrosa@suse.com -- https://github.com/davidfischer/requirements-parser/pull/47 Patch0: 0001-Dont-fail-with-valid-options-in-requirements_txt-files.patch +Patch1: remove-nose.patch BuildRequires: %{python_module setuptools} BuildRequires: python-rpm-macros # SECTION test requirements -BuildRequires: %{python_module nose} +BuildRequires: %{python_module pytest} # /SECTION BuildRequires: fdupes BuildArch: noarch @@ -42,7 +43,7 @@ A Pip requirement file parser. %prep %setup -q -n requirements-parser-%{version} -%patch0 -p1 +%autopatch -p1 %build %python_build @@ -52,7 +53,7 @@ A Pip requirement file parser. %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%python_exec -m nose +%pytest %files %{python_files} %doc AUTHORS.rst README.rst docs/*.rst diff --git a/remove-nose.patch b/remove-nose.patch new file mode 100644 index 0000000..0c2c9b5 --- /dev/null +++ b/remove-nose.patch @@ -0,0 +1,44 @@ +Index: requirements-parser-0.2.0/tests/test_parser.py +=================================================================== +--- requirements-parser-0.2.0.orig/tests/test_parser.py ++++ requirements-parser-0.2.0/tests/test_parser.py +@@ -1,6 +1,6 @@ + import os + import json +-from nose.tools import raises, assert_equal ++from pytest import raises + import warnings + + from requirements import parse +@@ -32,17 +32,17 @@ def test_requirement_files(): + return f + + @fancy +- @raises(ValueError) + def check_fail(s): + with warnings.catch_warnings(): + warnings.simplefilter("ignore") +- list([dict(r) for r in parse(s)]) ++ with raises(ValueError): ++ list([dict(r) for r in parse(s)]) + + @fancy + def check(s, expected): + with warnings.catch_warnings(): + warnings.simplefilter("ignore") +- assert_equal(listify(dict(r) for r in parse(s)), expected) ++ assert listify(dict(r) for r in parse(s)) == expected + + fp = os.path.join(REQFILE_DIR, fn) + +@@ -51,8 +51,8 @@ def test_requirement_files(): + continue + + if 'fail' in fn: +- yield check_fail, open(fp) ++ check_fail(open(fp)) + else: + with open(fp[:-4] + '.expected', 'r') as f2: + expected = json.loads(f2.read()) +- yield check, open(fp), expected ++ check(open(fp), expected)