Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-control for openSUSE:Factory checked in at 2024-02-04 19:09:50 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-control (Old) and /work/SRC/openSUSE:Factory/.python-control.new.1815 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-control" Sun Feb 4 19:09:50 2024 rev:22 rq:1143985 version:0.9.4 Changes: -------- --- /work/SRC/openSUSE:Factory/python-control/python-control.changes 2024-01-29 22:29:49.183191354 +0100 +++ /work/SRC/openSUSE:Factory/.python-control.new.1815/python-control.changes 2024-02-04 19:12:20.743406694 +0100 @@ -1,0 +2,8 @@ +Sun Feb 4 10:46:16 UTC 2024 - Ben Greiner <c...@bnavigator.de> + +- 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 + +------------------------------------------------------------------- New: ---- python-control-pr961-py312.patch BETA DEBUG BEGIN: New: - Add python-control-pr961-py312.patch for python 312 support gh#python-control/python-control#961 BETA DEBUG END: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-control.spec ++++++ --- /var/tmp/diff_new_pack.rqkHAK/_old 2024-02-04 19:12:21.251425002 +0100 +++ /var/tmp/diff_new_pack.rqkHAK/_new 2024-02-04 19:12:21.251425002 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-control # -# 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 @@ -24,6 +24,8 @@ URL: https://python-control.org Source: https://files.pythonhosted.org/packages/source/c/control/control-%{version}.tar.gz Source1: %{name}-rpmlintrc +# PATCH-FIX-UPSTREAM python-control-pr961-py312.patch gh#python-control/python-control#961 +Patch0: python-control-pr961-py312.patch BuildRequires: %{python_module base >= 3.8} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools_scm} @@ -37,13 +39,14 @@ Recommends: python-slycot BuildArch: noarch # SECTION test requirements -BuildRequires: %{python_module matplotlib-qt5} +BuildRequires: %{python_module matplotlib-qt} BuildRequires: %{python_module matplotlib} BuildRequires: %{python_module numpy} -BuildRequires: %{python_module qt5} BuildRequires: %{python_module pytest-timeout} +BuildRequires: %{python_module pytest-xdist} BuildRequires: %{python_module pytest-xvfb} BuildRequires: %{python_module pytest} +BuildRequires: %{python_module qt5} BuildRequires: %{python_module scipy >= 1.3} BuildRequires: %{python_module slycot} # /SECTION @@ -74,7 +77,7 @@ [ "${RPM_ARCH}" != "x86_64" ] && donttest="$donttest or (test_optimal_doc and shooting-3-u0-None)" # causes i586 segfaults in matplotlib after successful balanced model reduction tests [ $(getconf LONG_BIT) -eq 32 ] && donttest="$donttest or testBalredMatchDC" -%pytest -k "not (${donttest})" +%pytest -n auto -k "not (${donttest})" %files %{python_files} %doc ChangeLog README.rst ++++++ python-control-pr961-py312.patch ++++++ diff --git a/control/config.py b/control/config.py index 59f0e4825..0ae883f49 100644 --- a/control/config.py +++ b/control/config.py @@ -48,6 +48,20 @@ def __missing__(self, key): else: raise KeyError(key) + # New get function for Python 3.12+ to replicate old behavior + def get(self, key, defval=None): + # If the key exists, return it + if self.__contains__(key): + return self[key] + + # If not, see if it is deprecated + repl = self._check_deprecation(key) + if self.__contains__(repl): + return self.get(repl, defval) + + # Otherwise, call the usual dict.get() method + return super().get(key, defval) + def _check_deprecation(self, key): if self.__contains__(f"deprecated.{key}"): repl = self[f"deprecated.{key}"]