Sync from SUSE:ALP:Source:Standard:1.0 python-sybil revision 56e37c054cb500d761d9d776d5b1c5de

This commit is contained in:
Adrian Schröter 2023-10-19 05:01:41 +02:00
commit 244bc201de
5 changed files with 288 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

43
pytest74.patch Normal file
View File

@ -0,0 +1,43 @@
From df0d221c1d9da1454a5ef7fd72675d8d43b96eb0 Mon Sep 17 00:00:00 2001
From: Chris Withers <chris@simplistix.co.uk>
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,

150
python-sybil.changes Normal file
View File

@ -0,0 +1,150 @@
-------------------------------------------------------------------
Tue Jul 25 12:42:51 UTC 2023 - Markéta Machová <mmachova@suse.com>
- 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 <dmueller@suse.com>
- tag sle15 for new python stack
-------------------------------------------------------------------
Thu Jun 9 11:23:04 UTC 2022 - Andreas Schneider <asn@cryptomilk.org>
- Add missing BR python-dataclasses for openSUSE Leap
-------------------------------------------------------------------
Wed Feb 16 11:44:28 UTC 2022 - Sasi Olin <hel@lcp.world>
- Add python-sybil-fix-ordering.diff fixing issue with tests
failing on different filesystem setups.
-------------------------------------------------------------------
Mon Dec 13 04:11:03 UTC 2021 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 3.0.0:
* Require pytest 6.2.0.
* Drop Python 2 support.
* Add support for Python 3.10
* Remove the encoding parameter to
:class:`~sybil.parsers.doctest.DocTestParser` as it is no longer used.
* :class:`~sybil.parsers.codeblock.CodeBlockParser` has been renamed to
:class:`~sybil.parsers.codeblock.PythonCodeBlockParser`, see the
:ref:`codeblock-parser` documentation for details.
* Support has been added to check examples in Python source code in
addition to documentation source files.
* :attr:`~sybil.parsers.doctest.FIX_BYTE_UNICODE_REPR` has been removed
as it should no longer be needed.
-------------------------------------------------------------------
Mon Feb 22 19:14:00 UTC 2021 - Ben Greiner <code@bnavigator.de>
- Update to 2.0.1
* Make :class:`~sybil.parsers.doctest.DocTestParser` more
permissive with respect to tabs in documents. Tabs that aren't
in the doctest block not longer cause parsing of the document to
fail.
- Release 2.0.0
* Drop support for nose.
* Handle encoded data returned by doctest execution on Python 2.
-------------------------------------------------------------------
Thu Aug 27 15:29:02 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
- update to 1.4.0
* Support pytest 6
* Have sybil support nested directories of source files
* Support a sequence of patterns rather than just one.
-------------------------------------------------------------------
Thu Apr 2 07:26:04 UTC 2020 - pgajdos@suse.com
- version update to 1.3.0
* Treat all documentation source files as being ``utf-8`` encoded. This can be overriden
by passing an encoding when instantiating a :class:`~sybil.Sybil`.
-------------------------------------------------------------------
Tue Mar 17 10:15:26 UTC 2020 - pgajdos@suse.com
- version update to 1.2.2
- Improvements to :attr:`~sybil.parsers.doctest.FIX_BYTE_UNICODE_REPR`
for multiple strings on a single line.
- Better handling of files with Windows line endings on Linux under Python 2.
- Fixes for pytest 3.1.0.
-------------------------------------------------------------------
Fri May 3 11:20:28 UTC 2019 - pgajdos@suse.com
- version update to 1.2.0
* Only compile code in :ref:`codeblocks <codeblock-parser>` at evaluation time,
giving :ref:`skip <skip-parser>` a chance to skip code blocks that won't
compile on a particular version of Python.
* Add warning about the limitations of
:attr:`~sybil.parsers.doctest.FIX_BYTE_UNICODE_REPR`.
* Support explicit filenames to include and patterns to exclude
when instantiating a :class:`~sybil.Sybil`.
* Add the :ref:`skip <skip-parser>` parser.
- deleted patches
- sybil-pytest4.patch (upstreamed)
-------------------------------------------------------------------
Tue Mar 26 22:38:48 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
- Remove irrelevant and invalid runtime dependencies
- Set pytest as a Recommends
- Remove unnecessary build dependencies
- Simplify %check routine
-------------------------------------------------------------------
Wed Nov 21 13:01:18 UTC 2018 - Tomáš Chvátal <tchvatal@suse.com>
- Add patch to work with new pytest:
* sybil-pytest4.patch
-------------------------------------------------------------------
Wed Aug 29 11:07:06 UTC 2018 - tchvatal@suse.com
- Raise pytest requirement to match up what is in setup.py
-------------------------------------------------------------------
Sat Aug 11 09:15:40 UTC 2018 - tchvatal@suse.com
- Version update to 1.0.9:
* Support pytest-3.7
-------------------------------------------------------------------
Sun Jul 29 12:31:09 UTC 2018 - jengelh@inai.de
- Do not let the description assume any specific use context.
-------------------------------------------------------------------
Thu May 24 17:49:50 UTC 2018 - toddrme2178@gmail.com
- Update 1.0.8
* Changes only to unit tests to support fixes in the latest release of pytest.
- Update 1.0.7
* Literal tabs may no longer be included in text that is parsed by the DocTestParser. Previously, tabs were expanded which could unpleasant problems.
- spec file cleanups
-------------------------------------------------------------------
Fri Jan 5 09:48:15 UTC 2018 - alarrosa@suse.com
- Update to 1.0.6
* Fix compatibility with pytest 3.3+.
-------------------------------------------------------------------
Mon Oct 9 15:03:03 UTC 2017 - alarrosa@suse.com
- Fixed %check section and add python-virtualenv to the build requirements.
- Add a longer description to the package.
-------------------------------------------------------------------
Wed Aug 23 13:40:51 UTC 2017 - t.gruner@katodev.de
- Initial release 1.0.5

69
python-sybil.spec Normal file
View File

@ -0,0 +1,69 @@
#
# spec file for package python-sybil
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?sle15_python_module_pythons}
Name: python-sybil
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
#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}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
%if 0%{?sle_version} && 0%{?sle_version} <= 150400
BuildRequires: %{python_module dataclasses}
%endif
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Recommends: python-pytest
BuildArch: noarch
%python_subpackages
%description
python-sybil provides a way to test examples in one's documentation by parsing
them from the documentation source and evaluating the parsed examples as part
of the normal test run. Integration is provided for the main Python test runners.
%prep
%setup -q -n sybil-%{version}
sed -i '/pytest-cov/ d' setup.py
%autopatch -p1
%build
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%pytest
%files %{python_files}
%doc README.rst docs/changes.rst
%license docs/license.rst
%{python_sitelib}/sybil
%{python_sitelib}/sybil-%{version}*-info
%changelog

BIN
sybil-3.0.1.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.