[packages/python3-mox3] - python-mox3.spec updated to 1.1.0 for python 3.6+, patched for 3.11+ compatibility

qboosh qboosh at pld-linux.org
Sat Nov 1 21:55:38 CET 2025


commit e8e742028196e34877b8f5c1b9e4fef0c6d16aa9
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Nov 1 21:55:31 2025 +0100

    - python-mox3.spec updated to 1.1.0 for python 3.6+, patched for 3.11+ compatibility

 mox3-inspect-update.patch             | 15 +++++++
 python-mox3.spec => python3-mox3.spec | 84 +++++------------------------------
 2 files changed, 27 insertions(+), 72 deletions(-)
---
diff --git a/python-mox3.spec b/python3-mox3.spec
similarity index 52%
rename from python-mox3.spec
rename to python3-mox3.spec
index ecd599c..4adcddd 100644
--- a/python-mox3.spec
+++ b/python3-mox3.spec
@@ -1,53 +1,36 @@
 #
 # Conditional build:
 %bcond_without	doc	# Sphinx documentation
-%bcond_with	tests	# unit tests (incomplete dependencies)
-%bcond_without	python2 # CPython 2.x module
-%bcond_without	python3 # CPython 3.x module
+%bcond_without	tests	# unit tests
 
-Summary:	Mock object framework for Python 2/3
-Summary(pl.UTF-8):	Szkielet obiektów atrap dla Pythona 2/3
+Summary:	Mock object framework for Python 3
+Summary(pl.UTF-8):	Szkielet obiektów atrap dla Pythona 3
 Name:		python-mox3
-# keep 0.x here for python2 support
-Version:	0.28.0
-Release:	3
+Version:	1.1.0
+Release:	1
 License:	Apache v2.0
 Group:		Libraries/Python
 #Source0Download: https://pypi.org/simple/mox3/
 Source0:	https://files.pythonhosted.org/packages/source/m/mox3/mox3-%{version}.tar.gz
-# Source0-md5:	c930d8479996541b04447a67e96e4a62
+# Source0-md5:	0eff74d3a85ec4d4dc6acf7f524ca816
+Patch0:		mox3-inspect-update.patch
 URL:		https://pypi.org/project/mox3/
-%if %{with python2}
-BuildRequires:	python-modules >= 1:2.7
-BuildRequires:	python-pbr >= 3.0.0
-BuildRequires:	python-setuptools
-%if %{with tests}
-BuildRequires:	python-fixtures >= 3.0.0
-BuildRequires:	python-six >= 1.10.0
-BuildRequires:	python-stestr >= 2.0.0
-BuildRequires:	python-subunit >= 1.0.0
-BuildRequires:	python-testtools >= 2.2.0
-%endif
-%endif
-%if %{with python3}
 BuildRequires:	python3-modules >= 1:3.6
 BuildRequires:	python3-pbr >= 3.0.0
 BuildRequires:	python3-setuptools
 %if %{with tests}
 BuildRequires:	python3-fixtures >= 3.0.0
-BuildRequires:	python3-six >= 1.10.0
 BuildRequires:	python3-stestr >= 2.0.0
 BuildRequires:	python3-subunit >= 1.0.0
 BuildRequires:	python3-testtools >= 2.2.0
 %endif
-%endif
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.714
 %if %{with doc}
-BuildRequires:	python-openstackdocstheme >= 1.18.1
-BuildRequires:	sphinx-pdg-2 >= 1.7.0
+BuildRequires:	python3-openstackdocstheme >= 1.18.1
+BuildRequires:	sphinx-pdg-3 >= 1.7.0
 %endif
-Requires:	python-modules >= 1:2.7
+Requires:	python3-modules >= 1:3.6
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -60,21 +43,6 @@ enhancements have been made.
 Mox3 to nieoficjalny port szkieletu Google mox do Pythona 3. Ma być
 możliwie zgodny z mox, ale zostały dodane niewielkie rozszerzenia.
 
-%package -n python3-mox3
-Summary:	Mock object framework for Python 3
-Summary(pl.UTF-8):	Szkielet obiektów atrap dla Pythona 3
-Group:		Libraries/Python
-Requires:	python3-modules >= 1:3.6
-
-%description -n python3-mox3
-Mox3 is an unofficial port of the Google mox framework to Python 3. It
-was meant to be as compatible with mox as possible, but small
-enhancements have been made.
-
-%description -n python3-mox3 -l pl.UTF-8
-Mox3 to nieoficjalny port szkieletu Google mox do Pythona 3. Ma być
-możliwie zgodny z mox, ale zostały dodane niewielkie rozszerzenia.
-
 %package apidocs
 Summary:	API documentation for Python mox3 module
 Summary(pl.UTF-8):	Dokumentacja API modułu Pythona mox3
@@ -88,62 +56,34 @@ Dokumentacja API modułu Pythona mox3.
 
 %prep
 %setup -q -n mox3-%{version}
+%patch -P0 -p1
 
 %build
-%if %{with python2}
-%py_build
-
-%if %{with tests}
-stestr run
-%endif
-%endif
-
-%if %{with python3}
 %py3_build
 
 %if %{with tests}
 stestr run
 %endif
-%endif
 
 %if %{with doc}
-sphinx-build-2 -b html doc/source doc/build/html
+sphinx-build-3 -b html doc/source doc/build/html
 %endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-%if %{with python2}
-%py_install
-
-%py_postclean
-%{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/mox3/tests
-%endif
-
-%if %{with python3}
 %py3_install
 
 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/mox3/tests
-%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%if %{with python2}
 %files
 %defattr(644,root,root,755)
 %doc AUTHORS ChangeLog README.rst
-%{py_sitescriptdir}/mox3
-%{py_sitescriptdir}/mox3-%{version}-py*.egg-info
-%endif
-
-%if %{with python3}
-%files -n python3-mox3
-%defattr(644,root,root,755)
-%doc AUTHORS ChangeLog README.rst
 %{py3_sitescriptdir}/mox3
 %{py3_sitescriptdir}/mox3-%{version}-py*.egg-info
-%endif
 
 %if %{with doc}
 %files apidocs
diff --git a/mox3-inspect-update.patch b/mox3-inspect-update.patch
new file mode 100644
index 0000000..9508c71
--- /dev/null
+++ b/mox3-inspect-update.patch
@@ -0,0 +1,15 @@
+--- mox3-1.1.0/mox3/mox.py.orig	2020-06-04 12:40:20.000000000 +0200
++++ mox3-1.1.0/mox3/mox.py	2025-11-01 21:36:31.945334971 +0100
+@@ -906,7 +906,11 @@ class MethodSignatureChecker(object):
+                         can't be inspected.
+         """
+         try:
+-            self._args, varargs, varkw, defaults = inspect.getargspec(method)
++            ret = inspect.getfullargspec(method)
++            self._args = ret.args
++            varargs = ret.varargs
++            varkw = ret.varkw
++            defaults = ret.defaults
+         except TypeError:
+             raise ValueError('Could not get argument specification for %r'
+                              % (method,))
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-mox3.git/commitdiff/e8e742028196e34877b8f5c1b9e4fef0c6d16aa9



More information about the pld-cvs-commit mailing list