Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion classes/typeclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def typeclass(
.. rubric:: Protocols

We also support protocols. It has the same limitation as ``Generic`` types.
It is also dispatched after all regular ``instance``s are checked.
It is also dispatched after all regular instances are checked.

To work with protocols, one needs to pass ``is_protocol`` flag to instance:

Expand Down
31 changes: 30 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,38 @@
import os
import sys

import sphinx

sys.path.insert(0, os.path.abspath('..'))


# -- Monkeypatches -----------------------------------------------------------

def _monkeypatch(cls):
"""Decorator to monkey-patch methods."""
def decorator(func):
method = func.__name__
old = getattr(cls, method)
setattr(
cls,
method,
lambda inst, *args, **kwargs: func(inst, old, *args, **kwargs),
)

return decorator


# workaround until https://github.com/miyakogi/m2r/pull/55 is merged
@_monkeypatch(sphinx.registry.SphinxComponentRegistry)
def add_source_parser(self, _old_add_source_parser, *args, **kwargs):
"""This function changed in sphinx v3.0, we need to fix it back."""
# signature is (parser: Type[Parser], **kwargs), but m2r expects
# the removed (str, parser: Type[Parser], **kwargs).
if isinstance(args[0], str):
args = args[1:]
return _old_add_source_parser(self, *args, **kwargs)


# -- Project information -----------------------------------------------------

def _get_project_meta():
Expand All @@ -31,7 +60,7 @@ def _get_project_meta():

pkg_meta = _get_project_meta()
project = pkg_meta['name']
copyright = '2019, dry-python team' # noqa: A001
copy_right = '2019, dry-python team' # noqa: A001
author = 'dry-python team'

# The short X.Y version
Expand Down
45 changes: 23 additions & 22 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ python = "^3.6"
typing_extensions = "^3.7"

[tool.poetry.dev-dependencies]
mypy = "^0.761"
wemake-python-styleguide = "^0.13.0"
mypy = "^0.770"
wemake-python-styleguide = "^0.14.0"
flake8-pytest = "^1.3"
flake8-pytest-style = "^0.1.3"
flake8-pyi = "^19.3"
Expand All @@ -62,9 +62,9 @@ pytest-cov = "^2.7"
pytest-randomly = "^3.2"
pytest-mypy-plugins = "^1.2"

sphinx = "^2.3"
sphinx = "^3.0"
sphinx-autodoc-typehints = "^1.7"
sphinxcontrib-mermaid = "^0.3.1"
sphinxcontrib-mermaid = "^0.4.0"
sphinx-typlog-theme = "^0.8.0"
doc8 = "^0.8.0"
m2r = "^0.2.1"
Expand Down