Skip to content

Commit

Permalink
Merge branch '3.x' into 8105_incorrect_class_constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
tk0miya committed Nov 8, 2020
2 parents 6d05b1a + 8981e84 commit 1955a08
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 50 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/main.yml
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
name: [py35, py36, py37]
name: [py35, py36, py37, py38, py39]
include:
- name: py35
python: 3.5
Expand All @@ -19,6 +19,15 @@ jobs:
- name: py37
python: 3.7
docutils: du14
- name: py38
python: 3.8
docutils: du15
- name: py39
python: 3.9
docutils: du16
coverage: "--cov ./ --cov-append --cov-config setup.cfg"
env:
PYTEST_ADDOPTS: ${{ matrix.coverage }}

steps:
- uses: actions/checkout@v2
Expand All @@ -31,9 +40,12 @@ jobs:
- name: Install graphviz
run: sudo apt-get install graphviz
- name: Install dependencies
run: pip install -U tox
run: pip install -U tox codecov
- name: Run Tox
run: tox -e ${{ matrix.docutils }} -- -vv
- name: codecov
uses: codecov/codecov-action@v1
if: matrix.coverage

windows:
runs-on: windows-latest
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/nodejs.yml
@@ -0,0 +1,21 @@
name: CI (node.js)

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
env:
node-version: 10.7

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.node-version }}
- run: npm install
- name: Run headless test
uses: GabrielBB/xvfb-action@v1
with:
run: npm test
34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions CHANGES
Expand Up @@ -26,6 +26,7 @@ Bugs fixed
----------

* #7613: autodoc: autodoc does not respect __signature__ of the class
* #4606: autodoc: the location of the warning is incorrect for inherited method
* #8105: autodoc: the signature of class constructor is incorrect if the class
is decorated

Expand Down
6 changes: 3 additions & 3 deletions doc/internals/contributing.rst
Expand Up @@ -272,9 +272,9 @@ identifier and put ``sphinx.po`` in there. Don't forget to update the possible
values for :confval:`language` in ``doc/usage/configuration.rst``.

The Sphinx core messages can also be translated on `Transifex
<https://www.transifex.com/sphinx-doc/>`_. There ``tx`` client tool, which is
provided by the ``transifex_client`` Python package, can be used to pull
translations in ``.po`` format from Transifex. To do this, go to
<https://www.transifex.com/sphinx-doc/sphinx-1/>`_. There ``tx`` client tool,
which is provided by the ``transifex_client`` Python package, can be used to
pull translations in ``.po`` format from Transifex. To do this, go to
``sphinx/locale`` and then run ``tx pull -f -l LANG`` where ``LANG`` is an
existing language identifier. It is good practice to run ``python setup.py
update_catalog`` afterwards to make sure the ``.po`` file has the canonical
Expand Down
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -203,6 +203,7 @@ def _run_domain_js(self, domain):
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Framework :: Setuptools Plugin',
Expand Down
13 changes: 11 additions & 2 deletions sphinx/ext/autodoc/__init__.py
Expand Up @@ -543,9 +543,18 @@ def process_doc(self, docstrings: List[List[str]]) -> Iterator[str]:
yield from docstringlines

def get_sourcename(self) -> str:
if (getattr(self.object, '__module__', None) and
getattr(self.object, '__qualname__', None)):
# Get the correct location of docstring from self.object
# to support inherited methods
fullname = '%s.%s' % (self.object.__module__, self.object.__qualname__)
else:
fullname = self.fullname

if self.analyzer:
return '%s:docstring of %s' % (self.analyzer.srcname, self.fullname)
return 'docstring of %s' % self.fullname
return '%s:docstring of %s' % (self.analyzer.srcname, fullname)
else:
return 'docstring of %s' % fullname

def add_content(self, more_content: Any, no_docstring: bool = False) -> None:
"""Add content from docstrings, attribute documentation and user."""
Expand Down
8 changes: 0 additions & 8 deletions sphinx/util/inspect.py
Expand Up @@ -62,14 +62,6 @@ def getargspec(func: Callable) -> Any:
methods."""
warnings.warn('sphinx.ext.inspect.getargspec() is deprecated',
RemovedInSphinx50Warning, stacklevel=2)
# On 3.5+, signature(int) or similar raises ValueError. On 3.4, it
# succeeds with a bogus signature. We want a TypeError uniformly, to
# match historical behavior.
if (isinstance(func, type) and
is_builtin_class_method(func, "__new__") and
is_builtin_class_method(func, "__init__")):
raise TypeError(
"can't compute signature for built-in type {}".format(func))

sig = inspect.signature(func)

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Expand Up @@ -26,7 +26,7 @@ extras =
test
setenv =
PYTHONWARNINGS = all,ignore::ImportWarning:importlib._bootstrap_external,ignore::DeprecationWarning:site,ignore::DeprecationWarning:distutils
PYTEST_ADDOPTS = --color yes
PYTEST_ADDOPTS = {env:PYTEST_ADDOPTS:} --color yes
commands=
pytest --durations 25 {posargs}

Expand Down

0 comments on commit 1955a08

Please sign in to comment.