[packages/python3-aspectlib] - python-aspectlib.spec updated to 2.0.0 for python 3.7+

qboosh qboosh at pld-linux.org
Sun Jun 29 19:51:14 CEST 2025


commit b58894ebb9fc5f270b679f3b4d6c808fe5af81b1
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Jun 29 19:52:40 2025 +0200

    - python-aspectlib.spec updated to 2.0.0 for python 3.7+

 aspectlib-exception.patch                       | 21 ++++++++++++
 aspectlib-pytest.patch                          | 11 +++++++
 python-aspectlib.spec => python3-aspectlib.spec | 43 +++++++++++++------------
 3 files changed, 54 insertions(+), 21 deletions(-)
---
diff --git a/python-aspectlib.spec b/python3-aspectlib.spec
similarity index 72%
rename from python-aspectlib.spec
rename to python3-aspectlib.spec
index b2af368..115fafa 100644
--- a/python-aspectlib.spec
+++ b/python3-aspectlib.spec
@@ -5,31 +5,32 @@
 
 Summary:	Aspect-oriented programming, monkey-patch and decorators library
 Summary(pl.UTF-8):	Biblioteka programowania zorientowanego aspektowo, małpich łatek i dekoratorów
-Name:		python-aspectlib
-# keep 1.x here for python2 support
-Version:	1.5.2
+Name:		python3-aspectlib
+Version:	2.0.0
 Release:	1
 License:	BSD
 Group:		Libraries/Python
 #Source0Download: https://pypi.org/simple/aspectlib/
 Source0:	https://files.pythonhosted.org/packages/source/a/aspectlib/aspectlib-%{version}.tar.gz
-# Source0-md5:	cabf659c49b5e310df8a92b88f65e860
+# Source0-md5:	427f325a4a9a5dc85563cbb08569bcd9
+Patch0:		aspectlib-pytest.patch
+Patch1:		aspectlib-exception.patch
 URL:		https://pypi.org/project/aspectlib/
-BuildRequires:	python-modules >= 1:2.7
-BuildRequires:	python-setuptools >= 1:30.3.0
+BuildRequires:	python3-modules >= 1:3.7
+BuildRequires:	python3-setuptools >= 1:30.3.0
 %if %{with tests}
-BuildRequires:	python-fields
-BuildRequires:	python-process_tests
-BuildRequires:	python-pytest
-BuildRequires:	python-tornado
+BuildRequires:	python3-fields
+BuildRequires:	python3-process_tests
+BuildRequires:	python3-pytest
+BuildRequires:	python3-tornado
 %endif
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.714
 %if %{with doc}
-BuildRequires:	python-sphinx_py3doc_enhanced_theme
-BuildRequires:	sphinx-pdg-2 >= 1.3
+BuildRequires:	python3-sphinx_py3doc_enhanced_theme
+BuildRequires:	sphinx-pdg-3 >= 1.3
 %endif
-Requires:	python-modules >= 1:2.7
+Requires:	python3-modules >= 1:3.7
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -59,28 +60,28 @@ Dokumentacja API modułu Pythona aspectlib.
 
 %prep
 %setup -q -n aspectlib-%{version}
+%patch -P0 -p1
+%patch -P1 -p1
 
 %build
-%py_build
+%py3_build
 
 %if %{with tests}
 # disable tests using localhost networking
 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
 PYTHONPATH=$(pwd)/src \
-%{__python} -m pytest tests -k 'not test_socket and not test_socket_as_string_target and not test_realsocket_makefile'
+%{__python3} -m pytest tests -k 'not test_socket and not test_socket_as_string_target and not test_realsocket_makefile'
 %endif
 
 %if %{with doc}
 PYTHONPATH=$(pwd)/src \
-sphinx-build-2 -b html docs docs/_build/html
+sphinx-build-3 -b html docs docs/_build/html
 %endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-%py_install
-
-%py_postclean
+%py3_install
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -88,8 +89,8 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(644,root,root,755)
 %doc AUTHORS.rst CHANGELOG.rst LICENSE README.rst
-%{py_sitescriptdir}/aspectlib
-%{py_sitescriptdir}/aspectlib-%{version}-py*.egg-info
+%{py3_sitescriptdir}/aspectlib
+%{py3_sitescriptdir}/aspectlib-%{version}-py*.egg-info
 
 %if %{with doc}
 %files apidocs
diff --git a/aspectlib-exception.patch b/aspectlib-exception.patch
new file mode 100644
index 0000000..117a25b
--- /dev/null
+++ b/aspectlib-exception.patch
@@ -0,0 +1,21 @@
+From 2516ffe0110d93ac228f2fe15be74f905984f071 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ionel=20Cristian=20M=C4=83rie=C8=99?= <contact at ionelmc.ro>
+Date: Mon, 12 Aug 2024 18:41:11 +0300
+Subject: [PATCH] Ignore throw 3-arg deprecation.
+
+---
+ pytest.ini | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/pytest.ini b/pytest.ini
+index de53382..118418c 100644
+--- a/pytest.ini
++++ b/pytest.ini
+@@ -32,6 +32,7 @@ testpaths =
+ filterwarnings =
+     error
+     ignore:Setting test_aspectlib.MissingGlobal to <class 'test_aspectlib.MissingGlobal'>. There was no previous definition, probably patching the wrong module.
++    ignore:the \(type, exc, tb\) signature of throw\(\) is deprecated, use the single-arg signature instead.:DeprecationWarning
+ # You can add exclusions, some examples:
+ #    ignore:'aspectlib' defines default_app_config:PendingDeprecationWarning::
+ #    ignore:The {{% if:::
diff --git a/aspectlib-pytest.patch b/aspectlib-pytest.patch
new file mode 100644
index 0000000..7443572
--- /dev/null
+++ b/aspectlib-pytest.patch
@@ -0,0 +1,11 @@
+https://docs.pytest.org/en/latest/deprecations.html#py-path-local-arguments-for-hooks-replaced-with-pathlib-path
+--- aspectlib-2.0.0/tests/conftest.py.orig	2022-10-20 17:47:24.000000000 +0200
++++ aspectlib-2.0.0/tests/conftest.py	2025-06-29 14:50:41.569755138 +0200
+@@ -1,5 +1,5 @@
+-def pytest_ignore_collect(path, config):
+-    basename = path.basename
++def pytest_ignore_collect(collection_path, config):
++    basename = collection_path.name
+ 
+     if 'pytestsupport' in basename:
+         return True
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-aspectlib.git/commitdiff/b58894ebb9fc5f270b679f3b4d6c808fe5af81b1



More information about the pld-cvs-commit mailing list