Compare commits

2 Commits

3 changed files with 86 additions and 6 deletions

65
py313-tests.patch Normal file
View File

@@ -0,0 +1,65 @@
From bc84ac3af6dbbec655c0ab4544d811d92a175437 Mon Sep 17 00:00:00 2001
From: Delta Regeer <bertjw@regeer.org>
Date: Sat, 26 Oct 2024 15:09:46 -0600
Subject: [PATCH] Update tests for Python 3.13, add nocover in pshell
Inner functions such as:
def outer():
def inner():
pass
Now have an attribute called `__name__`, which will be set to `inner`.
Also it seems that there is a `__doc__` attribute that is now standard,
and thus we add a pragma nocover to pshell.
---
src/pyramid/scripts/pshell.py | 2 +-
tests/test_util.py | 10 ++--------
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/src/pyramid/scripts/pshell.py b/src/pyramid/scripts/pshell.py
index 4d3817ffb2..6e392b1aef 100644
--- a/src/pyramid/scripts/pshell.py
+++ b/src/pyramid/scripts/pshell.py
@@ -193,7 +193,7 @@ def setup_env(self):
if k not in orig_env or v is not orig_env[k]:
if getattr(v, '__doc__', False):
env_help[k] = v.__doc__.replace("\n", " ")
- else:
+ else: # pragma: nocover -- Python >= 3.13 has a __doc__
env_help[k] = v
del orig_env
diff --git a/tests/test_util.py b/tests/test_util.py
index bf4c089885..c96e7bb1f7 100644
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -66,13 +66,10 @@ def worker(obj):
self.assertEqual(1, foo.y)
def test_property_without_name(self):
- def worker(obj): # pragma: no cover
- pass
-
foo = Dummy()
helper = self._getTargetClass()
self.assertRaises(
- ValueError, helper.set_property, foo, property(worker)
+ ValueError, helper.set_property, foo, "has_no___name__"
)
def test_property_with_name(self):
@@ -271,11 +268,8 @@ def worker(obj):
self.assertEqual(1, foo.y)
def test_property_without_name(self):
- def worker(obj): # pragma: no cover
- pass
-
foo = self._makeOne()
- self.assertRaises(ValueError, foo.set_property, property(worker))
+ self.assertRaises(ValueError, foo.set_property, "has_no___name__")
def test_property_with_name(self):
def worker(obj):

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sat Nov 9 08:23:28 UTC 2024 - Dirk Müller <dmueller@suse.com>
- add py313-tests.patch
- modernize spec file
-------------------------------------------------------------------
Tue Jan 2 21:17:44 UTC 2024 - Dirk Müller <dmueller@suse.com>

View File

@@ -25,16 +25,20 @@ Summary: The Pyramid web application development framework
License: BSD-4-Clause AND ZPL-2.1 AND MIT
URL: https://pylonsproject.org
Source0: https://files.pythonhosted.org/packages/source/p/pyramid/pyramid-%{version}.tar.gz
# PATCH-FIX-UPSTREAM https://github.com/Pylons/pyramid/pull/3767/commits/bc84ac3af6dbbec655c0ab4544d811d92a175437
Patch0: https://github.com/Pylons/pyramid/pull/3767/commits/bc84ac3af6dbbec655c0ab4544d811d92a175437.patch#/py313-tests.patch
BuildRequires: %{python_module PasteDeploy >= 1.5.0}
BuildRequires: %{python_module WebOb >= 1.8.3}
BuildRequires: %{python_module WebTest >= 1.3.1}
BuildRequires: %{python_module hupper >= 1.5}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module plaster-pastedeploy}
BuildRequires: %{python_module plaster}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module translationstring >= 0.4}
BuildRequires: %{python_module venusian >= 1.0}
BuildRequires: %{python_module wheel}
BuildRequires: %{python_module zope.component >= 4.0}
BuildRequires: %{python_module zope.deprecation >= 3.5.0}
BuildRequires: %{python_module zope.interface >= 3.8.0}
@@ -51,7 +55,7 @@ Requires: python-venusian >= 1.0
Requires: python-zope.deprecation >= 3.5.0
Requires: python-zope.interface >= 3.8.0
Requires(post): update-alternatives
Requires(postun):update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
%if %{with python2}
BuildRequires: python-repoze.lru >= 0.4
@@ -70,17 +74,21 @@ It was previously known as repoze.bfg (http://bfg.repoze.org).
# NOTE: The documentation in the docs/ directory is under a
# non-free license (CC-BY-NC-SA-3.0). Do not package it.
%prep
%setup -q -n pyramid-%{version}
%autosetup -p1 -n pyramid-%{version}
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
for p in pdistreport prequest proutes pserve pshell ptweens pviews; do
@@ -107,6 +115,7 @@ export LANG=en_US.UTF-8
%python_alternative %{_bindir}/pshell
%python_alternative %{_bindir}/ptweens
%python_alternative %{_bindir}/pviews
%{python_sitelib}/*
%{python_sitelib}/pyramid
%{python_sitelib}/pyramid-%{version}.dist-info
%changelog