forked from pool/python-sphinxcontrib-trio
This commit is contained in:
@@ -1,67 +0,0 @@
|
||||
--- a/sphinxcontrib_trio/__init__.py
|
||||
+++ b/sphinxcontrib_trio/__init__.py
|
||||
@@ -92,13 +92,6 @@ CM_CODES = set()
|
||||
from contextlib import contextmanager
|
||||
CM_CODES.add(contextmanager(None).__code__)
|
||||
|
||||
-try:
|
||||
- from contextlib2 import contextmanager as contextmanager2
|
||||
-except ImportError:
|
||||
- pass
|
||||
-else:
|
||||
- CM_CODES.add(contextmanager2(None).__code__)
|
||||
-
|
||||
extended_function_option_spec = {
|
||||
"async": directives.flag,
|
||||
"decorator": directives.flag,
|
||||
--- a/test-requirements.txt
|
||||
+++ b/test-requirements.txt
|
||||
@@ -1,6 +1,5 @@
|
||||
pytest
|
||||
pytest-cov
|
||||
async_generator
|
||||
-contextlib2
|
||||
lxml
|
||||
cssselect
|
||||
--- a/tests/test_sphinxcontrib_trio.py
|
||||
+++ b/tests/test_sphinxcontrib_trio.py
|
||||
@@ -14,13 +14,6 @@ from pathlib import Path
|
||||
import lxml.html
|
||||
|
||||
try:
|
||||
- from contextlib2 import contextmanager as contextmanager2
|
||||
-except ImportError:
|
||||
- have_contextmanager2 = False
|
||||
-else:
|
||||
- have_contextmanager2 = True
|
||||
-
|
||||
-try:
|
||||
from async_generator import async_generator, yield_
|
||||
except ImportError:
|
||||
have_async_generator = False
|
||||
@@ -108,12 +101,6 @@ def test_sniff_options():
|
||||
|
||||
check(cm, "with")
|
||||
|
||||
- if have_contextmanager2:
|
||||
- @contextmanager2
|
||||
- def cm2(): # pragma: no cover
|
||||
- yield
|
||||
- check(cm2, "with")
|
||||
-
|
||||
def manual_cm(): # pragma: no cover
|
||||
pass
|
||||
manual_cm.__returns_contextmanager__ = True
|
||||
--- a/docs/source/index.rst
|
||||
+++ b/docs/source/index.rst
|
||||
@@ -111,9 +111,7 @@ Autodetection heuristics
|
||||
* ``:with:`` is autodetected for:
|
||||
|
||||
* functions decorated with `contextlib.contextmanager
|
||||
- <https://docs.python.org/3/library/contextlib.html#contextlib.contextmanager>`__
|
||||
- or `contextlib2.contextmanager
|
||||
- <https://contextlib2.readthedocs.io/en/stable/#contextlib2.contextmanager>`__,
|
||||
+ <https://docs.python.org/3/library/contextlib.html#contextlib.contextmanager>`__,
|
||||
|
||||
* functions that have an attribute ``__returns_contextmanager__``
|
||||
with a truthy value.
|
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-sphinxcontrib-trio
|
||||
#
|
||||
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -27,7 +27,6 @@ Group: Development/Languages/Python
|
||||
URL: https://github.com/python-trio/sphinxcontrib-trio
|
||||
Source: https://files.pythonhosted.org/packages/source/s/sphinxcontrib-trio/sphinxcontrib-trio-%{version}.tar.gz
|
||||
# https://github.com/python-trio/sphinxcontrib-trio/issues/18
|
||||
Patch0: avoid_contextlib2.patch
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
|
Reference in New Issue
Block a user