Commit Graph

189 Commits

Author SHA1 Message Date
Takeshi KOMIYA
8a391d1781 Merge branch '1.8' 2019-02-17 22:37:23 +09:00
Takeshi KOMIYA
08cd23a0bb Fix #6047: autodoc: `autofunction` emits a warning for method objects 2019-02-17 18:23:14 +09:00
Takeshi KOMIYA
686486498c Closes #1148: autodoc: Add autodecorator directive for decorators 2019-02-15 02:14:38 +09:00
Takeshi KOMIYA
ad517af81c
Merge branch 'master' into 5459_autodoc_default_options_accepts_True 2019-02-11 12:34:59 +09:00
Takeshi KOMIYA
b0148c6921 Closes #5459: autodoc: autodoc_default_options accepts True as a value 2019-02-11 02:03:09 +09:00
Takeshi KOMIYA
a6ef8190ce Add testcase for mocked objects in autodoc 2019-02-11 01:46:38 +09:00
Takeshi KOMIYA
76e9f57c2e Merge branch '1.8' 2019-01-02 16:16:25 +09:00
Takeshi KOMIYA
1b1ebd2c75 A happy new year! 2019-01-02 16:00:30 +09:00
Jon Dufresne
bade33c7e4 Remove unnecessary encoding cookie from Python source files
In Python 3, the default encoding of source files is utf-8. The encoding
cookie is now unnecessary and redundant so remove it. For more details,
see the docs:

https://docs.python.org/3/howto/unicode.html#the-string-type

> The default encoding for Python source code is UTF-8, so you can
> simply include a Unicode character in a string literal ...

Includes a fix for the flake8 header checks to stop expecting an
encoding cookie.
2018-12-16 12:22:12 -08:00
Takeshi KOMIYA
c6bd84a614 refactor: Remove u-prefix from strings 2018-12-16 21:28:51 +09:00
Takeshi KOMIYA
66fad4e22d Remove a hack for py2 from testcode 2018-12-15 22:01:22 +09:00
Takeshi KOMIYA
4761e70c37 Merge branch '1.8' 2018-11-22 22:14:32 +09:00
Jon Dufresne
555960d668 Deprecate and drop internal use of force_decode()
In the Python 3 only code base, this function is no longer necessary.
The type of values is well understood and deliberate. Code should avoid
arbitrary mixing of bytes & str.

By removing force_decode() calls from docstring values, can deprecate
the now unused 'encoding' arguments to various autodoc methods.
2018-11-13 07:16:39 -08:00
Takeshi KOMIYA
0ccc64d9ea test: Filter warnings on testing 2018-11-12 00:37:51 +09:00
Takeshi KOMIYA
9c4e5b244a test: Replace call_autodoc() by do_autodoc() 2018-11-11 21:22:11 +09:00
Takeshi KOMIYA
ea03286647 test: Move autodoc_missing_imports to test-ext-autodoc 2018-10-17 11:36:11 +09:00
Eric N. Vander Weele
d6b9db9581 tests: Ensure 'member-only' autodoc_default_options is respected
When specifying the 'member-only' option to `autodoc_default_options`,
ensure it is respected.
2018-10-14 20:18:59 -04:00
Takeshi KOMIYA
dc44b0d2a9 Merge branch 'master' into HEAD 2018-09-22 22:54:15 +09:00
Takeshi KOMIYA
3a2418a827 refactoring: Drop PY2 and PY3 flags 2018-09-22 21:27:59 +09:00
Takeshi KOMIYA
48c634e623 test: Merge py35/test_autodoc_py35.py to test_autodoc.py 2018-09-22 16:41:44 +09:00
Takeshi KOMIYA
b18fe13f55 Drop branches for sys.version_info < (3, 4) 2018-09-22 16:31:07 +09:00
Takeshi KOMIYA
522105b79b Merge branch '1.8' 2018-09-20 20:01:14 +09:00
Takeshi KOMIYA
c7f3933612
Merge branch '1.8' into 5431_warnings_for_callable 2018-09-18 23:34:33 +09:00
Takeshi KOMIYA
5c3a0e4e40 Fix #5431: autodoc: `autofunction` emits a warning for callable objects 2018-09-18 13:02:01 +09:00
Takeshi KOMIYA
9e8434f902 Fix #5436: Autodoc does not work with enum subclasses with properties/methods 2018-09-18 13:01:10 +09:00
Takeshi KOMIYA
6d55e98da1 test: Move EnumCls to target.enum package 2018-09-18 13:01:10 +09:00
Jon Dufresne
490e4aed41 Remove unnecessary object from class definitions
In Python 3, all classes are new-style classes. The object in the
definition is redundant and unnecessary.
2018-09-11 07:07:01 -07:00
Takeshi KOMIYA
02afc357ef Merge branch '1.8' 2018-09-09 19:26:48 +09:00
Takeshi KOMIYA
35e1764025 Fix #5290: autodoc: failed to analyze source code in egg package 2018-09-06 22:22:01 +09:00
Takeshi KOMIYA
06aa1a7864 Fix #2401: autodoc: `:members: causes :special-members:` not to be shown 2018-09-03 01:26:31 +09:00
Takeshi KOMIYA
a7cab001d9 Drop APIs deprecated in 2.0 2018-09-03 00:31:33 +09:00
Takeshi KOMIYA
e3f383ad7c
Merge pull request #5315 from tk0miya/add_autodoc_default_options
Add autodoc_default_options
2018-08-20 00:26:08 +09:00
Takeshi KOMIYA
7f52ef7512 Merge branch '1.7' 2018-08-19 02:19:06 +09:00
Takeshi KOMIYA
3d9e2cf831 Add autodoc_default_options 2018-08-18 18:22:16 +09:00
Lewis Haley
f196a92055 autodoc: add 'exclude-members' to user global options
As the previous commit explains, it is now possible to specify arguments
to the global options in config files. This means that we can now include
the `exclude-members` option in this global configuration.

Previously, there was no point including this option because it makes no
sense without arguments. Including this option means users have the
flexibility of explicitly including which special methods they want using
(e.g.):

  :special-members: __init__, __iter__

or explicitly excluding which special-members (or other members) they want
using (e.g.):

  :exclude-members: __weakref__, __hash__
2018-08-17 16:02:11 +01:00
Lewis Haley
6e1e35c98a autodoc: allow specifying values to global arguments
Previously, users could specify a *list* of flags in their config files.
The flags were directive names that would otherwise be present in the
.rst files. However, as a list, it was not possible to specify values
to those flags, which *is* possible in .rst files.

For example, in .rst you could say

  :special-members: __init__, __iter__

And this would cause autodoc to generate documents for these methods that
it would otherwise ignore.

This commit changes the config option to instead accept a dictionary.
This is a dictionary whose keys can contain the same flag-names as before,
but whose values can contain the arguments as seen in .rst files.

The old list is still supported, for backwards compatibility, but the data
is transformed into a dictionary when the user's config is loaded.
2018-08-17 15:51:00 +01:00
Lewis Haley
87029392fd test_autodoc: fix mutable function default argument in do_autodoc
Setting mutable types as default arguments is bad practice because the
value is only initialised once. This means that defaults arguments of
lists and dictionaries which are modified during code execution *stay*
modified between calls.

In this case, the `options` dictionary accumulated options as more and
more test cases were executed. Without this change, the tests added in
the next commit do not pass.

See: https://stackoverflow.com/questions/1132941/least-astonishment-and-the-mutable-default-argument
2018-08-17 15:33:58 +01:00
Takeshi KOMIYA
c4fa1aed34 Fix #5211: autodoc: No docs generated for functools.partial functions 2018-08-17 01:24:19 +09:00
Takeshi KOMIYA
7e546c0e0b refactor: Remove duplicated testcase 2018-08-05 08:18:21 +09:00
Takeshi KOMIYA
de73ee5902 refactor: test_autodoc 2018-08-05 08:18:21 +09:00
Takeshi KOMIYA
7ee868fb18 Add testcases for autodoc_default_flags 2018-07-28 22:37:32 +09:00
Takeshi KOMIYA
f969edfaa8 Fix flake8 violations on tests 2018-07-28 20:19:30 +09:00
Takeshi KOMIYA
c657f1c1c2 test: Validate whole of generated docs by autodoc 2018-07-28 18:46:13 +09:00
Takeshi KOMIYA
7dad01d18f test: Add do_autodoc() helper 2018-07-28 18:30:27 +09:00
Takeshi KOMIYA
8c29801f27 Close #2820: autoclass directive supports nested class 2018-07-22 01:06:17 +09:00
Takeshi KOMIYA
b1acc54cf9 Fix #5139: autodoc: Enum argument missing if it shares value with another 2018-07-15 18:53:53 +09:00
Takeshi KOMIYA
aefb3bbaaa Fix #4543: testcase for partialmethod is failed with py3.6.5 2018-04-08 21:54:00 +09:00
Takeshi KOMIYA
9e0089b252 Fix #4769: autodoc loses the first staticmethod parameter 2018-03-24 00:53:07 +09:00
Takeshi KOMIYA
049df5d5e1 test: Suppress DeprecationWarning 2018-03-20 20:27:05 +09:00
Takeshi KOMIYA
f2a23b761e Fix #4543: test for autodoc fails with python 3.5.3 2018-03-13 23:23:15 +09:00