summaryrefslogtreecommitdiff
path: root/sphinx/ext/autodoc.py
Commit message (Collapse)AuthorAgeFilesLines
* Separate autodoc.pyTakeshi KOMIYA2017-06-171-1894/+0
|
* Replace getargspec by Signature class in autodoc moduleTakeshi KOMIYA2017-06-171-15/+7
|
* Fix #3779: 'ImportError' in sphinx.ext.autodoc due to broken 'sys.meta_path'Tatiana Tereshchenko2017-05-241-3/+2
|
* Update type annotations for new mypyTakeshi KOMIYA2017-05-071-1/+1
|
* Merge branch 'stable' into 1.6-releaseTakeshi KOMIYA2017-04-251-4/+13
|\
| * Fix #3618: autodoc crashes with tupled argumentsTakeshi KOMIYA2017-04-111-4/+13
| |
* | Use inspect instead of checking typesJeroen Demeyer2017-04-191-5/+8
| |
* | ext: enhance autodoc_mock_importsRobin Jarry2017-04-181-35/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The autodoc_mock_imports option requires to explicitly declare *every* external module and sub-module that are imported by the documented code. This is not practical as the list can become very large and must be maintained as the code changes. Also, the mocking is minimal which causes errors when compiling the docs. For example, if you declare: autodoc_mock_imports = ['django.template'] And try to document a module: .. automodule:: my.lib.util Which contains this code: from django.template import Library register = Library() The following error occurs: File ".../my/lib/util.py" line 2 register = Library() TypeError: 'object' object is not callable Other similar errors can occur such as "TypeError: 'object' object has no len". To address these limitations, only require to declare the top-level module that should be mocked: autodoc_mock_imports = ['django'] Will mock "django" but also any sub-module: "django.template", "django.contrib", etc. Also, make the mocked modules yield more complete dummy objects to avoid these TypeError problems. Behind the scenes, it uses the python import hooks mechanism specified in PEP 302. Signed-off-by: Robin Jarry <robin@jarry.cc>
* | Merge branch 'stable'Takeshi KOMIYA2017-03-261-1/+1
|\ \ | |/
| * Year++Takeshi KOMIYA2017-03-261-1/+1
| |
* | Upgrade to mypy-0.5Takeshi KOMIYA2017-03-031-4/+4
| |
* | Add mypy annotationsTakeshi KOMIYA2017-02-101-0/+3
| |
* | Fix mypy violationsTakeshi KOMIYA2017-02-081-1/+1
| |
* | Remove unused "type: ignore"Takeshi KOMIYA2017-02-061-2/+2
| |
* | Drop debug2() (refs: #3304)Takeshi KOMIYA2017-01-071-1/+1
| |
* | Use sphinx.util.logging instead app.info(), verbose(), debug() and debug2()Takeshi KOMIYA2017-01-021-13/+15
| |
* | Merge branch 'stable'jfbu2016-12-171-1/+10
|\ \ | |/
| * Fix #3255: In Py3.4 environment, autodoc doesn't support documentation for ↵shimizukawa2016-12-171-1/+10
| | | | | | | | attributes of Enum class correctly.
* | Merge branch 'stable'Takeshi KOMIYA2016-12-171-1/+4
|\ \ | |/
| * Reduce deprecation warnings (refs: #3192)Takeshi KOMIYA2016-12-151-1/+4
| |
* | ``sphinx.util.compat.Directive`` class is now deprecated.Takeshi KOMIYA2016-12-131-1/+1
| |
* | Merge branch '1.5-release' into mastershimizukawa2016-12-051-3/+11
|\ \ | |/
| * Merge branch 'stable' into 1.5-releaseTakeshi KOMIYA2016-12-031-3/+11
| |\
| | * Merge branch 'fix-attr-documenter' into stableshimizukawa2016-11-241-3/+11
| | |\
| | | * Fix documentation of descriptor classes that have a custom metaclassErik M. Bray2015-04-091-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (i.e. a subclass of type). This avoids using string comparisons to do type checks, except in the case of the fix for #1155, since in Python 3 there really seems to be no way to export the instancemethod type, short of using ctypes.
* | | | Add type-check annotations to sphinx.extTakeshi KOMIYA2016-11-161-45/+147
|/ / /
* | | Merge branch 'stable' into 1.5-releaseTakeshi KOMIYA2016-11-161-0/+1
|\ \ \ | |/ /
| * | insert blank line(s) to adapt latest flake8/pycodestyleshimizukawa2016-11-161-0/+1
| | |
* | | Merge branch 'stable' into 1.5-releaseTakeshi KOMIYA2016-11-131-1/+3
|\ \ \ | |/ /
| * | Fix #3135: ``sphinx.ext.autodoc`` crashes with plain CallableTakeshi KOMIYA2016-11-131-1/+3
| | |
| * | Fix py3.6b3 crashes with empty Callable annotationTakeshi KOMIYA2016-11-061-1/+1
| | |
| * | Fix #3111: autodoc crashes with python3.6b3Takeshi KOMIYA2016-11-021-1/+8
| | | | | | | | | | | | Since 3.6b3, structure of typing.Callable has been changed.
* | | Fix py3.6b3 crashes with empty Callable annotationTakeshi KOMIYA2016-11-031-1/+1
| | |
* | | Add comment about skipping plain CallableAlex Grönholm2016-11-021-0/+1
| | |
* | | Fix annotations formatting for plain typing.CallableAlex Grönholm2016-11-021-1/+1
| | | | | | | | | | | | The typing.Callable class may be used without generic arguments, in which case it is equivalent to collections.abc.Callable.
* | | Merge pull request #3071 from mleinart/autodoc/pass_through_decoratorsTakeshi KOMIYA2016-11-021-0/+3
|\ \ \ | | | | | | | | Autodoc: Allow mocked module decorators to pass-through functions unchanged
| * | | Autodoc: Allow mocked module decorators to pass-throughMichael Leinartas2016-10-191-0/+3
| | | |
* | | | Fix #3111: autodoc crashes with python3.6b3Takeshi KOMIYA2016-11-021-1/+8
| | | | | | | | | | | | | | | | Since 3.6b3, structure of typing.Callable has been changed.
* | | | Closes #3060: autodoc supports documentation for attributes of Enum class. ↵shimizukawa2016-10-281-1/+3
|/ / / | | | | | | | | | Now autodoc render just the value of Enum attributes instead of Enum attribute representation.
* | | Merge pull request #2432 from agronholm/kwonlyargsTakayuki SHIMIZUKAWA2016-10-191-1/+3
|\ \ \ | | | | | | | | #2432 Fix unwanted * between varargs and keyword only args
| * | | Fix unwanted * between varargs and keyword only argsAlex Grönholm2016-04-091-1/+3
| | | | | | | | | | | | | | | | The * parameter must only be present when a holder for positional variable arguments is not present.
* | | | Merge branch 'stable'Takeshi KOMIYA2016-09-291-3/+3
|\ \ \ \ | | |/ / | |/| |
| * | | Fix autodoc misdetect typing with py3.6Takeshi KOMIYA2016-09-291-3/+3
| | | |
* | | | Update messageTakeshi KOMIYA2016-09-291-1/+1
| | | |
* | | | Fix `sphinx.ext.autodoc` crashes if target code imports * from mock modules ↵Takeshi KOMIYA2016-08-091-8/+15
|/ / / | | | | | | | | | by `autodoc_mock_imports`
* | | ext.autodoc: fix formatting instance annotationsJoost van Zwieten2016-08-071-3/+4
| | | | | | | | | | | | | | | | | | | | | Currently `format_annotation` fails on instances, because instances don't have `__module__` and `__qualname__` attributes. Defer building the `qualified_name` of an annotation until we have established that the annotation is a type.
* | | Fix #2470: ``typing`` backport package causes autodoc errors with python 2.7Takeshi KOMIYA2016-05-211-1/+4
| | |
* | | Adapt to typing private API change in Python 3.5.2Dmitry Shachnev2016-05-081-3/+11
|/ / | | | | | | Fixes #2519.
* | Merge wiht 'stable'shimizukawa2016-02-141-1/+3
|\ \
| * | Fix UnicodeDecodeError if autodoc crashed on importing codes including ↵Takeshi KOMIYA2016-02-111-1/+3
| | | | | | | | | | | | multibyte characters in py2