Commit Graph

29 Commits

Author SHA1 Message Date
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
700be75a73 Fix #6196: py domain: unexpected prefix is generated 2019-03-23 22:32:37 +09:00
Takeshi KOMIYA
8980f637c9 Add testcase for sphinx.domains.python 2019-03-23 21:44:00 +09:00
Takeshi KOMIYA
65970a3033 Fix #6140: Use unittest.mock instead of mock 2019-03-09 15:16:04 +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
6978918ffc Replace use of six.text_type with str
This removes the last use of the six package allowing Sphinx to remove
it as a dependency.
2018-12-18 16:23:10 -08: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
c0fffb9e8b Fix #5432: py domain: :type: field can't process :term: references 2018-09-22 15:24:14 +09:00
Takeshi KOMIYA
f7027049b1 Fix flake8 violations 2018-02-19 23:20:56 +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
Sam Park
7020f6b41d Add tests 2017-07-15 15:18:49 -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
shimizukawa
d497d74370 refs #3458: add sphinx.testing that are moved from /tests directory. 2017-05-14 20:47:15 +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
c57e47e042 Year++ 2017-03-26 11:49:34 +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
Anthony Johnson
3502336b13
Add tests for xrefs on Python and JavaScript domains
These are just the passing test cases for the domains currently. I am going to
patch up issues with nesting on both domains to start, so these are the test
cases I'll be testing against. I'll see about addressing the other core
domains, or at very least the cpp domain, with similar tests if this looks
okay.

So far, these tests only test against methods/functions for the basic nesting
structure. More complete tests will test additional domain roles.

Refs #662
2017-03-05 16:00:25 -08:00
Georg Brandl
46d7e8558e Obligatory copyright update. 2016-01-14 22:54:04 +01:00
Georg Brandl
a23903d8d5 Merge branch 'stable' 2015-01-03 21:41:14 +01: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