diff --git a/pytest74.patch b/pytest74.patch new file mode 100644 index 0000000..f9ca1f7 --- /dev/null +++ b/pytest74.patch @@ -0,0 +1,43 @@ +From df0d221c1d9da1454a5ef7fd72675d8d43b96eb0 Mon Sep 17 00:00:00 2001 +From: Chris Withers +Date: Tue, 4 Jul 2023 18:54:22 +0100 +Subject: [PATCH] Deal with more pytest internals changing + +--- + .circleci/config.yml | 3 ++- + sybil/integration/pytest.py | 22 +++++++++++++++++----- + 2 files changed, 19 insertions(+), 6 deletions(-) + +diff --git a/sybil/integration/pytest.py b/sybil/integration/pytest.py +index b32062d..8529771 100644 +--- a/sybil/integration/pytest.py ++++ b/sybil/integration/pytest.py +@@ -78,11 +78,23 @@ def setup(self): + def runtest(self): + self.example.evaluate() + +- def _prunetraceback(self, excinfo): +- tb = excinfo.traceback.cut(path=example_module_path) +- tb = tb[1] +- if getattr(tb, '_rawentry', None) is not None: +- excinfo.traceback = Traceback(tb._rawentry, excinfo) ++ if PYTEST_VERSION >= (7, 4, 0): ++ ++ def _traceback_filter(self, excinfo: ExceptionInfo[BaseException]) -> Traceback: ++ traceback = excinfo.traceback ++ tb = traceback.cut(path=example_module_path) ++ tb = tb[1] ++ if getattr(tb, '_rawentry', None) is not None: ++ traceback = Traceback(tb._rawentry) ++ return traceback ++ ++ else: ++ ++ def _prunetraceback(self, excinfo): ++ tb = excinfo.traceback.cut(path=example_module_path) ++ tb = tb[1] ++ if getattr(tb, '_rawentry', None) is not None: ++ excinfo.traceback = Traceback(tb._rawentry, excinfo) + + def repr_failure( + self, diff --git a/python-sybil-fix-ordering.diff b/python-sybil-fix-ordering.diff deleted file mode 100644 index a0fd1c9..0000000 --- a/python-sybil-fix-ordering.diff +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/sybil/integration/unittest.py b/sybil/integration/unittest.py -index 7129ddf..ce34caf 100644 ---- a/sybil/integration/unittest.py -+++ b/sybil/integration/unittest.py -@@ -38,7 +38,7 @@ def unittest_integration(sybil: 'Sybil'): - - def load_tests(loader=None, tests=None, pattern=None): - suite = TestSuite() -- for path in sybil.path.glob('**/*'): -+ for path in sorted(sybil.path.glob('**/*')): - if path.is_file() and sybil.should_parse(path): - document = sybil.parse(path) - -diff --git a/tests/test_sybil.py b/tests/test_sybil.py -index 74a04ea..72a5aea 100644 ---- a/tests/test_sybil.py -+++ b/tests/test_sybil.py -@@ -243,7 +243,7 @@ def parse(document): - - def test_namespace(capsys): - sybil = Sybil([parse], path='./samples') -- documents = [sybil.parse(p) for p in sybil.path.glob('sample*.txt')] -+ documents = [sybil.parse(p) for p in sorted(sybil.path.glob('sample*.txt'))] - actual = [] - for document in documents: - for example in document: diff --git a/python-sybil.changes b/python-sybil.changes index afcd1bb..d2872cb 100644 --- a/python-sybil.changes +++ b/python-sybil.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Tue Jul 25 12:42:51 UTC 2023 - Markéta Machová + +- Update to 3.0.1 + * Continue with the ever shifting sands of pytest APIs, this time + appeasing warnings from pytest 7 that when fixed break compatibility + with pytest 6. +- Drop python-sybil-fix-ordering.diff +- Add pytest74.patch to support pytest 7.4 + ------------------------------------------------------------------- Tue Jun 13 11:23:08 UTC 2023 - Dirk Müller diff --git a/python-sybil.spec b/python-sybil.spec index 8e39f8b..af48c19 100644 --- a/python-sybil.spec +++ b/python-sybil.spec @@ -18,13 +18,14 @@ %{?sle15_python_module_pythons} Name: python-sybil -Version: 3.0.0 +Version: 3.0.1 Release: 0 Summary: Automated testing of examples in documentation License: MIT URL: https://github.com/cjw296/sybil Source: https://files.pythonhosted.org/packages/source/s/sybil/sybil-%{version}.tar.gz -Patch0: python-sybil-fix-ordering.diff +#PATCH-FIX-UPSTREAM https://github.com/simplistix/sybil/commit/df0d221c1d9da1454a5ef7fd72675d8d43b96eb0 Deal with more pytest internals changing +Patch: pytest74.patch BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest >= 6.2} BuildRequires: %{python_module setuptools-git} diff --git a/sybil-3.0.0.tar.gz b/sybil-3.0.0.tar.gz deleted file mode 100644 index a345d95..0000000 --- a/sybil-3.0.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7692ed66e793e5e79ae6a70cf2cf861917ed48eaff0d8adf825e64d85820f251 -size 38011 diff --git a/sybil-3.0.1.tar.gz b/sybil-3.0.1.tar.gz new file mode 100644 index 0000000..39d781e --- /dev/null +++ b/sybil-3.0.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f02dc2204af7e5a212037924d974f72781f6dc18fd3c44cc7ce463a120f530d +size 38265