Commit Graph

2286 Commits

Author SHA1 Message Date
Takeshi KOMIYA
750e037ce6 Merge pull request #5388 from lamby/reproducbible-frozenset
Ensure frozen object descriptions are reproducible
2018-09-06 01:08:32 +09:00
Chris Lamb
17d32d625b Ensure frozenset object descriptions are reproducible
Whilst working on the Reproducible Builds effort [0], we noticed
that sphinx could generate output that is not reproducible.

In particular, the rendering of `frozenset` objects in default
arguments and elsewhere is currently non-determinstic.

For example:

    frozenset(['a', 'b', 'c'])

Might be rendered as any of:

    frozenset({'a', 'b', 'c'})
    frozenset({'a', 'c', 'b'})
    frozenset({'b', 'a', 'c'})
    frozenset({'b', 'c', 'a'})
    frozenset({'c', 'a', 'b'})
    frozenset({'c', 'b', 'a'})

Patch attached that sorts the contents of frozensets whilst rendering.
This is parallel to the `dict` and `set` type logic

  [0] https://reproducible-builds.org/
2018-09-05 15:58:54 +01:00
Takeshi KOMIYA
342de4f0fd Merge branch '1.8' 2018-09-05 23:10:20 +09:00
Takeshi KOMIYA
3d35723f6d Merge branch '1.7' into 1.8 2018-09-05 23:09:48 +09:00
Takeshi KOMIYA
a7cab001d9 Drop APIs deprecated in 2.0 2018-09-03 00:31:33 +09:00
Takeshi KOMIYA
219f024595 Add testcase for pygments 2018-09-02 16:17:02 +09:00
Dmitry Shachnev
561199e5e8 Make generated texinfo files reproducible by sorting the anchors 2018-08-30 13:03:49 +03:00
Takeshi KOMIYA
db1582833d Merge pull request #5346 from tk0miya/add_NodeMatcher
[Proposal] Add a helper class for Node.traverse()
2018-08-29 23:49:59 +09:00
Takeshi KOMIYA
63dc6afb62 Merge branch '1.8' into 5348_support_remote_download_file 2018-08-27 01:21:19 +09:00
Takeshi KOMIYA
c5c023cb68 Merge pull request #5352 from tk0miya/improve_pytest_header
Improve pytest header
2018-08-27 01:20:42 +09:00
Takeshi KOMIYA
aee5fd04d4 Fix #5348: download reference to remote file is not displayed 2018-08-26 22:25:35 +09:00
Jakob Lykke Andersen
2a544b4ec3 C++, conditionally disable test on sys.maxunicode 2018-08-26 13:17:53 +02:00
Takeshi KOMIYA
9f7afa161e Add NodeMatcher; a helper class for Node.traverse() 2018-08-26 18:14:07 +09:00
Takeshi KOMIYA
48427ae57a Improve pytest header 2018-08-26 11:28:06 +09:00
Takeshi KOMIYA
8eb44a40ab Merge branch '1.8' into 5321_invalid_lineno_for_i18n_warnings 2018-08-25 11:45:16 +09:00
Takeshi KOMIYA
ea3d0b3768 Merge branch '1.7' into 1.8 2018-08-25 03:07:35 +09:00
Takeshi KOMIYA
520797a5e8 test: Upgrade python on Circle CI to 3.5 2018-08-25 02:53:17 +09:00
Takeshi KOMIYA
328ff6eeae Fix i18n: warnings for translation catalogs have wrong line numbers 2018-08-22 21:01:50 +09:00
Takeshi KOMIYA
59a766d7d6 Fix #5322: autodoc: `Any` typehint causes formatting error 2018-08-22 19:57:27 +09:00
Takeshi KOMIYA
db8865a46d Merge pull request #5063 from jakobandersen/search_use_dispname
Search: make a difference between fullname and dispname
2018-08-20 22:15:03 +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
Jakob Lykke Andersen
9cddc344db Merge pull request #5311 from jakobandersen/cpp_new_delete_expr
C++, add parsing of new and delete expressions
2018-08-17 14:33:06 +02:00
Jakob Lykke Andersen
73ae1ac834 C++, add parsing of basic new expressions. 2018-08-17 13:49:44 +02:00
Takeshi KOMIYA
c4fa1aed34 Fix #5211: autodoc: No docs generated for functools.partial functions 2018-08-17 01:24:19 +09:00
Takeshi KOMIYA
11331c5923 Merge branch '1.7' 2018-08-17 00:56:35 +09:00
Takeshi KOMIYA
28131df93e Merge pull request #5307 from akaihola/5273_doctest_conditional_skip
Feature: skip doctests conditionally
2018-08-17 00:33:29 +09:00
Antti Kaihola
098f37fddf Ref #5273: doctest: add test for skipif calling global setup/cleanup
Ensure that `doctest_global_setup` and `doctest_global_cleanup` are executed
before and after evaluating each `:skipif:` option.
2018-08-16 17:56:29 +03:00
Antti Kaihola
5ffc924940 Ref #5273: doctest: added a missing final newline 2018-08-16 14:09:06 +03:00
Antti Kaihola
9185c2c356 Ref #5273: doctest: add tests for the :skipif: option 2018-08-16 13:22:59 +03:00
Takeshi KOMIYA
91650d89c9 Fix #5291: autodoc crashed by ForwardRef types 2018-08-15 21:30:49 +09:00
Jakob Lykke Andersen
6433e08069 C++, add parsing of delete expressions. 2018-08-15 10:08:31 +02:00
Takeshi KOMIYA
955c3d388b test Signature annotations in py34 too 2018-08-15 01:22:52 +09:00
Takeshi KOMIYA
e26dc81272 Fix autodoc: Optional types are wrongly rendered 2018-08-15 01:22:52 +09:00
Jakob Lykke Andersen
349890266c C++, parse attributes on declerators as well.
Fixes sphinx-doc/sphinx#5187
2018-08-11 16:39:27 +02:00
Jakob Lykke Andersen
ef5448e8bc Merge pull request #5284 from jakobandersen/cpp_char_lit_5147
C++, add support for (most) character literals.
2018-08-10 22:59:22 +02:00
Jakob Lykke Andersen
44127fd13b C++, add support for (most) character literals.
Fixes sphinx-doc/sphinx#5147
2018-08-10 22:13:18 +02:00
Terence D. Honles
da45604485 handle NoneType as None 2018-08-10 11:58:08 -07:00
Takeshi KOMIYA
b09c54e669 Merge branch 'master' into graphviz_width_of_svg 2018-08-07 23:16:37 +09:00
Takeshi KOMIYA
b01256dbaf Merge pull request #5253 from tk0miya/enable_epub_by_default
Enable epub by default
2018-08-07 01:05:07 +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
f591cba27f Fix #5002: graphviz: SVGs do not adapt to the column width 2018-08-05 08:16:46 +09:00
Takeshi KOMIYA
dc4f8d4836 conf.py: Drop epub_author, epub_publisher and epub_copyright
The default values of them are same as conf.py's. So it is not
needed to override the setting.
2018-08-05 08:16:00 +09:00
Takeshi KOMIYA
206395121d Merge pull request #5250 from tk0miya/refactor_math4
Add :rst:role:`math:numref` role to refer equations (Same as :rst:role:`eq`)
2018-08-04 21:03:49 +09:00
Takeshi KOMIYA
ec7ee91dd3 Merge pull request #5230 from tk0miya/726_mathjax_config
#726, #969: Add mathjax_config
2018-08-04 19:21:01 +09:00