mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge tag 'v3.2.1' into 3.x
This commit is contained in:
commit
d3af1cde2b
17
CHANGES
17
CHANGES
@ -23,17 +23,8 @@ Bugs fixed
|
|||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
|
||||||
Release 3.2.1 (in development)
|
Release 3.2.1 (released Aug 14, 2020)
|
||||||
==============================
|
=====================================
|
||||||
|
|
||||||
Dependencies
|
|
||||||
------------
|
|
||||||
|
|
||||||
Incompatible changes
|
|
||||||
--------------------
|
|
||||||
|
|
||||||
Deprecated
|
|
||||||
----------
|
|
||||||
|
|
||||||
Features added
|
Features added
|
||||||
--------------
|
--------------
|
||||||
@ -52,11 +43,9 @@ Bugs fixed
|
|||||||
class
|
class
|
||||||
* #8091: autodoc: AttributeError is raised on documenting an attribute on Python
|
* #8091: autodoc: AttributeError is raised on documenting an attribute on Python
|
||||||
3.5.2
|
3.5.2
|
||||||
|
* #8099: autodoc: NameError is raised when target code uses ``TYPE_CHECKING``
|
||||||
* C++, fix parsing of template template paramters, broken by the fix of #7944
|
* C++, fix parsing of template template paramters, broken by the fix of #7944
|
||||||
|
|
||||||
Testing
|
|
||||||
--------
|
|
||||||
|
|
||||||
Release 3.2.0 (released Aug 08, 2020)
|
Release 3.2.0 (released Aug 08, 2020)
|
||||||
=====================================
|
=====================================
|
||||||
|
|
||||||
|
@ -32,8 +32,8 @@ if 'PYTHONWARNINGS' not in os.environ:
|
|||||||
warnings.filterwarnings('ignore', "'U' mode is deprecated",
|
warnings.filterwarnings('ignore', "'U' mode is deprecated",
|
||||||
DeprecationWarning, module='docutils.io')
|
DeprecationWarning, module='docutils.io')
|
||||||
|
|
||||||
__version__ = '3.3.0+'
|
__version__ = '3.2.1'
|
||||||
__released__ = '3.3.0' # used when Sphinx builds its own docs
|
__released__ = '3.2.1' # used when Sphinx builds its own docs
|
||||||
|
|
||||||
#: Version info for better programmatic use.
|
#: Version info for better programmatic use.
|
||||||
#:
|
#:
|
||||||
@ -43,7 +43,7 @@ __released__ = '3.3.0' # used when Sphinx builds its own docs
|
|||||||
#:
|
#:
|
||||||
#: .. versionadded:: 1.2
|
#: .. versionadded:: 1.2
|
||||||
#: Before version 1.2, check the string ``sphinx.__version__``.
|
#: Before version 1.2, check the string ``sphinx.__version__``.
|
||||||
version_info = (3, 3, 0, 'beta', 0)
|
version_info = (3, 2, 1, 'final', 0)
|
||||||
|
|
||||||
package_dir = path.abspath(path.dirname(__file__))
|
package_dir = path.abspath(path.dirname(__file__))
|
||||||
|
|
||||||
|
@ -1608,6 +1608,9 @@ class DataDocumenter(ModuleLevelDocumenter):
|
|||||||
# obtain annotation for this data
|
# obtain annotation for this data
|
||||||
try:
|
try:
|
||||||
annotations = get_type_hints(self.parent)
|
annotations = get_type_hints(self.parent)
|
||||||
|
except NameError:
|
||||||
|
# Failed to evaluate ForwardRef (maybe TYPE_CHECKING)
|
||||||
|
annotations = safe_getattr(self.parent, '__annotations__', {})
|
||||||
except TypeError:
|
except TypeError:
|
||||||
annotations = {}
|
annotations = {}
|
||||||
except KeyError:
|
except KeyError:
|
||||||
@ -1984,6 +1987,9 @@ class AttributeDocumenter(DocstringStripSignatureMixin, ClassLevelDocumenter):
|
|||||||
# obtain type annotation for this attribute
|
# obtain type annotation for this attribute
|
||||||
try:
|
try:
|
||||||
annotations = get_type_hints(self.parent)
|
annotations = get_type_hints(self.parent)
|
||||||
|
except NameError:
|
||||||
|
# Failed to evaluate ForwardRef (maybe TYPE_CHECKING)
|
||||||
|
annotations = safe_getattr(self.parent, '__annotations__', {})
|
||||||
except TypeError:
|
except TypeError:
|
||||||
annotations = {}
|
annotations = {}
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
8
tests/roots/test-ext-autodoc/target/TYPE_CHECKING.py
Normal file
8
tests/roots/test-ext-autodoc/target/TYPE_CHECKING.py
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from io import StringIO
|
||||||
|
|
||||||
|
|
||||||
|
class Foo:
|
||||||
|
attr1: "StringIO"
|
@ -1740,6 +1740,28 @@ def test_autodoc_Annotated(app):
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skipif(sys.version_info < (3, 6), reason='py36+ is required.')
|
||||||
|
@pytest.mark.sphinx('html', testroot='ext-autodoc')
|
||||||
|
def test_autodoc_TYPE_CHECKING(app):
|
||||||
|
options = {"members": None,
|
||||||
|
"undoc-members": None}
|
||||||
|
actual = do_autodoc(app, 'module', 'target.TYPE_CHECKING', options)
|
||||||
|
assert list(actual) == [
|
||||||
|
'',
|
||||||
|
'.. py:module:: target.TYPE_CHECKING',
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
'.. py:class:: Foo()',
|
||||||
|
' :module: target.TYPE_CHECKING',
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
' .. py:attribute:: Foo.attr1',
|
||||||
|
' :module: target.TYPE_CHECKING',
|
||||||
|
' :type: StringIO',
|
||||||
|
'',
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.sphinx('html', testroot='pycode-egg')
|
@pytest.mark.sphinx('html', testroot='pycode-egg')
|
||||||
def test_autodoc_for_egged_code(app):
|
def test_autodoc_for_egged_code(app):
|
||||||
options = {"members": None,
|
options = {"members": None,
|
||||||
|
Loading…
Reference in New Issue
Block a user