From 55d028b886c734266ad28c2f22a8af1a82df8fce6cecf15e1d0d20995d581f16 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 16 Feb 2024 16:36:37 +0000 Subject: [PATCH] Accepting request 1147132 from home:bnavigator:branches:devel:languages:python - Remove bogus unmaintained pyannotate test dependency * Add py7zr-remove-pyannotate.patch gh#miurahr/py7zr#552 OBS-URL: https://build.opensuse.org/request/show/1147132 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-py7zr?expand=0&rev=18 --- py7zr-remove-pyannotate.patch | 48 +++++++++++++++++++++++++++++++++++ python-py7zr.changes | 6 +++++ python-py7zr.spec | 17 ++++++------- 3 files changed, 62 insertions(+), 9 deletions(-) create mode 100644 py7zr-remove-pyannotate.patch diff --git a/py7zr-remove-pyannotate.patch b/py7zr-remove-pyannotate.patch new file mode 100644 index 0000000..8c8e7c1 --- /dev/null +++ b/py7zr-remove-pyannotate.patch @@ -0,0 +1,48 @@ +From e539448ce6a0d65371e79dc9f39b7cad59da0476 Mon Sep 17 00:00:00 2001 +From: YOKOTA Hiroshi +Date: Mon, 25 Dec 2023 21:03:19 +0900 +Subject: [PATCH] Drop pyannotate from test code + +pyannotate uses lib2to3 that will be drop in Python 3.13. +So, pyannotate will be obsolete in Python 3.13. + +lib2to3 is deprecated in Python 3.11, and it will be removes in Python 3.13. +See also: + https://docs.python.org/3.12/library/2to3.html#module-lib2to3 +--- + tests/conftest.py | 22 ---------------------- + 1 file changed, 22 deletions(-) + +diff --git a/tests/conftest.py b/tests/conftest.py +index 34ead5ed..c398f866 100644 +--- a/tests/conftest.py ++++ b/tests/conftest.py +@@ -4,28 +4,6 @@ + + import cpuinfo + import pytest +-from pyannotate_runtime import collect_types +- +- +-def pytest_collection_finish(session): +- """Handle the pytest collection finish hook: configure pyannotate. +- Explicitly delay importing `collect_types` until all tests have +- been collected. This gives gevent a chance to monkey patch the +- world before importing pyannotate. +- """ +- collect_types.init_types_collection() +- +- +-@pytest.fixture(autouse=True) +-def collect_types_fixture(): +- collect_types.start() +- yield +- collect_types.stop() +- +- +-def pytest_sessionfinish(session, exitstatus): +- os.makedirs("build/", exist_ok=True) +- collect_types.dump_stats("build/type_info.json") + + + def pytest_benchmark_update_json(config, benchmarks, output_json): diff --git a/python-py7zr.changes b/python-py7zr.changes index 3126cf2..92a3038 100644 --- a/python-py7zr.changes +++ b/python-py7zr.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Feb 16 15:40:08 UTC 2024 - Ben Greiner + +- Remove bogus unmaintained pyannotate test dependency + * Add py7zr-remove-pyannotate.patch gh#miurahr/py7zr#552 + ------------------------------------------------------------------- Wed Dec 27 13:59:12 UTC 2023 - Dirk Müller diff --git a/python-py7zr.spec b/python-py7zr.spec index d901671..a37831d 100644 --- a/python-py7zr.spec +++ b/python-py7zr.spec @@ -1,7 +1,7 @@ # -# spec file +# spec file for package python-py7zr # -# 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 @@ -33,6 +33,8 @@ License: LGPL-2.1-or-later Group: Development/Languages/Python URL: https://github.com/miurahr/py7zr Source0: https://files.pythonhosted.org/packages/source/p/py7zr/py7zr-%{version}.tar.gz +# PATCH-FIX-UPSTREAM py7zr-remove-pyannotate.patch gh#miurahr/py7zr#552 +Patch0: https://github.com/miurahr/py7zr/pull/552.patch#/py7zr-remove-pyannotate.patch BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools >= 63} @@ -46,20 +48,17 @@ Requires: python-psutil Requires: python-pycryptodomex >= 3.16.0 Requires: python-pyzstd >= 0.15.9 Requires: python-texttable +Requires: (python-inflate64 >= 1.0.0 with python-inflate64 < 1.1.0) Requires: (python-pybcj >= 1.0.0 with python-pybcj < 1.1.0) Requires: (python-pyppmd >= 1.1.0 with python-pyppmd < 1.2.0) %if 0%{?python_version_nodots} < 38 Requires: python-importlib_metadata %endif -%if 0%{?python_version_nodots} > 36 -Requires: (python-inflate64 >= 1.0.0 with python-inflate64 < 1.1.0) -%endif Requires(post): update-alternatives -Requires(postun):update-alternatives +Requires(postun): update-alternatives %if %{with test} BuildRequires: %{python_module py-cpuinfo} BuildRequires: %{python_module py7zr = %{version}} -BuildRequires: %{python_module pyannotate} BuildRequires: %{python_module pytest-benchmark} BuildRequires: %{python_module pytest-remotedata} BuildRequires: %{python_module pytest-timeout} @@ -72,7 +71,7 @@ BuildArch: noarch py7zr is a library and utility to support 7zip archive compression, decompression, encryption and decryption written by Python programming language. %prep -%setup -q -n py7zr-%{version} +%autosetup -p1 -n py7zr-%{version} # remove shebangs from source sed -i '1{/#!/d}' py7zr/*.py @@ -102,7 +101,7 @@ sed -i '1{/#!/d}' py7zr/*.py %license LICENSE %doc README.rst docs/Changelog.rst %{python_sitelib}/py7zr -%{python_sitelib}/py7zr-%{version}*-info +%{python_sitelib}/py7zr-%{version}.dist-info %python_alternative %{_bindir}/py7zr %endif