From 9a44e4527704f17cca158b260b68a8dd37f95970 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sun, 1 Nov 2020 18:23:24 +0900 Subject: [PATCH 01/13] Fix #7613: autodoc: autodoc does not respect __signature__ of the class --- CHANGES | 1 + sphinx/ext/autodoc/__init__.py | 7 ++- .../roots/test-ext-autodoc/target/classes.py | 11 ++++ tests/test_ext_autodoc_autoclass.py | 50 +++++++++++++++++++ tests/test_ext_autodoc_autofunction.py | 8 +++ 5 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 tests/test_ext_autodoc_autoclass.py diff --git a/CHANGES b/CHANGES index ca79187f7..f181af9d3 100644 --- a/CHANGES +++ b/CHANGES @@ -52,6 +52,7 @@ Bugs fixed * #7786: autodoc: can't detect overloaded methods defined in other file * #8294: autodoc: single-string __slots__ is not handled correctly * #7785: autodoc: autodoc_typehints='none' does not effect to overloaded functions +* #7613: autodoc: autodoc does not respect __signature__ of the class * #8192: napoleon: description is disappeared when it contains inline literals * #8142: napoleon: Potential of regex denial of service in google style docs * #8169: LaTeX: pxjahyper loaded even when latex_engine is not platex diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py index 7343d41b6..3f2495882 100644 --- a/sphinx/ext/autodoc/__init__.py +++ b/sphinx/ext/autodoc/__init__.py @@ -1391,7 +1391,12 @@ class ClassDocumenter(DocstringSignatureMixin, ModuleLevelDocumenter): # type: # This sequence is copied from inspect._signature_from_callable. # ValueError means that no signature could be found, so we keep going. - # First, let's see if it has an overloaded __call__ defined + # First, we check the obj has a __signature__ attribute + if (hasattr(self.object, '__signature__') and + isinstance(self.object.__signature__, Signature)): + return None, None, self.object.__signature__ + + # Next, let's see if it has an overloaded __call__ defined # in its metaclass call = get_user_defined_function_or_method(type(self.object), '__call__') diff --git a/tests/roots/test-ext-autodoc/target/classes.py b/tests/roots/test-ext-autodoc/target/classes.py index dc471a6f3..52c23748b 100644 --- a/tests/roots/test-ext-autodoc/target/classes.py +++ b/tests/roots/test-ext-autodoc/target/classes.py @@ -1,3 +1,6 @@ +from inspect import Parameter, Signature + + class Foo: pass @@ -10,3 +13,11 @@ class Bar: class Baz: def __new__(cls, x, y): pass + + +class Qux: + __signature__ = Signature(parameters=[Parameter('foo', Parameter.POSITIONAL_OR_KEYWORD), + Parameter('bar', Parameter.POSITIONAL_OR_KEYWORD)]) + + def __init__(self, x, y): + pass diff --git a/tests/test_ext_autodoc_autoclass.py b/tests/test_ext_autodoc_autoclass.py new file mode 100644 index 000000000..89a79c2c7 --- /dev/null +++ b/tests/test_ext_autodoc_autoclass.py @@ -0,0 +1,50 @@ +""" + test_ext_autodoc_autoclass + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Test the autodoc extension. This tests mainly the Documenters; the auto + directives are tested in a test source file translated by test_build. + + :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import pytest + +from test_ext_autodoc import do_autodoc + + +@pytest.mark.sphinx('html', testroot='ext-autodoc') +def test_classes(app): + actual = do_autodoc(app, 'function', 'target.classes.Foo') + assert list(actual) == [ + '', + '.. py:function:: Foo()', + ' :module: target.classes', + '', + ] + + actual = do_autodoc(app, 'function', 'target.classes.Bar') + assert list(actual) == [ + '', + '.. py:function:: Bar(x, y)', + ' :module: target.classes', + '', + ] + + actual = do_autodoc(app, 'function', 'target.classes.Baz') + assert list(actual) == [ + '', + '.. py:function:: Baz(x, y)', + ' :module: target.classes', + '', + ] + + actual = do_autodoc(app, 'function', 'target.classes.Qux') + assert list(actual) == [ + '', + '.. py:function:: Qux(foo, bar)', + ' :module: target.classes', + '', + ] + diff --git a/tests/test_ext_autodoc_autofunction.py b/tests/test_ext_autodoc_autofunction.py index bb292bc6a..64f6e8db3 100644 --- a/tests/test_ext_autodoc_autofunction.py +++ b/tests/test_ext_autodoc_autofunction.py @@ -40,6 +40,14 @@ def test_classes(app): '', ] + actual = do_autodoc(app, 'function', 'target.classes.Qux') + assert list(actual) == [ + '', + '.. py:function:: Qux(foo, bar)', + ' :module: target.classes', + '', + ] + @pytest.mark.sphinx('html', testroot='ext-autodoc') def test_callable(app): From 11edef1a265e5019e24e6c29e43a8e2d391015a4 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Tue, 3 Nov 2020 02:13:05 +0900 Subject: [PATCH 02/13] doc: Update sphinx-contrib repos' URL (refs: #8349) --- doc/develop.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/develop.rst b/doc/develop.rst index 1287a6539..3bbc220b8 100644 --- a/doc/develop.rst +++ b/doc/develop.rst @@ -22,9 +22,9 @@ Extensions To learn how to write your own extension, see :ref:`dev-extensions`. -The `sphinx-contrib `_ -repository contains many contributed extensions. Some of them have their own -releases on PyPI, others you can install from a checkout. +The `sphinx-contrib `_ repository contains many +contributed extensions. Some of them have their own releases on PyPI, others you +can install from a checkout. This is the current list of contributed extensions in that repository: From 0e98e9b1a8ade24acf1d91f59aa90e8b1e179b19 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sat, 8 Aug 2020 20:06:46 +0900 Subject: [PATCH 03/13] Fix #6914: Emit a detailed warning when failed to resolve :ref: To be clear the ambiguous warning for missing-reference :ref:, this separates the warning to missing-label and missing-caption. To emit a warning dynamically, this also adds a new event: `warn-missing-reference` to customize warning messages via event handlers. --- CHANGES | 4 ++++ doc/extdev/appapi.rst | 9 +++++++++ sphinx/domains/std.py | 17 +++++++++++++++-- sphinx/events.py | 1 + sphinx/transforms/post_transforms/__init__.py | 5 ++++- tests/roots/test-domain-py-xref-warning/conf.py | 0 .../roots/test-domain-py-xref-warning/index.rst | 7 +++++++ tests/test_domain_py.py | 8 ++++++++ 8 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 tests/roots/test-domain-py-xref-warning/conf.py create mode 100644 tests/roots/test-domain-py-xref-warning/index.rst diff --git a/CHANGES b/CHANGES index b59dc7cd6..99e5cdaf9 100644 --- a/CHANGES +++ b/CHANGES @@ -13,6 +13,10 @@ Deprecated Features added -------------- +* #6914: Add a new event :event:`warn-missing-reference` to custom warning + messages when failed to resolve a cross-reference +* #6914: Emit a detailed warning when failed to resolve a ``:ref:`` reference + Bugs fixed ---------- diff --git a/doc/extdev/appapi.rst b/doc/extdev/appapi.rst index df3eb3d67..9f2c10676 100644 --- a/doc/extdev/appapi.rst +++ b/doc/extdev/appapi.rst @@ -186,6 +186,7 @@ type for that event:: 13. apply post-transforms (by priority): docutils.document -> docutils.document 14. event.doctree-resolved(app, doctree, docname) - (for any reference node that fails to resolve) event.missing-reference(env, node, contnode) + - (for any reference node that fails to resolve) event.warn-missing-reference(domain, node) 15. Generate output files 16. event.build-finished(app, exception) @@ -284,6 +285,14 @@ Here is a more detailed list of these events. .. versionadded:: 0.5 +.. event:: warn-missing-reference (app, domain, node) + + Emitted when a cross-reference to an object cannot be resolved even after + :event:`missing-reference`. If the event handler can emit warnings for + the missing reference, it should return ``True``. + + .. versionadded:: 3.4 + .. event:: doctree-resolved (app, doctree, docname) Emitted when a doctree has been "resolved" by the environment, that is, all diff --git a/sphinx/domains/std.py b/sphinx/domains/std.py index 39f67b54e..7ea468404 100644 --- a/sphinx/domains/std.py +++ b/sphinx/domains/std.py @@ -610,8 +610,6 @@ class StandardDomain(Domain): dangling_warnings = { 'term': 'term not in glossary: %(target)s', - 'ref': 'undefined label: %(target)s (if the link has no caption ' - 'the label must precede a section header)', 'numref': 'undefined label: %(target)s', 'keyword': 'unknown keyword: %(target)s', 'doc': 'unknown document: %(target)s', @@ -1107,8 +1105,23 @@ class StandardDomain(Domain): RemovedInSphinx40Warning, stacklevel=2) +def warn_missing_reference(app: "Sphinx", domain: Domain, node: pending_xref) -> bool: + if domain.name != 'std' or node['reftype'] != 'ref': + return None + else: + target = node['reftarget'] + if target not in domain.anonlabels: # type: ignore + msg = __('undefined label: %s') + else: + msg = __('Failed to create a cross reference. A title or caption not found: %s') + + logger.warning(msg % target, location=node, type='ref', subtype=node['reftype']) + return True + + def setup(app: "Sphinx") -> Dict[str, Any]: app.add_domain(StandardDomain) + app.connect('warn-missing-reference', warn_missing_reference) return { 'version': 'builtin', diff --git a/sphinx/events.py b/sphinx/events.py index 82a52d762..214654706 100644 --- a/sphinx/events.py +++ b/sphinx/events.py @@ -46,6 +46,7 @@ core_events = { 'doctree-read': 'the doctree before being pickled', 'env-merge-info': 'env, read docnames, other env instance', 'missing-reference': 'env, node, contnode', + 'warn-missing-reference': 'domain, node', 'doctree-resolved': 'doctree, docname', 'env-updated': 'env', 'html-collect-pages': 'builder', diff --git a/sphinx/transforms/post_transforms/__init__.py b/sphinx/transforms/post_transforms/__init__.py index 7dc14af52..6633d6434 100644 --- a/sphinx/transforms/post_transforms/__init__.py +++ b/sphinx/transforms/post_transforms/__init__.py @@ -166,7 +166,10 @@ class ReferencesResolver(SphinxPostTransform): warn = False if not warn: return - if domain and typ in domain.dangling_warnings: + + if self.app.emit_firstresult('warn-missing-reference', domain, node): + return + elif domain and typ in domain.dangling_warnings: msg = domain.dangling_warnings[typ] elif node.get('refdomain', 'std') not in ('', 'std'): msg = (__('%s:%s reference target not found: %%(target)s') % diff --git a/tests/roots/test-domain-py-xref-warning/conf.py b/tests/roots/test-domain-py-xref-warning/conf.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/roots/test-domain-py-xref-warning/index.rst b/tests/roots/test-domain-py-xref-warning/index.rst new file mode 100644 index 000000000..6f2cab795 --- /dev/null +++ b/tests/roots/test-domain-py-xref-warning/index.rst @@ -0,0 +1,7 @@ +test-domain-py-xref-warning +=========================== + +.. _existing-label: + +:ref:`no-label` +:ref:`existing-label` diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py index ceea51508..d81b406c2 100644 --- a/tests/test_domain_py.py +++ b/tests/test_domain_py.py @@ -859,3 +859,11 @@ def test_noindexentry(app): assert_node(doctree, (addnodes.index, desc, addnodes.index, desc)) assert_node(doctree[0], addnodes.index, entries=[('single', 'f (built-in class)', 'f', '', None)]) assert_node(doctree[2], addnodes.index, entries=[]) + + +@pytest.mark.sphinx('dummy', testroot='domain-py-xref-warning') +def test_warn_missing_reference(app, status, warning): + app.build() + assert 'index.rst:6: WARNING: undefined label: no-label' in warning.getvalue() + assert ('index.rst:6: WARNING: Failed to create a cross reference. A title or caption not found: existing-label' + in warning.getvalue()) From 9f1c89dd9d5139dfa8af43f9b552d549fb93d910 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Tue, 3 Nov 2020 11:39:44 +0900 Subject: [PATCH 04/13] Update CHANGES for PR #8355 --- CHANGES | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 3e5836a15..54f4bdc3d 100644 --- a/CHANGES +++ b/CHANGES @@ -41,6 +41,8 @@ Features added Bugs fixed ---------- +* #7613: autodoc: autodoc does not respect __signature__ of the class + Testing -------- @@ -94,7 +96,6 @@ Bugs fixed * #7786: autodoc: can't detect overloaded methods defined in other file * #8294: autodoc: single-string __slots__ is not handled correctly * #7785: autodoc: autodoc_typehints='none' does not effect to overloaded functions -* #7613: autodoc: autodoc does not respect __signature__ of the class * #8192: napoleon: description is disappeared when it contains inline literals * #8142: napoleon: Potential of regex denial of service in google style docs * #8169: LaTeX: pxjahyper loaded even when latex_engine is not platex From e84a7ac659cc9a6ba6bb6765b784c5be9b5a16dd Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Wed, 4 Nov 2020 22:07:28 +0900 Subject: [PATCH 05/13] Do testing at GitHub Actions --- .github/workflows/main.yml | 33 +++++++++++++++++++++++++++++++-- .travis.yml | 6 ------ 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7acfef6d2..1750a764a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,9 +1,38 @@ -name: CI on Windows +name: CI on: [push, pull_request] jobs: - build: + ubuntu: + runs-on: ubuntu-16.04 + strategy: + fail-fast: false + matrix: + name: [py36, py37] + include: + - name: py36 + python: 3.6 + docutils: du13 + - name: py37 + python: 3.7 + docutils: du14 + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - name: Check Python version + run: python --version + - name: Install graphviz + run: sudo apt-get install graphviz + - name: Install dependencies + run: pip install -U tox + - name: Run Tox + run: tox -e ${{ matrix.docutils }} -- -vv + + windows: runs-on: windows-latest strategy: matrix: diff --git a/.travis.yml b/.travis.yml index 47a8e7c7a..8e971a356 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,12 +14,6 @@ jobs: - python: '3.5' env: - TOXENV=du12 - - python: '3.6' - env: - - TOXENV=du13 - - python: '3.7' - env: - - TOXENV=du14 - python: '3.8' env: - TOXENV=du15 From 242c63dc8bb22ee4aab769eafee129b293aeaf01 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Wed, 4 Nov 2020 22:07:28 +0900 Subject: [PATCH 06/13] Do testing at GitHub Actions --- .github/workflows/main.yml | 33 +++++++++++++++++++++++++++++++-- .travis.yml | 6 ------ 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7acfef6d2..1750a764a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,9 +1,38 @@ -name: CI on Windows +name: CI on: [push, pull_request] jobs: - build: + ubuntu: + runs-on: ubuntu-16.04 + strategy: + fail-fast: false + matrix: + name: [py36, py37] + include: + - name: py36 + python: 3.6 + docutils: du13 + - name: py37 + python: 3.7 + docutils: du14 + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - name: Check Python version + run: python --version + - name: Install graphviz + run: sudo apt-get install graphviz + - name: Install dependencies + run: pip install -U tox + - name: Run Tox + run: tox -e ${{ matrix.docutils }} -- -vv + + windows: runs-on: windows-latest strategy: matrix: diff --git a/.travis.yml b/.travis.yml index 47a8e7c7a..8e971a356 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,12 +14,6 @@ jobs: - python: '3.5' env: - TOXENV=du12 - - python: '3.6' - env: - - TOXENV=du13 - - python: '3.7' - env: - - TOXENV=du14 - python: '3.8' env: - TOXENV=du15 From 218de39462798c8e102ff375b8ee9fb336537041 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Wed, 4 Nov 2020 23:19:25 +0900 Subject: [PATCH 07/13] Fix testcases for singledispatch are sometimes failed They are sometimes failed with python3.5 because the order of singledispatch functions is not stable on python 3.5. This uses comparision via "in" keyword to check the signature of singledispatch functions stably. --- tests/test_ext_autodoc.py | 33 ++++++++++++++++---------- tests/test_ext_autodoc_autofunction.py | 29 ++++++++++++++-------- 2 files changed, 39 insertions(+), 23 deletions(-) diff --git a/tests/test_ext_autodoc.py b/tests/test_ext_autodoc.py index c0676f23f..703cc13f6 100644 --- a/tests/test_ext_autodoc.py +++ b/tests/test_ext_autodoc.py @@ -1832,19 +1832,26 @@ def test_autodoc_for_egged_code(app): def test_singledispatch(app): options = {"members": None} actual = do_autodoc(app, 'module', 'target.singledispatch', options) - assert list(actual) == [ - '', - '.. py:module:: target.singledispatch', - '', - '', - '.. py:function:: func(arg, kwarg=None)', - ' func(arg: int, kwarg=None)', - ' func(arg: str, kwarg=None)', - ' :module: target.singledispatch', - '', - ' A function for general use.', - '', - ] + if sys.version_info < (3, 6): + # check the result via "in" because the order of singledispatch signatures is + # usually changed (because dict is not OrderedDict yet!) + assert '.. py:function:: func(arg, kwarg=None)' in actual + assert ' func(arg: int, kwarg=None)' in actual + assert ' func(arg: str, kwarg=None)' in actual + else: + assert list(actual) == [ + '', + '.. py:module:: target.singledispatch', + '', + '', + '.. py:function:: func(arg, kwarg=None)', + ' func(arg: int, kwarg=None)', + ' func(arg: str, kwarg=None)', + ' :module: target.singledispatch', + '', + ' A function for general use.', + '', + ] @pytest.mark.skipif(sys.version_info < (3, 8), diff --git a/tests/test_ext_autodoc_autofunction.py b/tests/test_ext_autodoc_autofunction.py index bb292bc6a..1f68c0319 100644 --- a/tests/test_ext_autodoc_autofunction.py +++ b/tests/test_ext_autodoc_autofunction.py @@ -9,6 +9,8 @@ :license: BSD, see LICENSE for details. """ +import sys + import pytest from test_ext_autodoc import do_autodoc @@ -108,16 +110,23 @@ def test_decorated(app): def test_singledispatch(app): options = {} actual = do_autodoc(app, 'function', 'target.singledispatch.func', options) - assert list(actual) == [ - '', - '.. py:function:: func(arg, kwarg=None)', - ' func(arg: int, kwarg=None)', - ' func(arg: str, kwarg=None)', - ' :module: target.singledispatch', - '', - ' A function for general use.', - '', - ] + if sys.version_info < (3, 6): + # check the result via "in" because the order of singledispatch signatures is + # usually changed (because dict is not OrderedDict yet!) + assert '.. py:function:: func(arg, kwarg=None)' in actual + assert ' func(arg: int, kwarg=None)' in actual + assert ' func(arg: str, kwarg=None)' in actual + else: + assert list(actual) == [ + '', + '.. py:function:: func(arg, kwarg=None)', + ' func(arg: int, kwarg=None)', + ' func(arg: str, kwarg=None)', + ' :module: target.singledispatch', + '', + ' A function for general use.', + '', + ] @pytest.mark.sphinx('html', testroot='ext-autodoc') From 4478f00c4cc2f813d8b62148813bf0dcc734c7e1 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Wed, 4 Nov 2020 23:21:52 +0900 Subject: [PATCH 08/13] Do testing with python3.5 at GitHub Actions --- .github/workflows/main.yml | 5 ++++- .travis.yml | 3 --- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1750a764a..a85e3c8fb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,8 +8,11 @@ jobs: strategy: fail-fast: false matrix: - name: [py36, py37] + name: [py35, py36, py37] include: + - name: py35 + python: 3.5 + docutils: du12 - name: py36 python: 3.6 docutils: du13 diff --git a/.travis.yml b/.travis.yml index 8e971a356..4123ba6b5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,9 +11,6 @@ env: jobs: include: - - python: '3.5' - env: - - TOXENV=du12 - python: '3.8' env: - TOXENV=du15 From 155213c6c9fe96b0952f0f09fbed10d51b27c45c Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Thu, 5 Nov 2020 00:33:05 +0900 Subject: [PATCH 09/13] test: Send test-coverage data from GitHub Action --- .github/workflows/main.yml | 13 +++++++++++-- .travis.yml | 5 ----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a85e3c8fb..99c3c594c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - name: [py35, py36, py37] + name: [py35, py36, py37, py38] include: - name: py35 python: 3.5 @@ -19,6 +19,12 @@ jobs: - name: py37 python: 3.7 docutils: du14 + - name: py38 + python: 3.8 + docutils: du15 + coverage: "--cov ./ --cov-append --cov-config setup.cfg" + env: + PYTEST_ADDOPTS: ${{ matrix.coverage }} steps: - uses: actions/checkout@v2 @@ -31,9 +37,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 diff --git a/.travis.yml b/.travis.yml index 4123ba6b5..d7162104f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,11 +11,6 @@ env: jobs: include: - - python: '3.8' - env: - - TOXENV=du15 - - PYTEST_ADDOPTS="--cov ./ --cov-append --cov-config setup.cfg" - - language: node_js node_js: '10.7' env: IS_PYTHON=false From 162a0048e525a8d5957a5e29b5e672ecebab5118 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Thu, 5 Nov 2020 01:00:54 +0900 Subject: [PATCH 10/13] tox.ini: Do not override $PYTEST_ADDOPTS forcedly --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index a61299979..316655d20 100644 --- a/tox.ini +++ b/tox.ini @@ -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} From c85335941775dadf386bc13eda81e2dfb8b70c2a Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Thu, 5 Nov 2020 01:17:41 +0900 Subject: [PATCH 11/13] tox.ini: Clean up --- .travis.yml | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/.travis.yml b/.travis.yml index d7162104f..4ce005276 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,29 +1,11 @@ os: linux dist: xenial -language: python -cache: pip - -env: - global: - - PYTHONFAULTHANDLER=x - - SKIP_LATEX_BUILD=1 - - IS_PYTHON=true - -jobs: - include: - - language: node_js - node_js: '10.7' - env: IS_PYTHON=false - services: xvfb +language: node_js +node_js: '10.7' +services: xvfb install: - - "sudo apt-get install graphviz" - - if [ $IS_PYTHON = true ]; then pip install -U tox codecov; fi - - if [ $IS_PYTHON = false ]; then npm install; fi + - npm install script: - - if [ $IS_PYTHON = true ]; then tox -- -vv; fi - - if [ $IS_PYTHON = false ]; then npm test; fi - -after_success: - - if [[ -e .coverage ]]; then codecov -e $TOXENV; fi + - npm test From 0cf1632edf8e4f16796b4324be7de11b99853734 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Thu, 5 Nov 2020 01:53:42 +0900 Subject: [PATCH 12/13] Update CHANGES for PR #8355 --- CHANGES | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 54f4bdc3d..4d412799a 100644 --- a/CHANGES +++ b/CHANGES @@ -20,6 +20,8 @@ Features added Bugs fixed ---------- +* #7613: autodoc: autodoc does not respect __signature__ of the class + Testing -------- @@ -41,8 +43,6 @@ Features added Bugs fixed ---------- -* #7613: autodoc: autodoc does not respect __signature__ of the class - Testing -------- From 6d522c5483c0cdea11c6008a4305eb10636c74dd Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Thu, 5 Nov 2020 01:33:00 +0900 Subject: [PATCH 13/13] test: Do "npm test" on GitHub Actions --- .github/workflows/nodejs.yml | 21 +++++++++++++++++++++ .travis.yml | 11 ----------- 2 files changed, 21 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/nodejs.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml new file mode 100644 index 000000000..d7a7c95f1 --- /dev/null +++ b/.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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4ce005276..000000000 --- a/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -os: linux -dist: xenial -language: node_js -node_js: '10.7' -services: xvfb - -install: - - npm install - -script: - - npm test