From e61f1c6a56344846fea24415851851b9da75cab52046caa22f29daa6a31ad2b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Fri, 8 Mar 2019 06:48:18 +0000 Subject: [PATCH] Accepting request 682705 from home:jayvdb:coala:python3-bears - Use tests from upstream sdist - Update to v2.0.2 * Package tests as part of the dist. * Update docs. OBS-URL: https://build.opensuse.org/request/show/682705 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-first?expand=0&rev=3 --- first-2.0.1.tar.gz | 3 --- first-2.0.2.tar.gz | 3 +++ python-first.changes | 8 ++++++++ python-first.spec | 6 ++---- test_first.py | 40 ---------------------------------------- 5 files changed, 13 insertions(+), 47 deletions(-) delete mode 100644 first-2.0.1.tar.gz create mode 100644 first-2.0.2.tar.gz delete mode 100644 test_first.py diff --git a/first-2.0.1.tar.gz b/first-2.0.1.tar.gz deleted file mode 100644 index 703ae43..0000000 --- a/first-2.0.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3bb3de3582cb27071cfb514f00ed784dc444b7f96dc21e140de65fe00585c95e -size 5325 diff --git a/first-2.0.2.tar.gz b/first-2.0.2.tar.gz new file mode 100644 index 0000000..70b5ffe --- /dev/null +++ b/first-2.0.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ff285b08c55f8c97ce4ea7012743af2495c9f1291785f163722bd36f6af6d3bf +size 6964 diff --git a/python-first.changes b/python-first.changes index 54542d9..5da189c 100644 --- a/python-first.changes +++ b/python-first.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Mar 8 06:01:15 UTC 2019 - John Vandenberg + +- Use tests from upstream sdist +- Update to v2.0.2 + * Package tests as part of the dist. + * Update docs. + ------------------------------------------------------------------- Wed Mar 6 10:35:25 AM UTC 2019 - John Vandenberg diff --git a/python-first.spec b/python-first.spec index 2bf04a6..1583484 100644 --- a/python-first.spec +++ b/python-first.spec @@ -18,14 +18,13 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-first -Version: 2.0.1 +Version: 2.0.2 Release: 0 Summary: Return the first true value of an iterable License: MIT Group: Development/Languages/Python URL: http://github.com/hynek/first/ Source: https://files.pythonhosted.org/packages/source/f/first/first-%{version}.tar.gz -Source1: https://raw.githubusercontent.com/hynek/first/master/test_first.py BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -37,7 +36,6 @@ Return the first true value of an iterable. %prep %setup -q -n first-%{version} -cp %{SOURCE1} . %build %python_build @@ -47,7 +45,7 @@ cp %{SOURCE1} . %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%python_expand PYTHONPATH=. $python test_first.py +%python_expand PYTHONPATH=. $python setup.py test %files %{python_files} %doc AUTHORS.rst README.rst diff --git a/test_first.py b/test_first.py deleted file mode 100644 index ceac45e..0000000 --- a/test_first.py +++ /dev/null @@ -1,40 +0,0 @@ -import unittest -from first import first - - -isbool = lambda x: isinstance(x, bool) -isint = lambda x: isinstance(x, int) -odd = lambda x: isint(x) and x % 2 != 0 -even = lambda x: isint(x) and x % 2 == 0 -is_meaning_of_life = lambda x: x == 42 - - -class TestFirst(unittest.TestCase): - def test_empty_iterables(self): - s = set() - l = [] - assert first(s) is None - assert first(l) is None - - def test_default_value(self): - s = set() - l = [] - assert first(s, default=42) == 42 - assert first(l, default=3.14) == 3.14 - - l = [0, False, []] - assert first(l, default=3.14) == 3.14 - - def test_selection(self): - l = [(), 0, False, 3, []] - - assert first(l, default=42) == 3 - assert first(l, key=isint) == 0 - assert first(l, key=isbool) is False - assert first(l, key=odd) == 3 - assert first(l, key=even) == 0 - assert first(l, key=is_meaning_of_life) is None - - -if __name__ == '__main__': - unittest.main()