[packages/python3-munch] - up to 4.0.0
baggins
baggins at pld-linux.org
Mon Jun 2 09:26:55 CEST 2025
commit 7d37c70cd9cdb42d8c9d900ca70e81d4a635fb11
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Mon Jun 2 10:13:23 2025 +0200
- up to 4.0.0
Adjust-tests-for-Python-3.13.patch | 32 ++++++++++
python-munch.spec | 117 -------------------------------------
python3-munch.spec | 64 ++++++++++++++++++++
3 files changed, 96 insertions(+), 117 deletions(-)
---
diff --git a/python-munch.spec b/python-munch.spec
deleted file mode 100644
index 2e32d11..0000000
--- a/python-munch.spec
+++ /dev/null
@@ -1,117 +0,0 @@
-#
-# Conditional build:
-%bcond_without tests # unit tests
-%bcond_without python2 # CPython 2.x module
-%bcond_without python3 # CPython 3.x module
-
-Summary: A dot-accessible dictionary (a la JavaScript objects)
-Summary(pl.UTF-8): Słownik dostępny przez kropkę (jak obiekty JavaScriptu)
-Name: python-munch
-# keep 2.x here for python2 support
-Version: 2.5.0
-Release: 3
-License: MIT
-Group: Libraries/Python
-#Source0Download: https://pypi.org/simple/munch/
-Source0: https://files.pythonhosted.org/packages/source/m/munch/munch-%{version}.tar.gz
-# Source0-md5: ed84c3718416c8d4d03d0a6ef46e8e0c
-URL: https://pypi.org/project/munch/
-%if %{with python2}
-BuildRequires: python-modules >= 1:2.7
-BuildRequires: python-pbr >= 3.0
-BuildRequires: python-setuptools >= 1:17.1
-%if %{with tests}
-BuildRequires: python-PyYAML >= 5.1.0
-BuildRequires: python-pytest
-%endif
-%endif
-%if %{with python3}
-BuildRequires: python3-modules >= 1:3.5
-BuildRequires: python3-pbr >= 3.0
-BuildRequires: python3-setuptools >= 1:17.1
-%if %{with tests}
-BuildRequires: python3-PyYAML >= 5.1.0
-BuildRequires: python3-pytest
-%endif
-%endif
-BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.714
-Requires: python-modules >= 1:2.7
-BuildArch: noarch
-BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-
-%description
-Munch is a dictionary that supports attribute-style access, a la
-JavaScript.
-
-%description -l pl.UTF-8
-Munch to słownik obsługujący dostęp w stylu atrybutów, jak w
-JavaScripcie.
-
-%package -n python3-munch
-Summary: A dot-accessible dictionary (a la JavaScript objects)
-Summary(pl.UTF-8): Słownik dostępny przez kropkę (jak obiekty JavaScriptu)
-Group: Libraries/Python
-Requires: python3-modules >= 1:3.5
-
-%description -n python3-munch
-Munch is a dictionary that supports attribute-style access, a la
-JavaScript.
-
-%description -n python3-munch -l pl.UTF-8
-Munch to słownik obsługujący dostęp w stylu atrybutów, jak w
-JavaScripcie.
-
-%prep
-%setup -q -n munch-%{version}
-
-%build
-%if %{with python2}
-%py_build
-
-%if %{with tests}
-PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
-%{__python} -m pytest tests
-%endif
-%endif
-
-%if %{with python3}
-%py3_build
-
-%if %{with tests}
-PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
-%{__python3} -m pytest tests
-%endif
-%endif
-
-%install
-rm -rf $RPM_BUILD_ROOT
-
-%if %{with python2}
-%py_install
-
-%py_postclean
-%endif
-
-%if %{with python3}
-%py3_install
-%endif
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%if %{with python2}
-%files
-%defattr(644,root,root,755)
-%doc AUTHORS CHANGELOG.md ChangeLog LICENSE.txt README.md
-%{py_sitescriptdir}/munch
-%{py_sitescriptdir}/munch-%{version}-py*.egg-info
-%endif
-
-%if %{with python3}
-%files -n python3-munch
-%defattr(644,root,root,755)
-%doc AUTHORS CHANGELOG.md ChangeLog LICENSE.txt README.md
-%{py3_sitescriptdir}/munch
-%{py3_sitescriptdir}/munch-%{version}-py*.egg-info
-%endif
diff --git a/python3-munch.spec b/python3-munch.spec
new file mode 100644
index 0000000..2752f57
--- /dev/null
+++ b/python3-munch.spec
@@ -0,0 +1,64 @@
+#
+# Conditional build:
+%bcond_without tests # unit tests
+
+Summary: A dot-accessible dictionary (a la JavaScript objects)
+Summary(pl.UTF-8): Słownik dostępny przez kropkę (jak obiekty JavaScriptu)
+Name: python3-munch
+Version: 4.0.0
+Release: 1
+License: MIT
+Group: Libraries/Python
+#Source0Download: https://pypi.org/simple/munch/
+Source0: https://files.pythonhosted.org/packages/source/m/munch/munch-%{version}.tar.gz
+# Source0-md5: 4e70cf760e3b81dcaa6050803c1dbd72
+Patch0: Adjust-tests-for-Python-3.13.patch
+URL: https://pypi.org/project/munch/
+BuildRequires: python3-modules >= 1:3.5
+BuildRequires: python3-pbr >= 3.0
+BuildRequires: python3-setuptools >= 1:17.1
+%if %{with tests}
+BuildRequires: python3-PyYAML >= 5.1.0
+BuildRequires: python3-pytest
+%endif
+BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 1.714
+Requires: python3-modules >= 1:3.6
+BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Munch is a dictionary that supports attribute-style access, a la
+JavaScript.
+
+%description -l pl.UTF-8
+Munch to słownik obsługujący dostęp w stylu atrybutów, jak w
+JavaScripcie.
+
+%prep
+%setup -q -n munch-%{version}
+%patch -P0 -p1
+
+%build
+%py3_build
+
+%if %{with tests}
+# use explicit plugins list for reliable builds (delete PYTEST_PLUGINS if empty)
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS= \
+%{__python3} -m pytest tests
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%py3_install
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc AUTHORS CHANGELOG.md ChangeLog LICENSE.txt README.md
+%{py3_sitescriptdir}/munch
+%{py3_sitescriptdir}/munch-%{version}-py*.egg-info
diff --git a/Adjust-tests-for-Python-3.13.patch b/Adjust-tests-for-Python-3.13.patch
new file mode 100644
index 0000000..346b72e
--- /dev/null
+++ b/Adjust-tests-for-Python-3.13.patch
@@ -0,0 +1,32 @@
+From c5563ce5c0328e4a59d676cdf35740567978742b Mon Sep 17 00:00:00 2001
+From: Karolina Surma <ksurma at redhat.com>
+Date: Wed, 5 Jun 2024 09:40:17 +0200
+Subject: [PATCH] Adjust tests for Python 3.13
+
+---
+ tests/test_munch.py | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/tests/test_munch.py b/tests/test_munch.py
+index 9dadcee..70fa82c 100644
+--- a/tests/test_munch.py
++++ b/tests/test_munch.py
+@@ -225,6 +225,15 @@ def test_reserved_attributes(attrname):
+ assert attr == 'munch'
+ elif attrname == '__dict__':
+ assert attr == {}
++ elif attrname == '__static_attributes__':
++ # Python 3.13: added __static_attributes__ attribute, populated by the
++ # compiler, containing a tuple of names of attributes of this class
++ # which are accessed through self.X from any function in its body.
++ assert isinstance(attr, tuple)
++ elif attrname == '__firstlineno__':
++ # Python 3.13: added __firstlineno__ attribute, populated by the
++ # compiler, containing the line number of the first line of the class definition
++ assert isinstance(attr, int)
+ else:
+ assert callable(attr)
+
+--
+2.44.0
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python3-munch.git/commitdiff/7d37c70cd9cdb42d8c9d900ca70e81d4a635fb11
More information about the pld-cvs-commit
mailing list