From 605ba2a4ce75a0abcbce5a8af5e3703a3d8b1666105dc474fddc8ea6d2bcea7e Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Fri, 9 Dec 2022 10:51:24 +0000 Subject: [PATCH] Accepting request 1041386 from home:pgajdos:python - do not require mock - use -p1 as quilt refresh does not like higher ones - modified patches % pytest-fixtures-pr171-remove-mock.patch (refreshed) - added patches fix https://github.com/man-group/pytest-plugins/issues/209 + python-pytest-profiling-no-six.patch OBS-URL: https://build.opensuse.org/request/show/1041386 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-profiling?expand=0&rev=7 --- pytest-fixtures-pr171-remove-mock.patch | 4 +-- python-pytest-profiling-no-six.patch | 38 +++++++++++++++++++++++++ python-pytest-profiling.changes | 11 +++++++ python-pytest-profiling.spec | 6 ++-- 4 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 python-pytest-profiling-no-six.patch diff --git a/pytest-fixtures-pr171-remove-mock.patch b/pytest-fixtures-pr171-remove-mock.patch index 240e105..19aaf96 100644 --- a/pytest-fixtures-pr171-remove-mock.patch +++ b/pytest-fixtures-pr171-remove-mock.patch @@ -1,7 +1,7 @@ diff --git a/pytest-profiling/tests/unit/test_profile.py b/pytest-profiling/tests/unit/test_profile.py index 616c4c6..614422e 100644 ---- a/pytest-profiling/tests/unit/test_profile.py -+++ b/pytest-profiling/tests/unit/test_profile.py +--- a/tests/unit/test_profile.py ++++ b/tests/unit/test_profile.py @@ -8,7 +8,12 @@ reload_module(pytest_profiling) diff --git a/python-pytest-profiling-no-six.patch b/python-pytest-profiling-no-six.patch new file mode 100644 index 0000000..7faf675 --- /dev/null +++ b/python-pytest-profiling-no-six.patch @@ -0,0 +1,38 @@ +Index: pytest-profiling-1.7.0/pytest_profiling.py +=================================================================== +--- pytest-profiling-1.7.0.orig/pytest_profiling.py ++++ pytest-profiling-1.7.0/pytest_profiling.py +@@ -10,7 +10,6 @@ import pipes + import errno + from hashlib import md5 + +-import six + import pytest + + LARGE_FILENAME_HASH_LEN = 8 +@@ -18,7 +17,7 @@ LARGE_FILENAME_HASH_LEN = 8 + + def clean_filename(s): + forbidden_chars = set('/?<>\:*|"') +- return six.text_type("".join(c if c not in forbidden_chars and ord(c) < 127 else '_' ++ return str("".join(c if c not in forbidden_chars and ord(c) < 127 else '_' + for c in s)) + + +Index: pytest-profiling-1.7.0/tests/unit/test_profile.py +=================================================================== +--- pytest-profiling-1.7.0.orig/tests/unit/test_profile.py ++++ pytest-profiling-1.7.0/tests/unit/test_profile.py +@@ -2,10 +2,10 @@ + # the top-level code in pytest_profiling will be omitted from + # coverage, so force it to be reloaded within this test unit under coverage + +-from six.moves import reload_module # @UnresolvedImport ++from importlib import reload # @UnresolvedImport + + import pytest_profiling +-reload_module(pytest_profiling) ++reload(pytest_profiling) + + from pytest_profiling import Profiling, pytest_addoption, pytest_configure + diff --git a/python-pytest-profiling.changes b/python-pytest-profiling.changes index 1bc6ba1..d57a0ef 100644 --- a/python-pytest-profiling.changes +++ b/python-pytest-profiling.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Thu Dec 8 11:56:08 UTC 2022 - pgajdos@suse.com + +- do not require mock +- use -p1 as quilt refresh does not like higher ones +- modified patches + % pytest-fixtures-pr171-remove-mock.patch (refreshed) +- added patches + fix https://github.com/man-group/pytest-plugins/issues/209 + + python-pytest-profiling-no-six.patch + ------------------------------------------------------------------- Thu Apr 21 21:34:18 UTC 2022 - Ben Greiner diff --git a/python-pytest-profiling.spec b/python-pytest-profiling.spec index 528155a..502e33e 100644 --- a/python-pytest-profiling.spec +++ b/python-pytest-profiling.spec @@ -28,20 +28,20 @@ URL: https://github.com/manahl/pytest-plugins Source: https://files.pythonhosted.org/packages/source/p/pytest-profiling/pytest-profiling-%{version}.tar.gz # PATCH-FEATURE-UPSTREAM pytest-fixtures-pr171-remove-mock.patch -- gh#man-group#pytest-plugins#171 Patch0: pytest-fixtures-pr171-remove-mock.patch +# https://github.com/man-group/pytest-plugins/issues/209 +Patch1: python-pytest-profiling-no-six.patch BuildRequires: %{python_module setuptools-git} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-gprof2dot Requires: python-pytest -Requires: python-six BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module gprof2dot} BuildRequires: %{python_module more-itertools} BuildRequires: %{python_module pytest-virtualenv} BuildRequires: %{python_module pytest} -BuildRequires: %{python_module six} %if %{with python2} BuildRequires: python2-mock %endif @@ -52,7 +52,7 @@ BuildRequires: python2-mock Profiling plugin for py.test %prep -%autosetup -p2 -n pytest-profiling-%{version} +%autosetup -p1 -n pytest-profiling-%{version} # Unpin sed -i 's/more-itertools==5.0.0/more-itertools/' tests/integration/test_profile_integration.py