14
0
forked from pool/python-taskw

Accepting request 1196378 from devel:languages:python

- Add patch support-pytest-8.patch:
  * Support pytest 8.
- Switch to autosetup and pyproject macros.
- No more greedy globs in %files.

OBS-URL: https://build.opensuse.org/request/show/1196378
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-taskw?expand=0&rev=6
This commit is contained in:
2024-08-28 19:30:34 +00:00
committed by Git OBS Bridge
3 changed files with 124 additions and 8 deletions

View File

@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed Aug 28 03:47:09 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch support-pytest-8.patch:
* Support pytest 8.
- Switch to autosetup and pyproject macros.
- No more greedy globs in %files.
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Sep 13 14:57:40 UTC 2022 - pgajdos@suse.com Tue Sep 13 14:57:40 UTC 2022 - pgajdos@suse.com

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-taskw # spec file for package python-taskw
# #
# Copyright (c) 2022 SUSE LLC # Copyright (c) 2024 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -16,16 +16,18 @@
# #
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-taskw Name: python-taskw
Version: 2.0.0 Version: 2.0.0
Release: 0 Release: 0
Summary: Python bindings for taskwarrior Summary: Python bindings for taskwarrior
License: GPL-3.0-or-later License: GPL-3.0-or-later
Group: Development/Languages/Python
URL: https://github.com/ralphbean/taskw URL: https://github.com/ralphbean/taskw
Source: https://files.pythonhosted.org/packages/source/t/taskw/taskw-%{version}.tar.gz Source: https://files.pythonhosted.org/packages/source/t/taskw/taskw-%{version}.tar.gz
# PATCH-FIX-UPSTREAM gh#ralphbean/taskw#169
Patch0: support-pytest-8.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
Requires: python-kitchen Requires: python-kitchen
@@ -46,21 +48,22 @@ BuildRequires: taskwarrior
Python bindings for your taskwarrior database. Python bindings for your taskwarrior database.
%prep %prep
%setup -q -n taskw-%{version} %autosetup -p1 -n taskw-%{version}
%build %build
%python_build %pyproject_wheel
%install %install
%python_install %pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
%check %check
%pytest %pytest -k 'not test_filtering_brace'
%files %{python_files} %files %{python_files}
%doc README.rst %doc README.rst
%license LICENSE.txt %license LICENSE.txt
%{python_sitelib}/* %{python_sitelib}/taskw
%{python_sitelib}/taskw-%{version}.dist-info
%changelog %changelog

105
support-pytest-8.patch Normal file
View File

@@ -0,0 +1,105 @@
From 6d5af74c29261035c95caec1c18002b2cd6195b7 Mon Sep 17 00:00:00 2001
From: Jochen Sprickerhof <jspricke@debian.org>
Date: Thu, 28 Mar 2024 08:17:39 +0100
Subject: [PATCH] Fix tests with new pytest
Use unittest.TestCase and __test__ to ignore test base class.
---
taskw/test/test_datas.py | 8 ++++++--
taskw/test/test_recursive.py | 5 +++--
taskw/test/test_utils.py | 5 +++--
3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/taskw/test/test_datas.py b/taskw/test/test_datas.py
index 1a3667c..21b4441 100644
--- a/taskw/test/test_datas.py
+++ b/taskw/test/test_datas.py
@@ -6,6 +6,7 @@
import pytest
+from unittest import TestCase
from taskw import TaskWarriorDirect, TaskWarriorShellout
@@ -16,8 +17,9 @@
'uuid': "c1c431ea-f0dc-4683-9a20-e64fcfa65fd1"}
-class _BaseTestDB(object):
- def setup(self):
+class _BaseTestDB(TestCase):
+ __test__ = False
+ def setUp(self):
# Sometimes the 'task' command line tool is not installed.
if self.should_skip():
@@ -330,6 +332,7 @@ def test_load_tasks_with_one_each(self):
class TestDBDirect(_BaseTestDB):
+ __test__ = True
class_to_test = TaskWarriorDirect
def test_delete_completed(self):
@@ -345,6 +348,7 @@ def should_skip(self):
class TestDBShellout(_BaseTestDB):
+ __test__ = True
class_to_test = TaskWarriorShellout
def should_skip(self):
diff --git a/taskw/test/test_recursive.py b/taskw/test/test_recursive.py
index 1ab99e1..88519b2 100644
--- a/taskw/test/test_recursive.py
+++ b/taskw/test/test_recursive.py
@@ -4,6 +4,7 @@
import pytest
+from unittest import TestCase
from taskw import TaskWarriorShellout
@@ -14,8 +15,8 @@
'uuid': "c1c431ea-f0dc-4683-9a20-e64fcfa65fd1"}
-class TestRecursibe(object):
- def setup(self):
+class TestRecursibe(TestCase):
+ def setUp(self):
if not TaskWarriorShellout.can_use():
# Sometimes the 'task' command line tool is not installed.
pytest.skip("taskwarrior not installed")
diff --git a/taskw/test/test_utils.py b/taskw/test/test_utils.py
index c57dd38..8c6c1df 100644
--- a/taskw/test/test_utils.py
+++ b/taskw/test/test_utils.py
@@ -4,6 +4,7 @@
import dateutil.tz
import pytz
+from unittest import TestCase
from taskw.utils import (
convert_dict_to_override_args,
decode_task,
@@ -31,7 +32,7 @@ def shuffled(l):
return new
-class TestUtils(object):
+class TestUtils(TestCase):
def test_no_side_effects(self):
orig = TASK.copy()
@@ -187,7 +188,7 @@ def test_convert_dict_to_override_args(self):
assert set(actual_overrides) == set(expected_overrides)
-class TestCleanExecArg(object):
+class TestCleanExecArg(TestCase):
def test_clean_null(self):
assert b"" == clean_ctrl_chars(b"\x00")