Commit Graph

238 Commits

Author SHA1 Message Date
jfbu
685e3fdb49 Merge branch '2.0' 2019-08-01 17:49:24 +02:00
Takeshi KOMIYA
0c48a28ad7 Fix type annotation for python 3.5.1 2019-07-13 23:46:17 +09:00
Takeshi KOMIYA
c18dcf08f9 Merge branch '2.0' 2019-06-30 01:08:48 +09:00
Takeshi KOMIYA
ee6e44a04f Migrate to py3 style type annotation: sphinx.domains.python 2019-06-30 00:56:32 +09:00
Takeshi KOMIYA
9f470cec6c Merge branch '2.0' 2019-06-09 01:27:34 +09:00
Takeshi KOMIYA
84df4c6c2d Fix py domain: duplicated warning does not point the location of source code 2019-06-02 22:50:59 +09:00
Takeshi KOMIYA
b9d7239d90 Merge branch '2.0' 2019-05-29 00:51:25 +09:00
Takeshi KOMIYA
557d8d140e
Merge pull request #6365 from tk0miya/refactor_py_domain
Add :abstractmethod: option to py:method directive and support abstractmethod by autodoc
2019-05-19 23:46:34 +09:00
Takeshi KOMIYA
8ed6a9ceb4 Fix #6379: py domain: Module index (py-modindex.html) has duplicate titles 2019-05-19 22:19:13 +09:00
Takeshi KOMIYA
358e582490 Add :abstractmethod: option to py:method directive (refs: #6138) 2019-05-15 00:00:51 +09:00
Takeshi KOMIYA
f63abac2ca Merge branch '2.0' 2019-05-13 22:03:26 +09:00
Takeshi KOMIYA
a142a654fc Add :property: option to py:method directive 2019-05-12 15:53:39 +09:00
Takeshi KOMIYA
37a5736a1f Merge branch '2.0' 2019-05-06 21:09:43 +09:00
jfbu
65ac90773d Merge branch '2.0' 2019-04-23 14:48:17 +02:00
Takeshi KOMIYA
e0abb10792 Fix #4777: Add :async: option to py:function and py:method directives 2019-04-23 01:40:37 +09:00
Takeshi KOMIYA
efc3405c6f Merge branch '2.0' 2019-04-14 19:35:33 +09:00
Takeshi KOMIYA
331594e2ca Add :classmethod: and :staticmethod: options to py:method directive 2019-04-13 23:14:59 +09:00
Takeshi KOMIYA
6af3896103 Add PyFunction and PyVariable; directives for python functions and variables 2019-04-13 20:26:07 +09:00
Takeshi KOMIYA
b0b3f5a677 deprecate PyClassmember class 2019-04-07 22:41:10 +09:00
Takeshi KOMIYA
fcc964b66f Add PyAttribute class; a directive for python attribute description 2019-04-07 22:40:08 +09:00
Takeshi KOMIYA
c8334705ca Add PyClassMethod and PyStaticMethod; directives for python method description 2019-04-07 22:39:27 +09:00
Takeshi KOMIYA
dd6c79476f Add PyMethod class; a directive for python method description 2019-04-07 22:39:27 +09:00
Takeshi KOMIYA
df05d9254d Merge branch '2.0' 2019-04-07 19:29:52 +09:00
Takeshi KOMIYA
e05e349277
Merge pull request #6236 from tk0miya/refactor_pydomain3
Add data accessors and helper methods to PythonDomain
2019-04-06 14:24:30 +09:00
Takeshi KOMIYA
0e837370f5 Add PythonDomain.note_module() to register a python module to the domain 2019-03-31 20:25:09 +09:00
Takeshi KOMIYA
259be8716a Add PythonDomain.note_module() to register a python object to the domain 2019-03-31 20:25:02 +09:00
Takeshi KOMIYA
f7a32746d3 Add "modules" property to PythonDomain 2019-03-31 20:18:11 +09:00
Takeshi KOMIYA
67b56eb472 Add "objects" property to PythonDomain 2019-03-31 19:55:10 +09:00
Takeshi KOMIYA
3fa466b728 Update type annotations for python domain 2019-03-31 19:15:41 +09:00
Takeshi KOMIYA
61098a0ae2 Drop features and APIs deprecated in 1.8 2019-03-30 14:50:37 +09:00
Takeshi KOMIYA
e008da9926 Merge branch '2.0' 2019-03-29 00:30:09 +09:00
Takeshi KOMIYA
12b682958e refactor PyObject class 2019-03-23 22:45:15 +09:00
Takeshi KOMIYA
700be75a73 Fix #6196: py domain: unexpected prefix is generated 2019-03-23 22:32:37 +09:00
Takeshi KOMIYA
dbefc9865d Clean up import for annotations 2019-03-06 23:44:44 +09:00
Takeshi KOMIYA
b9b6930e28 Fix mypy violations 2019-02-14 00:37:37 +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
Jon Dufresne
ade973f4e3 Use Python 3 super() argument-less syntax
The form is less verbose and more idiomatic for Python 3 only code.

https://docs.python.org/3/library/functions.html#super
2018-12-15 08:35:55 -08:00
Takeshi KOMIYA
6bc357140d Replace all "unicode" type by "str" 2018-12-15 23:57:43 +09:00
Takeshi KOMIYA
9dfc5e7efe Add docutils-stubs to test deps 2018-12-15 02:42:43 +09:00
Takeshi KOMIYA
565422d666 Add TextlikeNode type for docfields 2018-12-10 01:28:22 +09:00
Takeshi KOMIYA
d6eacf3198 Fix annotations for Directives (Replace N_co with nodes.Node) 2018-12-01 19:49:14 +09:00
Takeshi KOMIYA
02f767d68e Fix annotations for domains 2018-11-30 00:54:48 +09:00
Takeshi KOMIYA
31c4d06a22 refactor: Use super() to call methods of superclass 2018-11-28 01:58:32 +09:00
Takeshi KOMIYA
60a01f2b09
Merge pull request #5665 from tk0miya/fix_typehints
Add sphinx.util.typing:unicode to help mypy-3 migration
2018-11-26 00:34:52 +09:00
Takeshi KOMIYA
3c99d00605 Add sphinx.util.typing:unicode to help mypy-3 migration 2018-11-24 23:19:51 +09:00
Takeshi KOMIYA
f786a890f5 Fix annotations for Domain.resolve_xref() 2018-11-24 22:36:57 +09:00
Takeshi KOMIYA
8491217553 Add IndexEntry class to represent an entry of indices 2018-11-21 10:02:45 +09:00
Takeshi KOMIYA
e7e07fd697 Merge branch '1.8' 2018-10-16 09:57:54 +09:00
Takeshi KOMIYA
a77f3519fa Fix mypy violations 2018-10-16 09:43:58 +09:00
Takeshi KOMIYA
dc44b0d2a9 Merge branch 'master' into HEAD 2018-09-22 22:54:15 +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
Jon Dufresne
0d6be504ea Remove use of six.iteritems()
In Python 3, dict.items() is always an iterator.
2018-09-11 06:03:34 -07:00
Takeshi KOMIYA
3e57ea0a52 Merge branch '1.7' 2018-07-17 00:37:40 +09:00
Takeshi KOMIYA
50188b570a Fix py domain: rtype field could not handle "None" as a type (refs: #4946) 2018-07-15 18:54:54 +09:00
Takeshi KOMIYA
506d4c87ef Merge branch '1.7' 2018-05-21 23:07:54 +09:00
Takeshi KOMIYA
9ccff74f66 Fix #4946: py domain: type field could not handle "None" as a type 2018-05-19 22:50:10 +09:00
Takeshi KOMIYA
6c08963f25 refactor: Replace Directive by SphinxDirective 2018-05-11 12:10:09 +09:00
Takeshi KOMIYA
93837bb01e Merge branch '1.7' 2018-04-26 01:03:49 +09:00
Takeshi KOMIYA
10d127d017 Revert f4f693eff7 2018-04-26 00:08:32 +09:00
Shingo Kitagawa
51f7d351a1 fix issue #4885
https://github.com/sphinx-doc/sphinx/issues/4885
2018-04-24 00:22:18 +09:00
Shingo Kitagawa
3735ba39db fix issue #4885
https://github.com/sphinx-doc/sphinx/issues/4885
2018-04-23 17:21:02 +09:00
Takeshi KOMIYA
985886a7fc Merge branch '1.7' 2018-04-23 01:32:12 +09:00
Takeshi KOMIYA
f4f693eff7 #4459: duplicated labels detector does not work well in parallel build 2018-04-22 19:20:12 +09:00
Takeshi KOMIYA
9efaf18852 Merge branch '1.7' 2018-03-18 01:21:01 +09:00
Takeshi KOMIYA
4cebc4399c Merge commit '6694981dd6939ab876b27d4e20a8128561c307ac' 2018-03-15 02:02:21 +09:00
Takeshi KOMIYA
70a622b86c Revert "Use typing.TYPE_CHECKING for typehints"
This reverts commit a073e17537.
2018-03-13 23:23:15 +09:00
Takeshi KOMIYA
6faef28150 Make console and warning messages translatable 2018-03-03 23:18:38 +09:00
Takeshi KOMIYA
ad7d77d010 refactor: Move pairindextypes to sphinx.domains.python 2018-03-03 02:54:55 +09:00
Takeshi KOMIYA
6872d5b337 Fix pydomain: always strip parenthesis if empty (refs: #1042) 2018-03-03 01:41:49 +09:00
Takeshi KOMIYA
aba26657c5 Replace `l_() by _()` 2018-02-25 02:03:57 +09:00
Takeshi KOMIYA
f8bb40ab30 Merge branch '1.7' 2018-02-18 12:39:07 +09:00
Takeshi KOMIYA
a073e17537 Use typing.TYPE_CHECKING for typehints 2018-02-14 22:57:38 +09:00
Takeshi KOMIYA
4647fcee45 Merge branch '1.7-release' 2018-01-31 20:40:56 +09:00
Takeshi KOMIYA
9f5c676322 Use flake8-import-order 2018-01-28 01:52:16 +09:00
Takeshi KOMIYA
32c5e8346f Close #4460: extensions should return the version of data structure as metadata 2018-01-25 02:04:22 +09:00
Takeshi KOMIYA
f1f6ca8cc9 Merge branch 'happy_new_year' into master 2018-01-01 01:09:17 +09:00
Takeshi KOMIYA
2426cedb8b A happy new year! 2018-01-01 01:06:58 +09:00
Takeshi KOMIYA
7e7b389eed Merge branch 'stable' 2017-10-23 12:23:58 +09:00
Takeshi KOMIYA
ffad4f08c7 Fix #3739: `:module:` option is ignored at content of pyobjects 2017-10-21 21:37:44 +09:00
Takeshi KOMIYA
d65c5c4ed8 Merge branch 'master' into 3866_suppress_pydomain_ref_warning 2017-07-17 17:42:23 +09:00
Sam Park
5873c9644d Python rtypes should match classes, not all objects 2017-07-15 14:33:52 -07:00
Andy Freeland
7046d17631 Python parameter/variable types should match classes, not all objects
Parameter and variable types in the Python domain have the
counter-intuitive behavior of matching instance methods (or likely any
other objects) rather than classes, e.g.:

```python
class Foo(object):
    def list(self):
        """List some things."""

def bar(x):
    """
    :param x: x
    :type x: list
    """
```

`bar()` will link to `Foo.list()` rather than the standard library
`list` type.
2017-07-12 21:52:38 -07:00
Takeshi KOMIYA
db88166a3f Fix #3866: Suppress a new warning type: python refs 2017-06-17 11:34:43 +09:00
Takeshi KOMIYA
c07ed92a20 Merge branch 'stable' into 1.6-release 2017-05-13 15:42:03 +09:00
Takeshi KOMIYA
4104b93c6e Fix #3320: Warning about reference target not being found for container types 2017-05-13 15:03:11 +09:00
Takeshi KOMIYA
b39b0191a7 Fix #3351: intersphinx does not refers context 2017-04-16 18:25:21 +09:00
Takeshi KOMIYA
1123c3bda6 Merge branch 'stable' 2017-04-04 00:38:49 +09:00
Takeshi KOMIYA
57019c291a Fix #3597: python domain raises UnboundLocalError if invalid name given 2017-04-02 22:55:40 +09:00
Takeshi KOMIYA
8f9dd64992 Merge branch 'stable' 2017-03-26 11:52:15 +09:00
Takeshi KOMIYA
c57e47e042 Year++ 2017-03-26 11:49:34 +09:00
Takeshi KOMIYA
aa6dfb8b41 Merge branch 'stable' 2017-03-18 18:25:50 +09:00
Takeshi KOMIYA
a67c7855aa Merge pull request #3520 from agjohnson/fix-domain-py-nesting
Fix Python domain nesting
2017-03-18 17:33:56 +09:00
Anthony Johnson
2795889310 Review feedback, cleanup, and docs 2017-03-15 23:14:32 -07:00
jfbu
9d58a0b96c Split some long type-checking annotation lines 2017-03-12 13:20:55 +01:00
jfbu
bc0682af0e Merge branch 'stable'
Conflicts resolved:
	sphinx/domains/cpp.py
	sphinx/domains/python.py
	sphinx/texinputs/sphinx.sty
	sphinx/util/docfields.py
	sphinx/writers/latex.py
	tests/test_build_latex.py

Also updated:
    sphinx/domains/__init__.py
2017-03-12 13:01:47 +01:00
Jakob Lykke Andersen
9249db2472 Make docfield xref changes backwards compatible 2017-03-11 18:56:13 +09:00
Jakob Lykke Andersen
9ca5d990f6 Add callback on domains for xrefs from fields.
Fixes sphinx-doc/sphinx#2607.
Fixes sphinx-doc/sphinx#2665.
2017-03-08 20:35:44 +09:00
Anthony Johnson
b0875d63fc
Fix Python domain nesting
Moved #3465 here, to address this in `stable` instead.

This fixes a problem with the Python domain object nesting. Because only one
object name was stored in `ref_context`, and reset to `None` in `after_content`,
nesting broke if you put anything after a nested class:

```rst
.. py:class:: Parent

    .. py:method:: foo()

        This wouldn't resolve: :py:meth:`bar`

    .. py:class:: Child

        In the `after_content` method, the object is reset to `None`, so
        anything after this in the same nesting is considered to be top level
        instead.

    .. py:method:: bar()

        This is top level, as the domain thinks the surrounding object is `None`
```

This depends on #3519 and can be rebased after that is merged into stable

Fixes #3065
Refs #3067
2017-03-06 19:04:19 -08:00