Commit Graph

230 Commits

Author SHA1 Message Date
Takeshi KOMIYA
e2e907b3ee Fix broken test_autodoc 2017-12-22 00:53:53 +09:00
Takeshi KOMIYA
ffa9d48d0e
Merge branch 'master' into ignore__all__ 2017-12-22 00:28:26 +09:00
Takeshi KOMIYA
ec240614d9 test_autodoc: Separate testdata (python objects) and testcases 2017-12-21 12:12:13 +09:00
Kevin Keating
e932ff5ad2 Closes #947: autodoc now supports ignore-module-all to ignore a module's __all__ 2017-12-20 15:07:33 -05:00
Takeshi KOMIYA
7a194f5296 autodoc: Use logging module to emit warnings 2017-12-20 01:40:45 +09:00
Takeshi KOMIYA
464f94c238 deprecate formatargspec() and format_annotation() 2017-12-17 15:25:44 +09:00
Takeshi KOMIYA
00169a07e6 Merge branch 'stable' 2017-09-24 22:51:23 +09:00
Antonio Valentino
96ee24d7c1 Basic test for docstring inheritance 2017-08-19 21:52:30 +02:00
Takeshi KOMIYA
13be8e03ba Fix #3969: private instance attributes causes AttributeError 2017-07-31 22:49:04 +09:00
Takeshi KOMIYA
27637d73e1 Replace getargspec by Signature class in autodoc module 2017-06-17 18:16:41 +09:00
shimizukawa
d497d74370 refs #3458: add sphinx.testing that are moved from /tests directory. 2017-05-14 20:47:15 +09:00
Takayuki SHIMIZUKAWA
6cb582fdd3 Merge pull request #3449 from njsmith/getargspec-__wrapped__
On py3, use inspect.signature for more accurate signature calculation
2017-04-19 21:21:19 +09:00
Takeshi KOMIYA
c57e47e042 Year++ 2017-03-26 11:49:34 +09:00
Nathaniel J. Smith
678eff821f Update test to match py3's more accurate signature 2017-02-24 05:40:24 -08:00
Takeshi KOMIYA
cf2061dfad Fix flake8 violations 2017-01-26 01:13:17 +09:00
shimizukawa
561abdd164 pytest optimizatoin:
- remote using deprecated decorators
- remove gen_with_app
- remove yield testing
- remove pytest warnings
- refactoring
2017-01-08 15:14:38 +09:00
shimizukawa
5b7d237db3 pytest migration 2017-01-04 00:59:30 +09:00
Takeshi KOMIYA
61a6ca5b37 Merge branch 'stable' into 1.5-release 2016-12-03 16:25:58 +09:00
shimizukawa
3284e89991 Merge branch 'fix-attr-documenter' into stable 2016-11-24 23:55:02 +09:00
Takeshi KOMIYA
4ca84aba45 Fix #3135: `sphinx.ext.autodoc` crashes with plain Callable 2016-11-13 00:01:41 +09:00
Alex Grönholm
a1f6baaa81 Fix annotations formatting for plain typing.Callable
The typing.Callable class may be used without generic arguments, in which case it is equivalent to collections.abc.Callable.
2016-11-02 21:43:33 +02:00
Takeshi KOMIYA
b32d9a9bc7 Merge pull request #3071 from mleinart/autodoc/pass_through_decorators
Autodoc: Allow mocked module decorators to pass-through functions unchanged
2016-11-02 23:01:16 +09:00
shimizukawa
a5bdf1fdae Closes #3060: autodoc supports documentation for attributes of Enum class. Now autodoc render just the value of Enum attributes instead of Enum attribute representation. 2016-10-28 00:02:09 +09:00
Michael Leinartas
7943da9408 Add tests for mocked modules 2016-10-21 09:53:25 -05:00
shimizukawa
021974ed94 refs #2432 update for latest master 2016-10-19 01:08:07 +09:00
Takayuki SHIMIZUKAWA
340c6fb9f4 Merge pull request #2432 from agronholm/kwonlyargs
#2432 Fix unwanted * between varargs and keyword only args
2016-10-19 00:54:38 +09:00
Joost van Zwieten
099b58f7fe ext.autodoc: fix formatting instance annotations
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.
2016-08-07 16:18:22 +02:00
Takeshi KOMIYA
80921b2ab8 Fix flake8 violation under tests/ 2016-06-12 00:02:11 +09:00
Alex Grönholm
0beabaf4cf Fix unwanted * between varargs and keyword only args
The * parameter must only be present when a holder for positional variable arguments is not present.
2016-04-09 17:35:32 +03:00
Takeshi KOMIYA
dca1669b2f Merge pull request #2300 from akruis/feature_autoclass_content_from__new__
Feature: enhance autoclass:: to use the docstring of __new__ if __init__ method's is missing of empty
2016-02-14 14:45:25 +09:00
Anselm Kruis
0311f33347 Feature: enhance autoclass:: to use the docstring of __new__
The method new is an alternative to __init__, but autoclass does not 
respect __new__. This commit enhances the directive autoclass:: to try
__new__ method's docstring, if __init__ method's docstring is missing or
empty.

The commit also adds tests and updates the documentation.
2016-02-05 19:09:43 +01:00
Georg Brandl
4f72bdb722 Merge branch 'stable' 2016-01-14 22:54:08 +01:00
Georg Brandl
46d7e8558e Obligatory copyright update. 2016-01-14 22:54:04 +01:00
Alberto Berti
782310039b Move py3.5 specific tests to their own file and adjust test environment 2015-11-10 03:40:48 +01:00
Alberto Berti
933ed5a50c Add a test for doc on coroutine functions and general support for async/await py3.5 syntax 2015-11-10 02:38:17 +01:00
Andrey Vlasovskikh
ef0d4e7946 Skip type hinting tests if there is a SyntaxError while importing a module with function annotations 2015-07-31 21:56:13 +03:00
Andrey Vlasovskikh
1224256341 Use 'SkipTest' from 'util' for tests 2015-07-31 21:54:01 +03:00
Andrey Vlasovskikh
dd32b7fdb2 Closes #1968: Show extended type hints for function annotations that use 'typing' module 2015-07-31 21:26:32 +03:00
Erik M. Bray
def08a206f Fix documentation of descriptor classes that have a custom metaclass
(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.
2015-04-09 19:09:24 -04:00
Georg Brandl
a23903d8d5 Merge branch 'stable' 2015-01-03 21:41:14 +01:00
Georg Brandl
567d52f199 all: update copyright 2015-01-03 21:36:32 +01:00
Georg Brandl
4f4d8688d5 Py3 fix. 2014-11-07 15:19:36 +01:00
Georg Brandl
bbd315b82e merge with stable 2014-11-07 15:03:06 +01:00
Georg Brandl
fa09ec000f Fix :confval:autodoc_docstring_signature not working with signatures
in class docstrings.
2014-11-07 15:01:10 +01:00
Takayuki Shimizukawa
da651089e7 fix trailing space and long line 2014-10-09 23:53:33 +09:00
Georg Brandl
d47a7587f9 Complete test suite overhaul.
* rename a few test modules to make the names more consistent

* do not copy/use Sphinx from build/ (unnecessary without 2to3)

* use a temporary dir for *all* test projects, the source tree
  will stay pristine that way  (default is tests/build)

* speed up tests by ~3x by splitting up test projects and avoiding
  rebuilds
2014-09-21 17:17:02 +02:00
Georg Brandl
2c396601bf Move env.temp_data content that might be used to resolve references to a new env.ref_context dictionary. 2014-09-20 19:15:41 +02:00
Takayuki Shimizukawa
da20c3713b merge with stable 2014-07-13 11:43:12 +09:00
Takayuki Shimizukawa
b3aa4aa81b * In autodoc, fix display of parameter defaults containing backslashes. Closes #1502 2014-07-02 00:09:11 +09:00
Takayuki Shimizukawa
0fb938ad38 * add test and code comment for pull request #157 2014-06-14 17:03:57 +09:00
Takayuki Shimizukawa
74fbd611ab merge with stable 2014-06-09 22:45:05 +09:00
Takayuki Shimizukawa
1d742bdcf5 * Fix exception on Python3 if nonexistent method is specified by automethod. Closes #1467 2014-06-09 01:43:34 +09:00
Takayuki Shimizukawa
1e58062692 remove 'six' name except importing line. 2014-04-30 21:30:46 +09:00
Takayuki Shimizukawa
68290a266c introduce the six module and reduce sphinx.util.pycompat implementation. refs #1350. 2014-04-29 11:46:47 +09:00
Georg Brandl
ac92719ac3 Update copyright year. 2014-03-01 08:18:23 +01:00
Georg Brandl
e030031321 Update copyright year. 2014-03-01 08:18:16 +01:00
Ben Darnell
3ed243de54 Fix an exception introduced by b69b59480cba for __init__ with no docstring. 2014-01-20 11:54:51 -05:00
Ben Darnell
b0ca105c36 Fix an exception introduced by b69b59480cba for __init__ with no docstring. 2014-01-20 11:54:51 -05:00
Takayuki Shimizukawa
cc7509966c merge heads 2014-01-15 05:25:56 +00:00
Takayuki Shimizukawa
a8fc938d1b Drop python-2.5 and remove 2.4,2.5 support codes 2013-12-15 14:16:53 +09:00
Takayuki Shimizukawa
1d5c7d1f20 Fix: autodoc class __init__ override not removed from docstring. Closes #1138 2013-12-09 10:55:51 +00:00
Takayuki Shimizukawa
e61f316c74 Fix autodoc with `autoclass_content="both" uses useless object.__init__ docstring when class does not have __init__`. Closes #1337
This caused by a change for #1138.
2014-01-02 12:42:12 +09:00
Georg Brandl
ae8782178e Test suite quickfix. 2013-09-16 09:45:56 +02:00
Georg Brandl
e732807869 Merged in JonnyJD/sphinx/autodoc_novalue (pull request #109)
feature: autodoc: add :annotation: option for autodata and autoattribute
2013-09-16 04:25:53 +02:00
Georg Brandl
56ac8a19ee test suite fixes 2013-04-01 15:11:18 +02:00
Georg Brandl
1af3e3ea71 tests: replace "from util import *" by explicit imports 2013-04-01 11:39:32 +02:00
Georg Brandl
9abf39f912 Fix overlong lines. 2013-03-31 15:44:04 +02:00
Johannes Dewender
649ab8030c autodoc: change :novalue: to :annoation: option
The :novalue: option is now called :annotation: and has an additional feature:
When given with an argument, you can specify what the annotation
of the object will be.
2013-02-27 16:38:55 +01:00
Takayuki Shimizukawa
70f3f889d1 Fix autodoc crash if :members: and :special-members: ware both set (by d7ac5e4). 2013-02-03 22:27:20 +09:00
Takayuki Shimizukawa
e70a43a9c5 Closes #1062: sphinx.ext.autodoc use __init__ method signature for class signature. 2013-02-03 20:27:34 +09:00
Takayuki Shimizukawa
4d4dad3610 test refactoring: use with_setup for all test_autodoc.py's tests 2013-02-03 13:53:10 +09:00
Takayuki Shimizukawa
e47f434c32 add test for pull request #111: Respect add_autodoc_attrgetter() even when inherited-members is set 2013-02-03 12:48:39 +09:00
Johannes Dewender
ffb825d733 fix tests for autodoc novalue option
In the tests for autodoc the Options are of type struct,
while in the code there is a special autodoc.Options class,
which is a dict.

So "novalue" in self.options doesn't work,
but self.options.novalue does work for both.

Additionally the logic for autoattribute was wrong and is fixed now.
2013-01-24 18:17:53 +01:00
Takayuki Shimizukawa
3a5277c14c fix: autodoc documented descriptor class as attribute 2013-01-12 18:12:55 +09:00
Jonathan Waltman
bba6104b84 Issue #1069: Add failing test for signature formatting of "partial" functions without kwargs. 2013-01-09 08:37:53 -06:00
Jonathan Waltman
42c90ee178 Add basic debugging support for autodoc. 2013-01-05 08:28:54 -06:00
Georg Brandl
151856819c Copyright update. 2013-01-01 22:13:15 +01:00
Jonathan Waltman
6f9e541ab5 autodoc: Handle explicit instance attributes in :members: (re #904) 2012-11-08 21:19:47 -06:00
Jonathan Waltman
bf362e9ccb Closes #617: Fix docstring preparation without included signature: only ignore indentation of one line, not two. 2012-09-16 01:08:47 -05:00
Georg Brandl
a63230f12d #431: Doc comments for attributes can now be given on the same line as the assignment. 2011-01-15 15:40:59 +01:00
Georg Brandl
dc0c43da9a #437: autodoc now shows values of class data attributes. 2011-01-08 23:45:58 +01:00
Łukasz Langa
48d64cc4cb Support for autodocumenting partial functions. 2011-01-08 18:06:24 +01:00
Georg Brandl
5c39cfb6e9 merge with 1.0 2011-01-07 19:04:53 +01:00
Georg Brandl
b44e894125 Fix test_autodoc. 2011-01-07 19:03:44 +01:00
Georg Brandl
0d1a8e5720 merge with 1.0 2011-01-06 13:07:07 +01:00
Georg Brandl
8621526045 #568: Fix lookup of class attribute documentation on descriptors so that comment documentation now works.
Needed to port assignment of ``self.parent`` from trunk.
2011-01-06 13:03:17 +01:00
Georg Brandl
17efae5622 merge with 1.0 2011-01-04 11:29:09 +01:00
Georg Brandl
0e1db6ad90 New year update. 2011-01-04 10:00:51 +01:00
Georg Brandl
8fd5bd1e19 Fix docstring preparation with included signature: ignore indentation of two lines when looking for the signature. 2011-01-04 00:04:04 +01:00
Georg Brandl
f6cb763ff8 #564: Add :confval:autodoc_docstring_signature which retrieves the signature from the first line of the docstring, if it is found there. 2011-01-03 22:51:33 +01:00
Georg Brandl
594c1a90f4 #520: Provide `special-members` option for autodoc directives. 2011-01-03 21:56:41 +01:00
Georg Brandl
92cb77a131 #176: Provide `private-members` option for autodoc directives. 2011-01-03 21:48:37 +01:00
Georg Brandl
7c7d3f4010 Added `exclude argument to :func:.autodoc.between`. From http://bitbucket.org/mfperzel/sphinx-additions. 2010-06-12 18:16:18 +02:00
Georg Brandl
a31e7e2f5d #187: Added support for source ordering of members in autodoc, with `autodoc_member_order = 'bysource'`. 2010-02-28 11:39:13 +01:00
Georg Brandl
036a399011 merge with trunk 2010-02-27 23:14:19 +01:00
Georg Brandl
cee7e4ba3b merge with 0.6 2010-02-21 23:20:26 +01:00
Georg Brandl
686824997d In autodoc, allow customizing the signature of an object via autodoc-process-signature where the built-in mechanism fails. 2010-02-21 22:59:53 +01:00
Georg Brandl
c8ccbf9ce8 Fix test suite. 2010-01-18 00:41:34 +01:00
Georg Brandl
07f295df7c merge 2010-01-13 23:35:13 +00:00
Georg Brandl
a52885d078 Fix the test suite. 2010-01-13 23:35:05 +00:00
Georg Brandl
54a31c5a6f Change naming convention in doc_read_data to "domain:key". 2010-01-13 20:45:34 +01:00
Georg Brandl
cbd75346fd merge with trunk 2010-01-07 19:17:45 +01:00
Georg Brandl
09147448d4 #280: Autodoc can now document instance attributes assigned in `__init__` methods. 2010-01-03 13:59:30 +01:00
Georg Brandl
faeec5cbbb merge with trunk 2010-01-02 21:03:56 +01:00
Georg Brandl
f6a56192d1 Happy new year! 2010-01-01 14:09:13 +01:00
Georg Brandl
3594104d4e merge with trunk 2009-10-26 14:05:45 +01:00
Georg Brandl
f04ca65690 Fix "fixed" descriptor handling, and add tests. 2009-10-25 11:26:10 +01:00
Georg Brandl
c8b977c821 test_autodoc: adapt to new generation of directives with domain name. 2009-09-08 12:41:15 +02:00
Georg Brandl
fa7f8812cd More refactoring for language-independent domain support.
* Renamed "desc"ription unit to "object" wherever possible.
* Added standard x-ref types to a StandardDomain which is always consulted.
* Split domains module into a subpackage.
* Removed additional_xref_types in favor of new directive classes in StandardDomain.
* Implemented x-ref inventory version 2, for all object types.
* Added env.doc_read_data which is for temporary data stored while reading.
* Minimally updated extension tutorial.
* Started to implement changes to interactive search.
* Test suite passes again.
2009-09-07 22:52:26 +02:00
Georg Brandl
1878c02078 Restore 2.4 compatibility and fix removing the generated file properly. 2009-03-16 23:46:58 +01:00
Georg Brandl
e517911ac3 Autodoc can now exclude single members from documentation
via the ``exclude-members`` option.
2009-03-15 23:52:48 +01:00
Georg Brandl
b244dbf9b5 Use standard `file:line: warning: message` format for warning messages. 2009-03-05 09:21:35 +01:00
Georg Brandl
a43b651804 Make "make check" happy. 2009-02-19 23:31:34 +01:00
Georg Brandl
4b2864e87c Add a test for a new documenter. 2009-02-18 00:06:24 +01:00
Georg Brandl
b42e9303f4 Update the test_autodoc for the autodoc refactorings and fix a few remaining bugs. 2009-02-17 23:55:05 +01:00
Georg Brandl
aedbdd953d Fix more line length and trailing whitespace. 2009-01-10 22:18:18 +01:00
Georg Brandl
04689accd0 Small API change. 2009-01-04 20:43:15 +01:00
Georg Brandl
27bc4e3189 Add new tests for the attribute feature and fix existing tests. 2009-01-04 20:27:37 +01:00
Georg Brandl
f16f94f2cd Merge in copyright style changes from 0.5. 2009-01-03 12:15:19 +01:00
Georg Brandl
0b28b3e6f6 Switch copyright and license tags to single style. Add contributor
names in AUTHORS instead, and add the license of etree13 to
LICENSE.
2009-01-03 11:57:07 +01:00
Georg Brandl
a2363c0751 Fix test_autodoc after return annotation change. 2008-12-28 19:44:10 +01:00
Georg Brandl
26d7aafaae Explicitly refer to the license in :license: tags. 2008-12-27 12:19:17 +01:00
Georg Brandl
0a1b821c7f Handle class aliases (like `class Foo: factory = dict`) better in autodoc. 2008-12-25 21:50:45 +01:00
Georg Brandl
dafb55a467 Fix documentation of inner classes in autodoc. Messy! 2008-12-23 20:05:56 +01:00
Georg Brandl
037954d850 The `autodoc_skip_member` event now also gets to decide
whether to skip members whose name starts with underscores.
Previously, these members were always automatically skipped.
Therefore, if you handle this event, add something like this
to your event handler to restore the old behavior::

   if name.startswith('_'):
       return True
2008-12-15 12:49:40 +01:00
Georg Brandl
132086798a Fix autoclass_content = "both" bug. 2008-12-07 22:36:23 +01:00
Georg Brandl
e943dca703 A bit more testing for autodoc. 2008-09-12 15:46:19 +00:00
Georg Brandl
7679af3ae4 Fix handling of __all__ for modules and add a test. 2008-09-06 20:11:04 +00:00
Georg Brandl
03b12e5d85 Add tests for between() and cut_lines() and fix them.
Also fix a bug in the application interface.
2008-08-04 20:16:18 +00:00
Georg Brandl
00b30f6f65 Add a test suite for autodoc. 2008-08-04 19:39:05 +00:00