[packages/python3-cbor2] - python-cbor2.spec updated to 5.6.3 for python 3.8+

qboosh qboosh at pld-linux.org
Sun May 19 13:25:02 CEST 2024


commit 56e4874180b32be4faa5305ea457260cec918e66
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun May 19 13:25:41 2024 +0200

    - python-cbor2.spec updated to 5.6.3 for python 3.8+

 cbor2-py2.patch    |  49 -----------------
 python-cbor2.spec  | 153 -----------------------------------------------------
 python3-cbor2.spec |  99 ++++++++++++++++++++++++++++++++++
 3 files changed, 99 insertions(+), 202 deletions(-)
---
diff --git a/python-cbor2.spec b/python-cbor2.spec
deleted file mode 100644
index 75a9d08..0000000
--- a/python-cbor2.spec
+++ /dev/null
@@ -1,153 +0,0 @@
-#
-# Conditional build:
-%bcond_without	doc	# Sphinx documentation
-%bcond_without	tests	# unit tests
-%bcond_without	python2 # CPython 2.x module
-%bcond_without	python3 # CPython 3.x module
-
-Summary:	CBOR (de)serializer with extensive tag support
-Summary(pl.UTF-8):	(De)serializer CBOR z obszerną obsługą znaczników
-Name:		python-cbor2
-# keep 5.2.x here for python2 support
-Version:	5.2.0.post1
-Release:	1
-License:	MIT
-Group:		Libraries/Python
-#Source0Download: https://pypi.org/simple/cbor2/
-Source0:	https://files.pythonhosted.org/packages/source/c/cbor2/cbor2-%{version}.tar.gz
-# Source0-md5:	57f0838f52864ce628621da0498f58f4
-Patch0:		cbor2-py2.patch
-URL:		https://pypi.org/project/cbor2/
-%if %{with python2}
-BuildRequires:	python-modules >= 1:2.7
-BuildRequires:	python-setuptools >= 1:40.7.0
-BuildRequires:	python-setuptools_scm >= 1.7.0
-%if %{with tests}
-BuildRequires:	python-pytest
-BuildRequires:	python-pytest-cov
-%endif
-%endif
-%if %{with python3}
-BuildRequires:	python3-modules >= 1:3.5
-BuildRequires:	python3-setuptools >= 1:40.7.0
-BuildRequires:	python3-setuptools_scm >= 1.7.0
-BuildRequires:	python3-setuptools_scm < 6
-%if %{with tests}
-BuildRequires:	python3-pytest
-BuildRequires:	python3-pytest-cov
-%endif
-%endif
-BuildRequires:	rpm-pythonprov
-BuildRequires:	rpmbuild(macros) >= 1.714
-%if %{with doc}
-BuildRequires:	python-sphinx_rtd_theme
-BuildRequires:	sphinx-pdg-2
-%endif
-Requires:	python-modules >= 1:2.7
-BuildArch:	noarch
-BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-
-%description
-This library provides encoding and decoding for the Concise Binary
-Object Representation (CBOR, RFC 7049) serialization format.
-
-%description -l pl.UTF-8
-Ta biblioteka zapewnia kodowanie i dekodowanie formatu serializacji
-CBOR (Concise Binary Object Representation, RFC 7049).
-
-%package -n python3-cbor2
-Summary:	CBOR (de)serializer with extensive tag support
-Summary(pl.UTF-8):	(De)serializer CBOR z obszerną obsługą znaczników
-Group:		Libraries/Python
-Requires:	python3-modules >= 1:3.5
-
-%description -n python3-cbor2
-This library provides encoding and decoding for the Concise Binary
-Object Representation (CBOR, RFC 7049) serialization format.
-
-%description -n python3-cbor2 -l pl.UTF-8
-Ta biblioteka zapewnia kodowanie i dekodowanie formatu serializacji
-CBOR (Concise Binary Object Representation, RFC 7049).
-
-%package apidocs
-Summary:	API documentation for Python cbor2 module
-Summary(pl.UTF-8):	Dokumentacja API modułu Pythona cbor2
-Group:		Documentation
-
-%description apidocs
-API documentation for Python cbor2 module.
-
-%description apidocs -l pl.UTF-8
-Dokumentacja API modułu Pythona cbor2.
-
-%prep
-%setup -q -n cbor2-%{version}
-%patch0 -p1
-
-%build
-# not supported for python2
-export CBOR2_BUILD_C_EXTENSION=0
-%if %{with python2}
-%py_build
-
-%if %{with tests}
-PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
-PYTEST_PLUGINS="pytest_cov.plugin" \
-%{__python} -m pytest tests -k 'not test_huge'
-%endif
-%endif
-
-%if %{with python3}
-%py3_build
-
-%if %{with tests}
-PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
-PYTEST_PLUGINS="pytest_cov.plugin" \
-%{__python3} -m pytest tests -k 'not test_huge_truncated_bytes and not test_huge_truncated_string'
-%endif
-%endif
-
-%if %{with doc}
-PYTHONPATH=$(pwd) \
-sphinx-build-2 docs docs/_build/html
-%endif
-
-%install
-rm -rf $RPM_BUILD_ROOT
-
-export CBOR2_BUILD_C_EXTENSION=0
-
-%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 LICENSE.txt README.rst
-%{py_sitescriptdir}/cbor2
-%{py_sitescriptdir}/cbor2-%{version}-py*.egg-info
-%endif
-
-%if %{with python3}
-%files -n python3-cbor2
-%defattr(644,root,root,755)
-%doc LICENSE.txt README.rst
-%{py3_sitescriptdir}/cbor2
-%{py3_sitescriptdir}/cbor2-%{version}-py*.egg-info
-%endif
-
-%if %{with doc}
-%files apidocs
-%defattr(644,root,root,755)
-%doc docs/_build/html/{_static,modules,*.html,*.js}
-%endif
diff --git a/python3-cbor2.spec b/python3-cbor2.spec
new file mode 100644
index 0000000..564e63c
--- /dev/null
+++ b/python3-cbor2.spec
@@ -0,0 +1,99 @@
+#
+# Conditional build:
+%bcond_without	doc	# Sphinx documentation
+%bcond_without	tests	# unit tests
+
+Summary:	CBOR (de)serializer with extensive tag support
+Summary(pl.UTF-8):	(De)serializer CBOR z obszerną obsługą znaczników
+Name:		python3-cbor2
+Version:	5.6.3
+Release:	1
+License:	MIT
+Group:		Libraries/Python
+#Source0Download: https://pypi.org/simple/cbor2/
+Source0:	https://files.pythonhosted.org/packages/source/c/cbor2/cbor2-%{version}.tar.gz
+# Source0-md5:	6d8e78f7a746c94fcd32ff4ae50e5f0a
+URL:		https://pypi.org/project/cbor2/
+BuildRequires:	glibc-devel >= 6:2.9
+BuildRequires:	python3-modules >= 1:3.8
+BuildRequires:	python3-setuptools >= 1:61
+BuildRequires:	python3-setuptools_scm >= 6.4
+%if %{with tests}
+BuildRequires:	python3-pytest
+BuildRequires:	python3-pytest-cov
+%endif
+BuildRequires:	rpm-build >= 4.6
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.714
+%if %{with doc}
+BuildRequires:	python3-packaging
+BuildRequires:	python3-sphinx_autodoc_typehints >= 1.2.0
+BuildRequires:	python3-sphinx_rtd_theme >= 1.0.0
+# >= 1.3.0 when available in PLD
+%if "%{py3_ver}" != "3.12"
+BuildRequires:	python3-typing_extensions
+%endif
+BuildRequires:	sphinx-pdg-3 >= 4
+# >= 7 when available in PLD
+%endif
+Requires:	python3-modules >= 1:3.8
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+This library provides encoding and decoding for the Concise Binary
+Object Representation (CBOR, RFC 7049) serialization format.
+
+%description -l pl.UTF-8
+Ta biblioteka zapewnia kodowanie i dekodowanie formatu serializacji
+CBOR (Concise Binary Object Representation, RFC 7049).
+
+%package apidocs
+Summary:	API documentation for Python cbor2 module
+Summary(pl.UTF-8):	Dokumentacja API modułu Pythona cbor2
+Group:		Documentation
+BuildArch:	noarch
+
+%description apidocs
+API documentation for Python cbor2 module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona cbor2.
+
+%prep
+%setup -q -n cbor2-%{version}
+
+%build
+%py3_build
+
+%if %{with tests}
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS="pytest_cov.plugin" \
+%{__python3} -m pytest tests
+%endif
+
+%if %{with doc}
+PYTHONPATH=$(pwd) \
+sphinx-build-3 docs docs/_build/html
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%py3_install
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc LICENSE.txt README.rst
+%attr(755,root,root) %{_bindir}/cbor2
+%{py3_sitedir}/cbor2
+%attr(755,root,root) %{py3_sitedir}/_cbor2.cpython-*.so
+%{py3_sitedir}/cbor2-%{version}-py*.egg-info
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/_build/html/{_static,*.html,*.js}
+%endif
diff --git a/cbor2-py2.patch b/cbor2-py2.patch
deleted file mode 100644
index e1714c4..0000000
--- a/cbor2-py2.patch
+++ /dev/null
@@ -1,49 +0,0 @@
---- cbor2-5.2.0.post1/tests/test_decoder.py.orig	2021-12-22 23:33:04.000000000 +0100
-+++ cbor2-5.2.0.post1/tests/test_decoder.py	2024-05-19 12:10:34.423331549 +0200
-@@ -430,8 +430,8 @@ def test_uuid(impl):
- 
- @pytest.mark.skipif(sys.version_info < (3, 3), reason="Address decoding requires Py3.3+")
- @pytest.mark.parametrize('payload, expected', [
--    ('d9010444c00a0a01', ip_address('192.10.10.1')),
--    ('d901045020010db885a3000000008a2e03707334', ip_address('2001:db8:85a3::8a2e:370:7334')),
-+    ('d9010444c00a0a01', ip_address(u'192.10.10.1')),
-+    ('d901045020010db885a3000000008a2e03707334', ip_address(u'2001:db8:85a3::8a2e:370:7334')),
-     ('d9010446010203040506', (260, b'\x01\x02\x03\x04\x05\x06')),
- ], ids=[
-     'ipv4',
-@@ -459,9 +459,9 @@ def test_bad_ipaddress(impl):
- 
- @pytest.mark.skipif(sys.version_info < (3, 5), reason="Network decoding requires Py3.5+")
- @pytest.mark.parametrize('payload, expected', [
--    ('d90105a144c0a800641818', ip_network('192.168.0.100/24', False)),
-+    ('d90105a144c0a800641818', ip_network(u'192.168.0.100/24', False)),
-     ('d90105a15020010db885a3000000008a2e000000001860',
--     ip_network('2001:db8:85a3:0:0:8a2e::/96', False)),
-+     ip_network(u'2001:db8:85a3:0:0:8a2e::/96', False)),
- ], ids=[
-     'ipv4',
-     'ipv6',
---- cbor2-5.2.0.post1/tests/test_encoder.py.orig	2021-12-22 23:33:04.000000000 +0100
-+++ cbor2-5.2.0.post1/tests/test_encoder.py	2024-05-19 12:11:16.003106292 +0200
-@@ -302,8 +302,8 @@ def test_uuid(impl):
- 
- @pytest.mark.skipif(sys.version_info < (3, 3), reason="Address encoding requires Py3.3+")
- @pytest.mark.parametrize('value, expected', [
--    (ip_address('192.10.10.1'), 'd9010444c00a0a01'),
--    (ip_address('2001:db8:85a3::8a2e:370:7334'), 'd901045020010db885a3000000008a2e03707334'),
-+    (ip_address(u'192.10.10.1'), 'd9010444c00a0a01'),
-+    (ip_address(u'2001:db8:85a3::8a2e:370:7334'), 'd901045020010db885a3000000008a2e03707334'),
- ], ids=[
-     'ipv4',
-     'ipv6',
-@@ -315,8 +315,8 @@ def test_ipaddress(impl, value, expected
- 
- @pytest.mark.skipif(sys.version_info < (3, 3), reason="Network encoding requires Py3.3+")
- @pytest.mark.parametrize('value, expected', [
--    (ip_network('192.168.0.100/24', False), 'd90105a144c0a800001818'),
--    (ip_network('2001:db8:85a3:0:0:8a2e::/96', False),
-+    (ip_network(u'192.168.0.100/24', False), 'd90105a144c0a800001818'),
-+    (ip_network(u'2001:db8:85a3:0:0:8a2e::/96', False),
-      'd90105a15020010db885a3000000008a2e000000001860'),
- ], ids=[
-     'ipv4',
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-cbor2.git/commitdiff/56e4874180b32be4faa5305ea457260cec918e66



More information about the pld-cvs-commit mailing list