14
0

Accepting request 1154477 from devel:languages:python

- Switch to pyproject and autosetup macros.
- Add patch support-python-312.patch, support Python 3.12.

OBS-URL: https://build.opensuse.org/request/show/1154477
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-python-redmine?expand=0&rev=8
This commit is contained in:
2024-03-04 20:25:08 +00:00
committed by Git OBS Bridge
3 changed files with 60 additions and 7 deletions

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Mar 4 02:06:37 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
- Switch to pyproject and autosetup macros.
- Add patch support-python-312.patch, support Python 3.12.
-------------------------------------------------------------------
Tue Sep 26 18:54:59 UTC 2023 - Martin Hauke <mardnh@gmx.de>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-python-redmine
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -21,14 +21,17 @@ Version: 2.4.0
Release: 0
Summary: Python library for the Redmine RESTful API
License: Apache-2.0
Group: Development/Languages/Python
URL: https://python-redmine.com
Source: https://files.pythonhosted.org/packages/source/p/python-redmine/python-redmine-%{version}.tar.gz
Patch0: https://github.com/maxtepkeev/python-redmine/pull/328.patch
# PATCH-FIX-UPSTREAM gh#maxtepkeev/python-redmine#332
Patch1: support-python-312.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest-cov}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module requests >= 2.28.2}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-requests >= 2.28.2
@@ -42,14 +45,13 @@ via REST API for which Python Redmine provides a simple but
powerful Pythonic API inspired by a well-known Django ORM.
%prep
%setup -q -n python-redmine-%{version}
%patch0 -p1
%autosetup -p1 -n python-redmine-%{version}
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
@@ -59,6 +61,6 @@ powerful Pythonic API inspired by a well-known Django ORM.
%license LICENSE
%doc CHANGELOG.rst README.rst
%{python_sitelib}/redminelib
%{python_sitelib}/python_redmine-*
%{python_sitelib}/python_redmine-%{version}.dist-info
%changelog

45
support-python-312.patch Normal file
View File

@@ -0,0 +1,45 @@
From b28beb9f0c1516d35037bb54adcb54dd803694e6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Sat, 2 Mar 2024 14:45:08 +0100
Subject: [PATCH] Replace `assertEquals()` to fix tests with Python 3.12 (#332)
---
tests/test_managers.py | 4 ++--
tests/test_redmine.py | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/test_managers.py b/tests/test_managers.py
index dfacab2..44c2e8b 100644
--- a/tests/test_managers.py
+++ b/tests/test_managers.py
@@ -125,7 +125,7 @@ def test_create_resource_with_stream_uploads(self):
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter('always')
issue = self.redmine.issue.create(project_id=1, subject='Foo', uploads=[{'path': stream}])
- self.assertEquals(len(w), 1)
+ self.assertEqual(len(w), 1)
self.assertIs(w[0].category, exceptions.PerformanceWarning)
self.assertEqual(issue.project_id, 1)
self.assertEqual(issue.subject, 'Foo')
@@ -166,7 +166,7 @@ def test_update_resource_with_stream_uploads(self):
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter('always')
self.assertEqual(self.redmine.issue.update(1, subject='Bar', uploads=[{'path': stream}]), True)
- self.assertEquals(len(w), 1)
+ self.assertEqual(len(w), 1)
self.assertIs(w[0].category, exceptions.PerformanceWarning)
def test_update_resource_returns_none(self):
diff --git a/tests/test_redmine.py b/tests/test_redmine.py
index 46e456b..9384c18 100644
--- a/tests/test_redmine.py
+++ b/tests/test_redmine.py
@@ -77,7 +77,7 @@ def test_successful_filestream_upload(self):
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter('always')
self.assertEqual(self.redmine.upload(StringIO(b'\xcf\x86oo'.decode('utf-8')))['token'], '456789')
- self.assertEquals(len(w), 1)
+ self.assertEqual(len(w), 1)
self.assertIs(w[0].category, exceptions.PerformanceWarning)
@mock.patch('redminelib.open', mock.mock_open(), create=True)