forked from pool/python-CherryPy
- Add patch use-read_file-not-readfp.patch:
* Use read_file(), not readfp() for configparser. - Switch to autosetup and pyproject macros. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-CherryPy?expand=0&rev=60
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Nov 22 03:23:15 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Add patch use-read_file-not-readfp.patch:
|
||||
* Use read_file(), not readfp() for configparser.
|
||||
- Switch to autosetup and pyproject macros.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon May 8 07:19:28 UTC 2023 - Johannes Kastl <kastl@b1-systems.de>
|
||||
|
||||
|
@@ -30,8 +30,11 @@ Summary: Object-Oriented HTTP framework
|
||||
License: BSD-3-Clause
|
||||
URL: https://www.cherrypy.dev
|
||||
Source: https://files.pythonhosted.org/packages/source/C/CherryPy/CherryPy-%{version}.tar.gz
|
||||
# PATCH-FIX-UPSTREAM https://github.com/cherrypy/cherrypy/pull/1959
|
||||
Patch0: use-read_file-not-readfp.patch
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module setuptools_scm}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module wheel}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros >= 20210929
|
||||
Requires: python-cheroot >= 8.2.1
|
||||
@@ -81,15 +84,15 @@ to the most demanding ones.
|
||||
Oh, and most importantly: CherryPy is fun to work with :-)
|
||||
|
||||
%prep
|
||||
%setup -q -n CherryPy-%{version}
|
||||
%autosetup -p1 -n CherryPy-%{version}
|
||||
# do not require cov/xdist/etc
|
||||
rm pytest.ini
|
||||
|
||||
%build
|
||||
%python_build
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
%python_install
|
||||
%pyproject_install
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
%python_clone -a %{buildroot}%{_bindir}/cherryd
|
||||
|
||||
@@ -113,7 +116,7 @@ export TRAVIS="true"
|
||||
%license LICENSE.md
|
||||
%doc README.rst CHANGES.rst
|
||||
%python_alternative %{_bindir}/cherryd
|
||||
%{python_sitelib}/cherrypy/
|
||||
%{python_sitelib}/CherryPy-%{version}-py%{python_version}.egg-info
|
||||
%{python_sitelib}/cherrypy
|
||||
%{python_sitelib}/CherryPy-%{version}.dist-info
|
||||
|
||||
%changelog
|
||||
|
30
use-read_file-not-readfp.patch
Normal file
30
use-read_file-not-readfp.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
From d2bc527c12a74675d67ba5fbf9de0d014af929cb Mon Sep 17 00:00:00 2001
|
||||
From: Dan Radez <dradez@redhat.com>
|
||||
Date: Tue, 12 Apr 2022 09:40:46 -0400
|
||||
Subject: [PATCH] Replace readfp with read_file
|
||||
|
||||
Getting Deprecation Warning in python 3.11:
|
||||
DeprecationWarning: This method will be removed in Python 3.12.
|
||||
Use 'parser.read_file()' instead.
|
||||
|
||||
https://github.com/python/cpython/commit/e8659b47dece5a272111c0af5e340c364a9f807b#diff-ca80d44aeeadd5e4966195b99aff106abb3e7b0b5356b7499125ee021bd84777R757
|
||||
|
||||
If I'm reading this correct read_file has been around since Python 2.7
|
||||
https://github.com/python/cpython/commit/a492362f9a2a44e411147fd7b2886466bb0bb17f
|
||||
---
|
||||
cherrypy/lib/reprconf.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/cherrypy/lib/reprconf.py b/cherrypy/lib/reprconf.py
|
||||
index 76381d7b7..536b94173 100644
|
||||
--- a/cherrypy/lib/reprconf.py
|
||||
+++ b/cherrypy/lib/reprconf.py
|
||||
@@ -188,7 +188,7 @@ def as_dict(self, raw=False, vars=None):
|
||||
|
||||
def dict_from_file(self, file):
|
||||
if hasattr(file, 'read'):
|
||||
- self.readfp(file)
|
||||
+ self.read_file(file)
|
||||
else:
|
||||
self.read(file)
|
||||
return self.as_dict()
|
Reference in New Issue
Block a user