Skip to content

Commit d97bf32

Browse files
Merge 90d664b into 0473d0b
2 parents 0473d0b + 90d664b commit d97bf32

File tree

4 files changed

+58
-28
lines changed

4 files changed

+58
-28
lines changed

classes/typeclass.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def typeclass(
280280
.. rubric:: Protocols
281281
282282
We also support protocols. It has the same limitation as ``Generic`` types.
283-
It is also dispatched after all regular ``instance``s are checked.
283+
It is also dispatched after all regular instances are checked.
284284
285285
To work with protocols, one needs to pass ``is_protocol`` flag to instance:
286286

docs/conf.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,38 @@
1515
import os
1616
import sys
1717

18+
import sphinx
19+
1820
sys.path.insert(0, os.path.abspath('..'))
1921

2022

23+
# -- Monkeypatches -----------------------------------------------------------
24+
25+
def _monkeypatch(cls):
26+
"""Decorator to monkey-patch methods."""
27+
def decorator(func):
28+
method = func.__name__
29+
old = getattr(cls, method)
30+
setattr(
31+
cls,
32+
method,
33+
lambda inst, *args, **kwargs: func(inst, old, *args, **kwargs),
34+
)
35+
36+
return decorator
37+
38+
39+
# workaround until https://github.com/miyakogi/m2r/pull/55 is merged
40+
@_monkeypatch(sphinx.registry.SphinxComponentRegistry)
41+
def add_source_parser(self, _old_add_source_parser, *args, **kwargs):
42+
"""This function changed in sphinx v3.0, we need to fix it back."""
43+
# signature is (parser: Type[Parser], **kwargs), but m2r expects
44+
# the removed (str, parser: Type[Parser], **kwargs).
45+
if isinstance(args[0], str):
46+
args = args[1:]
47+
return _old_add_source_parser(self, *args, **kwargs)
48+
49+
2150
# -- Project information -----------------------------------------------------
2251

2352
def _get_project_meta():
@@ -31,7 +60,7 @@ def _get_project_meta():
3160

3261
pkg_meta = _get_project_meta()
3362
project = pkg_meta['name']
34-
copyright = '2019, dry-python team' # noqa: A001
63+
copy_right = '2019, dry-python team' # noqa: A001
3564
author = 'dry-python team'
3665

3766
# The short X.Y version

poetry.lock

Lines changed: 23 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ python = "^3.6"
4848
typing_extensions = "^3.7"
4949

5050
[tool.poetry.dev-dependencies]
51-
mypy = "^0.761"
52-
wemake-python-styleguide = "^0.13.0"
51+
mypy = "^0.770"
52+
wemake-python-styleguide = "^0.14.0"
5353
flake8-pytest = "^1.3"
5454
flake8-pytest-style = "^0.1.3"
5555
flake8-pyi = "^19.3"
@@ -62,9 +62,9 @@ pytest-cov = "^2.7"
6262
pytest-randomly = "^3.2"
6363
pytest-mypy-plugins = "^1.2"
6464

65-
sphinx = "^2.3"
65+
sphinx = "^3.0"
6666
sphinx-autodoc-typehints = "^1.7"
67-
sphinxcontrib-mermaid = "^0.3.1"
67+
sphinxcontrib-mermaid = "^0.4.0"
6868
sphinx-typlog-theme = "^0.8.0"
6969
doc8 = "^0.8.0"
7070
m2r = "^0.2.1"

0 commit comments

Comments
 (0)