Skip to content

Commit 352e1a5

Browse files
bnavigatorbmwiedemann
authored andcommitted
Update python-control to version 0.9.4 / rev 22 via SR 1143985
https://build.opensuse.org/request/show/1143985 by user bnavigator + anag+factory - Add python-control-pr961-py312.patch for python 312 support gh#python-control/python-control#961 - Use python-xdist: The tests grew over time and we have 4 flavors at the moment
1 parent 68d253b commit 352e1a5

5 files changed

Lines changed: 51 additions & 4 deletions

File tree

‎packages/p/python-control/.files‎

70 Bytes
Binary file not shown.

‎packages/p/python-control/.rev‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,4 +314,15 @@
314314
</comment>
315315
<requestid>1142191</requestid>
316316
</revision>
317+
<revision rev="22" vrev="3">
318+
<srcmd5>54568c8a8ab967cc53f8ab40e0387c13</srcmd5>
319+
<version>0.9.4</version>
320+
<time>1707070190</time>
321+
<user>anag+factory</user>
322+
<comment>- Add python-control-pr961-py312.patch for python 312 support
323+
gh#python-control/python-control#961
324+
- Use python-xdist: The tests grew over time and we have 4 flavors
325+
at the moment</comment>
326+
<requestid>1143985</requestid>
327+
</revision>
317328
</revisionlist>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
diff --git a/control/config.py b/control/config.py
2+
index 59f0e4825..0ae883f49 100644
3+
--- a/control/config.py
4+
+++ b/control/config.py
5+
@@ -48,6 +48,20 @@ def __missing__(self, key):
6+
else:
7+
raise KeyError(key)
8+
9+
+ # New get function for Python 3.12+ to replicate old behavior
10+
+ def get(self, key, defval=None):
11+
+ # If the key exists, return it
12+
+ if self.__contains__(key):
13+
+ return self[key]
14+
+
15+
+ # If not, see if it is deprecated
16+
+ repl = self._check_deprecation(key)
17+
+ if self.__contains__(repl):
18+
+ return self.get(repl, defval)
19+
+
20+
+ # Otherwise, call the usual dict.get() method
21+
+ return super().get(key, defval)
22+
+
23+
def _check_deprecation(self, key):
24+
if self.__contains__(f"deprecated.{key}"):
25+
repl = self[f"deprecated.{key}"]

‎packages/p/python-control/python-control.changes‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
-------------------------------------------------------------------
2+
Sun Feb 4 10:46:16 UTC 2024 - Ben Greiner <code@bnavigator.de>
3+
4+
- Add python-control-pr961-py312.patch for python 312 support
5+
gh#python-control/python-control#961
6+
- Use python-xdist: The tests grew over time and we have 4 flavors
7+
at the moment
8+
19
-------------------------------------------------------------------
210
Mon Jan 29 08:42:53 UTC 2024 - Ben Greiner <code@bnavigator.de>
311

‎packages/p/python-control/python-control.spec‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# spec file for package python-control
33
#
4-
# Copyright (c) 2023 SUSE LLC
4+
# Copyright (c) 2024 SUSE LLC
55
#
66
# All modifications and additions to the file contributed by third parties
77
# remain the property of their copyright owners, unless otherwise agreed
@@ -24,6 +24,8 @@ License: BSD-3-Clause
2424
URL: https://python-control.org
2525
Source: https://files.pythonhosted.org/packages/source/c/control/control-%{version}.tar.gz
2626
Source1: %{name}-rpmlintrc
27+
# PATCH-FIX-UPSTREAM python-control-pr961-py312.patch gh#python-control/python-control#961
28+
Patch0: python-control-pr961-py312.patch
2729
BuildRequires: %{python_module base >= 3.8}
2830
BuildRequires: %{python_module pip}
2931
BuildRequires: %{python_module setuptools_scm}
@@ -37,13 +39,14 @@ Requires: python-scipy >= 1.3
3739
Recommends: python-slycot
3840
BuildArch: noarch
3941
# SECTION test requirements
40-
BuildRequires: %{python_module matplotlib-qt5}
42+
BuildRequires: %{python_module matplotlib-qt}
4143
BuildRequires: %{python_module matplotlib}
4244
BuildRequires: %{python_module numpy}
43-
BuildRequires: %{python_module qt5}
4445
BuildRequires: %{python_module pytest-timeout}
46+
BuildRequires: %{python_module pytest-xdist}
4547
BuildRequires: %{python_module pytest-xvfb}
4648
BuildRequires: %{python_module pytest}
49+
BuildRequires: %{python_module qt5}
4750
BuildRequires: %{python_module scipy >= 1.3}
4851
BuildRequires: %{python_module slycot}
4952
# /SECTION
@@ -74,7 +77,7 @@ donttest="dummyprefix"
7477
[ "${RPM_ARCH}" != "x86_64" ] && donttest="$donttest or (test_optimal_doc and shooting-3-u0-None)"
7578
# causes i586 segfaults in matplotlib after successful balanced model reduction tests
7679
[ $(getconf LONG_BIT) -eq 32 ] && donttest="$donttest or testBalredMatchDC"
77-
%pytest -k "not (${donttest})"
80+
%pytest -n auto -k "not (${donttest})"
7881

7982
%files %{python_files}
8083
%doc ChangeLog README.rst

0 commit comments

Comments
 (0)