diff --git a/docs/Makefile b/docs/Makefile
index 5b39e59ad..9a5dc0d24 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -4,7 +4,7 @@
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
-SPHINXPROJ = dotenv-linter
+SPHINXPROJ = returns
SOURCEDIR = .
BUILDDIR = _build
diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html
deleted file mode 100644
index 93ffb17f3..000000000
--- a/docs/_templates/layout.html
+++ /dev/null
@@ -1,5 +0,0 @@
-{# layout.html #}
-{# Import the layout of the theme. #}
-{% extends "!layout.html" %}
-
-{% set css_files = css_files + ['_static/overrides.css'] %}
diff --git a/docs/_templates/moreinfo.html b/docs/_templates/moreinfo.html
deleted file mode 100644
index 00d1f0e55..000000000
--- a/docs/_templates/moreinfo.html
+++ /dev/null
@@ -1,17 +0,0 @@
-
-Links
-
-
diff --git a/docs/conf.py b/docs/conf.py
index a732fba0d..c1ced3636 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -13,18 +13,16 @@
import os
import sys
+import tomli
+
sys.path.insert(0, os.path.abspath('..'))
# -- Project information -----------------------------------------------------
-def _get_project_meta() -> str:
- import tomlkit # noqa: WPS433
-
- with open('../pyproject.toml') as pyproject:
- file_contents = pyproject.read()
-
- return tomlkit.parse(file_contents)['tool']['poetry']
+def _get_project_meta():
+ with open('../pyproject.toml', mode='rb') as pyproject:
+ return tomli.load(pyproject)['tool']['poetry']
pkg_meta = _get_project_meta()
@@ -60,9 +58,6 @@ def _get_project_meta() -> str:
# Used to build graphs:
'sphinxcontrib.mermaid',
-
- # Used to generate tooltips for our references:
- 'hoverxref.extension',
]
autoclass_content = 'class'
@@ -79,10 +74,6 @@ def _get_project_meta() -> str:
# https://pypi.org/project/sphinx-autodoc-typehints/
always_document_param_types = True
-# See https://sphinx-hoverxref.readthedocs.io/en/latest/configuration.html
-hoverxref_auto_ref = True
-hoverxref_domains = ['py']
-
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@@ -116,20 +107,12 @@ def _get_project_meta() -> str:
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
-html_theme = 'sphinx_typlog_theme'
+html_theme = 'furo'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
-html_theme_options = {
- 'logo_name': 'returns',
- 'description': (
- 'Make your functions return something meaningful, typed, and safe!'
- ),
- 'github_user': 'dry-python',
- 'github_repo': 'returns',
- 'color': '#E8371A',
-}
+html_theme_options = {}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
@@ -138,15 +121,7 @@ def _get_project_meta() -> str:
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
-html_sidebars = {
- '**': [
- 'logo.html',
- 'globaltoc.html',
- 'github.html',
- 'searchbox.html',
- 'moreinfo.html',
- ],
-}
+html_sidebars = {}
# -- Extension configuration -------------------------------------------------
diff --git a/docs/pages/container.rst b/docs/pages/container.rst
index d513e4dee..a3690e6cb 100644
--- a/docs/pages/container.rst
+++ b/docs/pages/container.rst
@@ -42,11 +42,11 @@ And we can see how this state is evolving during the execution.
.. mermaid::
:caption: State evolution.
- graph LR
- F1["Container(Initial)"] --> F2["Container(UserId(1))"]
- F2 --> F3["Container(UserAccount(156))"]
- F3 --> F4["Container(FailedLoginAttempt(1))"]
- F4 --> F5["Container(SentNotificationId(992))"]
+ graph LR
+ F1["Container(Initial)"] --> F2["Container(UserId(1))"]
+ F2 --> F3["Container(UserAccount(156))"]
+ F3 --> F4["Container(FailedLoginAttempt(1))"]
+ F4 --> F5["Container(SentNotificationId(992))"]
Working with a container
@@ -68,11 +68,11 @@ Here's how it looks:
.. mermaid::
:caption: Illustration of ``map`` method.
- graph LR
- F1["Container[A]"] -- "map(function)" --> F2["Container[B]"]
+ graph LR
+ F1["Container[A]"] -- "map(function)" --> F2["Container[B]"]
- style F1 fill:green
- style F2 fill:green
+ style F1 fill:green
+ style F2 fill:green
.. code:: python
@@ -108,13 +108,13 @@ Here's how it looks:
.. mermaid::
:caption: Illustration of ``bind`` method.
- graph LR
- F1["Container[A]"] -- "bind(function)" --> F2["Container[B]"]
- F1["Container[A]"] -- "bind(function)" --> F3["Container[C]"]
+ graph LR
+ F1["Container[A]"] -- "bind(function)" --> F2["Container[B]"]
+ F1["Container[A]"] -- "bind(function)" --> F3["Container[C]"]
- style F1 fill:green
- style F2 fill:green
- style F3 fill:red
+ style F1 fill:green
+ style F2 fill:green
+ style F3 fill:red
.. code:: python
diff --git a/docs/pages/context.rst b/docs/pages/context.rst
index 3976af2fb..9a98b43b9 100644
--- a/docs/pages/context.rst
+++ b/docs/pages/context.rst
@@ -246,12 +246,12 @@ There's how execution flows:
.. mermaid::
:caption: RequiresContext execution flow.
- graph LR
- F1["first(1)"] --> F2["RequiresContext(inner)"]
- F2 --> F3
- F3["container('abc')"] --> F4["True"]
- F4 --> F5
- F5["bool_to_str(True)"] --> F6["'ok'"]
+ graph LR
+ F1["first(1)"] --> F2["RequiresContext(inner)"]
+ F2 --> F3
+ F3["container('abc')"] --> F4["True"]
+ F4 --> F5
+ F5["bool_to_str(True)"] --> F6["'ok'"]
The rule is: the dependencies are injected at the very last moment in time.
And then normal logical execution happens.
diff --git a/docs/pages/contrib/mypy_plugins.rst b/docs/pages/contrib/mypy_plugins.rst
index e75d8cc69..18054ba7a 100644
--- a/docs/pages/contrib/mypy_plugins.rst
+++ b/docs/pages/contrib/mypy_plugins.rst
@@ -91,64 +91,46 @@ Plugin definition
~~~~~~~~~~~~~~~~~
.. automodule:: returns.contrib.mypy._consts
- :members:
+ :members:
.. autoclasstree:: returns.contrib.mypy.returns_plugin
- :strict:
+ :strict:
.. automodule:: returns.contrib.mypy.returns_plugin
- :members:
+ :members:
Kind
~~~~
-.. autoclasstree:: returns.contrib.mypy._features.kind
- :strict:
-
.. automodule:: returns.contrib.mypy._features.kind
- :members:
+ :members:
Curry
~~~~~
-.. autoclasstree:: returns.contrib.mypy._features.curry
- :strict:
-
.. automodule:: returns.contrib.mypy._features.curry
- :members:
+ :members:
Partial
~~~~~~~
-.. autoclasstree:: returns.contrib.mypy._features.partial
- :strict:
-
.. automodule:: returns.contrib.mypy._features.partial
- :members:
+ :members:
Flow
~~~~
-.. autoclasstree:: returns.contrib.mypy._features.flow
- :strict:
-
.. automodule:: returns.contrib.mypy._features.flow
- :members:
+ :members:
Pipe
~~~~
-.. autoclasstree:: returns.contrib.mypy._features.pipe
- :strict:
-
.. automodule:: returns.contrib.mypy._features.pipe
- :members:
+ :members:
Do notation
~~~~~~~~~~~
-.. autoclasstree:: returns.contrib.mypy._features.do_notation
- :strict:
-
.. automodule:: returns.contrib.mypy._features.do_notation
- :members:
+ :members:
diff --git a/docs/pages/railway.rst b/docs/pages/railway.rst
index 10c9a2907..586b09b7f 100644
--- a/docs/pages/railway.rst
+++ b/docs/pages/railway.rst
@@ -28,27 +28,27 @@ or we can fix the situation.
.. mermaid::
:caption: Railway oriented programming.
- graph LR
- S1 -- bind --> S3
- S1 -- bind --> F2
- S3 -- map --> S5
- S5 -- bind --> S7
- S5 -- bind --> F6
-
- F2 -- alt --> F4
- F4 -- lash --> F6
- F4 -- lash --> S5
- F6 -- lash --> F8
- F6 -- lash --> S7
-
- style S1 fill:green
- style S3 fill:green
- style S5 fill:green
- style S7 fill:green
- style F2 fill:red
- style F4 fill:red
- style F6 fill:red
- style F8 fill:red
+ graph LR
+ S1 -- bind --> S3
+ S1 -- bind --> F2
+ S3 -- map --> S5
+ S5 -- bind --> S7
+ S5 -- bind --> F6
+
+ F2 -- alt --> F4
+ F4 -- lash --> F6
+ F4 -- lash --> S5
+ F6 -- lash --> F8
+ F6 -- lash --> S7
+
+ style S1 fill:green
+ style S3 fill:green
+ style S5 fill:green
+ style S7 fill:green
+ style F2 fill:red
+ style F4 fill:red
+ style F6 fill:red
+ style F8 fill:red
Returning execution to the right track
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -69,11 +69,11 @@ Let's start from the first one:
.. mermaid::
:caption: Illustration of ``alt`` method.
- graph LR
- F1["Container[A]"] -- "alt(function)" --> F2["Container[B]"]
+ graph LR
+ F1["Container[A]"] -- "alt(function)" --> F2["Container[B]"]
- style F1 fill:red
- style F2 fill:red
+ style F1 fill:red
+ style F2 fill:red
.. code:: python
@@ -89,13 +89,13 @@ It can also lash your flow and get on the successful track again:
.. mermaid::
:caption: Illustration of ``lash`` method.
- graph LR
- F1["Container[A]"] -- "lash(function)" --> F2["Container[B]"]
- F1["Container[A]"] -- "lash(function)" --> F3["Container[C]"]
+ graph LR
+ F1["Container[A]"] -- "lash(function)" --> F2["Container[B]"]
+ F1["Container[A]"] -- "lash(function)" --> F3["Container[C]"]
- style F1 fill:red
- style F2 fill:green
- style F3 fill:red
+ style F1 fill:red
+ style F2 fill:green
+ style F3 fill:red
.. code:: python
diff --git a/poetry.lock b/poetry.lock
index 5d14e3a3b..b752e4612 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -113,6 +113,27 @@ test = ["beautifulsoup4 (>=4.8.0)", "coverage (>=4.5.4)", "fixtures (>=3.0.0)",
toml = ["tomli (>=1.1.0)"]
yaml = ["PyYAML"]
+[[package]]
+name = "beautifulsoup4"
+version = "4.12.3"
+description = "Screen-scraping library"
+optional = false
+python-versions = ">=3.6.0"
+files = [
+ {file = "beautifulsoup4-4.12.3-py3-none-any.whl", hash = "sha256:b80878c9f40111313e55da8ba20bdba06d8fa3969fc68304167741bbf9e082ed"},
+ {file = "beautifulsoup4-4.12.3.tar.gz", hash = "sha256:74e3d1928edc070d21748185c46e3fb33490f22f52a3addee9aee0f4f7781051"},
+]
+
+[package.dependencies]
+soupsieve = ">1.2"
+
+[package.extras]
+cchardet = ["cchardet"]
+chardet = ["chardet"]
+charset-normalizer = ["charset-normalizer"]
+html5lib = ["html5lib"]
+lxml = ["lxml"]
+
[[package]]
name = "cattrs"
version = "23.2.3"
@@ -494,13 +515,13 @@ tomli = {version = "*", markers = "python_version < \"3.11\""}
[[package]]
name = "docutils"
-version = "0.19"
+version = "0.20.1"
description = "Docutils -- Python Documentation Utilities"
optional = false
python-versions = ">=3.7"
files = [
- {file = "docutils-0.19-py3-none-any.whl", hash = "sha256:5e1de4d849fee02c63b040a4a3fd567f4ab104defd8a5511fbbc24a8a017efbc"},
- {file = "docutils-0.19.tar.gz", hash = "sha256:33995a6753c30b7f577febfc2c50411fec6aac7f7ffeb7c4cfe5991072dcf9e6"},
+ {file = "docutils-0.20.1-py3-none-any.whl", hash = "sha256:96f387a2c5562db4476f09f13bbab2192e764cac08ebbf3a34a95d9b1e4a59d6"},
+ {file = "docutils-0.20.1.tar.gz", hash = "sha256:f08a4e276c3a1583a86dce3e34aba3fe04d02bba2dd51ed16106244e8a923e3b"},
]
[[package]]
@@ -725,13 +746,13 @@ dev = ["black (==24.4.2)", "flake8-bugbear (==24.4.26)", "flake8-noqa (==1.4.0)"
[[package]]
name = "flake8-pytest-style"
-version = "1.7.2"
+version = "2.0.0"
description = "A flake8 plugin checking common style issues or inconsistencies with pytest-based tests."
optional = false
-python-versions = ">=3.7.2,<4.0.0"
+python-versions = "<4.0.0,>=3.8.1"
files = [
- {file = "flake8_pytest_style-1.7.2-py3-none-any.whl", hash = "sha256:f5d2aa3219163a052dd92226589d45fab8ea027a3269922f0c4029f548ea5cd1"},
- {file = "flake8_pytest_style-1.7.2.tar.gz", hash = "sha256:b924197c99b951315949920b0e5547f34900b1844348432e67a44ab191582109"},
+ {file = "flake8_pytest_style-2.0.0-py3-none-any.whl", hash = "sha256:abcb9f56f277954014b749e5a0937fae215be01a21852e9d05e7600c3de6aae5"},
+ {file = "flake8_pytest_style-2.0.0.tar.gz", hash = "sha256:919c328cacd4bc4f873ea61ab4db0d8f2c32e0db09a3c73ab46b1de497556464"},
]
[package.dependencies]
@@ -813,6 +834,23 @@ files = [
orderedmultidict = ">=1.0.1"
six = ">=1.8.0"
+[[package]]
+name = "furo"
+version = "2024.5.6"
+description = "A clean customisable Sphinx documentation theme."
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "furo-2024.5.6-py3-none-any.whl", hash = "sha256:490a00d08c0a37ecc90de03ae9227e8eb5d6f7f750edf9807f398a2bdf2358de"},
+ {file = "furo-2024.5.6.tar.gz", hash = "sha256:81f205a6605ebccbb883350432b4831c0196dd3d1bc92f61e1f459045b3d2b0b"},
+]
+
+[package.dependencies]
+beautifulsoup4 = "*"
+pygments = ">=2.7"
+sphinx = ">=6.0,<8.0"
+sphinx-basic-ng = ">=1.0.0.beta2"
+
[[package]]
name = "gitignore-parser"
version = "0.1.11"
@@ -2074,13 +2112,13 @@ files = [
[[package]]
name = "slotscheck"
-version = "0.18.0"
+version = "0.19.0"
description = "Ensure your __slots__ are working properly."
optional = false
python-versions = ">=3.8.1"
files = [
- {file = "slotscheck-0.18.0-py3-none-any.whl", hash = "sha256:7de369ce0ad269b05a20d34789dc8df102391a232a88cdb2901c5eac335f1570"},
- {file = "slotscheck-0.18.0.tar.gz", hash = "sha256:b36e14954e5c973c192208ee2898b663732a8f529af2c80cb33d6bc8bc9ad560"},
+ {file = "slotscheck-0.19.0-py3-none-any.whl", hash = "sha256:53fbc9befacb331a2ab25b385004d99ea72b5cee4f3deb6da676c8f08d0fcdd9"},
+ {file = "slotscheck-0.19.0.tar.gz", hash = "sha256:707b4339d280664139ffd2c78fef99b3028e215f13cc77244147dd6126fe2e0d"},
]
[package.dependencies]
@@ -2120,92 +2158,88 @@ files = [
{file = "sortedcontainers-2.4.0.tar.gz", hash = "sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88"},
]
+[[package]]
+name = "soupsieve"
+version = "2.5"
+description = "A modern CSS selector implementation for Beautiful Soup."
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "soupsieve-2.5-py3-none-any.whl", hash = "sha256:eaa337ff55a1579b6549dc679565eac1e3d000563bcb1c8ab0d0fefbc0c2cdc7"},
+ {file = "soupsieve-2.5.tar.gz", hash = "sha256:5663d5a7b3bfaeee0bc4372e7fc48f9cff4940b3eec54a6451cc5299f1097690"},
+]
+
[[package]]
name = "sphinx"
-version = "5.3.0"
+version = "7.3.7"
description = "Python documentation generator"
optional = false
-python-versions = ">=3.6"
+python-versions = ">=3.9"
files = [
- {file = "Sphinx-5.3.0.tar.gz", hash = "sha256:51026de0a9ff9fc13c05d74913ad66047e104f56a129ff73e174eb5c3ee794b5"},
- {file = "sphinx-5.3.0-py3-none-any.whl", hash = "sha256:060ca5c9f7ba57a08a1219e547b269fadf125ae25b06b9fa7f66768efb652d6d"},
+ {file = "sphinx-7.3.7-py3-none-any.whl", hash = "sha256:413f75440be4cacf328f580b4274ada4565fb2187d696a84970c23f77b64d8c3"},
+ {file = "sphinx-7.3.7.tar.gz", hash = "sha256:a4a7db75ed37531c05002d56ed6948d4c42f473a36f46e1382b0bd76ca9627bc"},
]
[package.dependencies]
-alabaster = ">=0.7,<0.8"
+alabaster = ">=0.7.14,<0.8.0"
babel = ">=2.9"
colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""}
-docutils = ">=0.14,<0.20"
+docutils = ">=0.18.1,<0.22"
imagesize = ">=1.3"
importlib-metadata = {version = ">=4.8", markers = "python_version < \"3.10\""}
Jinja2 = ">=3.0"
packaging = ">=21.0"
-Pygments = ">=2.12"
-requests = ">=2.5.0"
+Pygments = ">=2.14"
+requests = ">=2.25.0"
snowballstemmer = ">=2.0"
sphinxcontrib-applehelp = "*"
sphinxcontrib-devhelp = "*"
sphinxcontrib-htmlhelp = ">=2.0.0"
sphinxcontrib-jsmath = "*"
sphinxcontrib-qthelp = "*"
-sphinxcontrib-serializinghtml = ">=1.1.5"
+sphinxcontrib-serializinghtml = ">=1.1.9"
+tomli = {version = ">=2", markers = "python_version < \"3.11\""}
[package.extras]
docs = ["sphinxcontrib-websupport"]
-lint = ["docutils-stubs", "flake8 (>=3.5.0)", "flake8-bugbear", "flake8-comprehensions", "flake8-simplify", "isort", "mypy (>=0.981)", "sphinx-lint", "types-requests", "types-typed-ast"]
-test = ["cython", "html5lib", "pytest (>=4.6)", "typed_ast"]
+lint = ["flake8 (>=3.5.0)", "importlib_metadata", "mypy (==1.9.0)", "pytest (>=6.0)", "ruff (==0.3.7)", "sphinx-lint", "tomli", "types-docutils", "types-requests"]
+test = ["cython (>=3.0)", "defusedxml (>=0.7.1)", "pytest (>=6.0)", "setuptools (>=67.0)"]
[[package]]
name = "sphinx-autodoc-typehints"
-version = "1.23.0"
+version = "1.25.3"
description = "Type hints (PEP 484) support for the Sphinx autodoc extension"
optional = false
-python-versions = ">=3.7"
+python-versions = ">=3.8"
files = [
- {file = "sphinx_autodoc_typehints-1.23.0-py3-none-any.whl", hash = "sha256:ac099057e66b09e51b698058ba7dd76e57e1fe696cd91b54e121d3dad188f91d"},
- {file = "sphinx_autodoc_typehints-1.23.0.tar.gz", hash = "sha256:5d44e2996633cdada499b6d27a496ddf9dbc95dd1f0f09f7b37940249e61f6e9"},
+ {file = "sphinx_autodoc_typehints-1.25.3-py3-none-any.whl", hash = "sha256:d3da7fa9a9761eff6ff09f8b1956ae3090a2d4f4ad54aebcade8e458d6340835"},
+ {file = "sphinx_autodoc_typehints-1.25.3.tar.gz", hash = "sha256:70db10b391acf4e772019765991d2de0ff30ec0899b9ba137706dc0b3c4835e0"},
]
[package.dependencies]
-sphinx = ">=5.3"
+sphinx = ">=7.1.2"
[package.extras]
-docs = ["furo (>=2022.12.7)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.23.4)"]
-testing = ["covdefaults (>=2.2.2)", "coverage (>=7.2.2)", "diff-cover (>=7.5)", "nptyping (>=2.5)", "pytest (>=7.2.2)", "pytest-cov (>=4)", "sphobjinv (>=2.3.1)", "typing-extensions (>=4.5)"]
-type-comment = ["typed-ast (>=1.5.4)"]
+docs = ["furo (>=2023.9.10)"]
+numpy = ["nptyping (>=2.5)"]
+testing = ["covdefaults (>=2.3)", "coverage (>=7.3.2)", "diff-cover (>=8.0.1)", "pytest (>=7.4.3)", "pytest-cov (>=4.1)", "sphobjinv (>=2.3.1)", "typing-extensions (>=4.8)"]
[[package]]
-name = "sphinx-hoverxref"
-version = "1.4.0"
-description = "Sphinx extension to show tooltips with content embedded when hover a reference."
+name = "sphinx-basic-ng"
+version = "1.0.0b2"
+description = "A modern skeleton for Sphinx themes."
optional = false
-python-versions = "*"
+python-versions = ">=3.7"
files = [
- {file = "sphinx_hoverxref-1.4.0-py2.py3-none-any.whl", hash = "sha256:7687522d0f2f81b9ace330e3d69f93b00acba4020e91c26c204fc0a547c6d04b"},
- {file = "sphinx_hoverxref-1.4.0.tar.gz", hash = "sha256:1f6ea89b172a87ed15f082c0af9c2217284182529265d0a1b485584a11b96b56"},
+ {file = "sphinx_basic_ng-1.0.0b2-py3-none-any.whl", hash = "sha256:eb09aedbabfb650607e9b4b68c9d240b90b1e1be221d6ad71d61c52e29f7932b"},
+ {file = "sphinx_basic_ng-1.0.0b2.tar.gz", hash = "sha256:9ec55a47c90c8c002b5960c57492ec3021f5193cb26cebc2dc4ea226848651c9"},
]
[package.dependencies]
-sphinx = ">=5.0"
-sphinxcontrib-jquery = "*"
+sphinx = ">=4.0"
[package.extras]
-doc = ["sphinx", "sphinx-autoapi", "sphinx-autobuild", "sphinx-notfound-page", "sphinx-prompt", "sphinx-rtd-theme", "sphinx-tabs", "sphinx-version-warning", "sphinxcontrib-bibtex (>=2.6.0)", "sphinxemoji"]
-test = ["tox"]
-
-[[package]]
-name = "sphinx-typlog-theme"
-version = "0.8.0"
-description = "A typlog Sphinx theme"
-optional = false
-python-versions = "*"
-files = [
- {file = "sphinx_typlog_theme-0.8.0-py2.py3-none-any.whl", hash = "sha256:b0ab728ab31d071523af0229bcb6427a13493958b3fc2bb7db381520fab77de4"},
- {file = "sphinx_typlog_theme-0.8.0.tar.gz", hash = "sha256:61dbf97b1fde441bd03a5409874571e229898b67fb3080400837b8f4cee46659"},
-]
-
-[package.extras]
-dev = ["livereload", "sphinx"]
+docs = ["furo", "ipython", "myst-parser", "sphinx-copybutton", "sphinx-inline-tabs"]
[[package]]
name = "sphinxcontrib-applehelp"
@@ -2255,20 +2289,6 @@ lint = ["docutils-stubs", "flake8", "mypy"]
standalone = ["Sphinx (>=5)"]
test = ["html5lib", "pytest"]
-[[package]]
-name = "sphinxcontrib-jquery"
-version = "4.1"
-description = "Extension to include jQuery on newer Sphinx releases"
-optional = false
-python-versions = ">=2.7"
-files = [
- {file = "sphinxcontrib-jquery-4.1.tar.gz", hash = "sha256:1620739f04e36a2c779f1a131a2dfd49b2fd07351bf1968ced074365933abc7a"},
- {file = "sphinxcontrib_jquery-4.1-py2.py3-none-any.whl", hash = "sha256:f936030d7d0147dd026a4f2b5a57343d233f1fc7b363f68b3d4f1cb0993878ae"},
-]
-
-[package.dependencies]
-Sphinx = ">=1.8"
-
[[package]]
name = "sphinxcontrib-jsmath"
version = "1.0.1"
@@ -2285,13 +2305,13 @@ test = ["flake8", "mypy", "pytest"]
[[package]]
name = "sphinxcontrib-mermaid"
-version = "0.8.1"
+version = "0.9.2"
description = "Mermaid diagrams in yours Sphinx powered docs"
optional = false
python-versions = ">=3.7"
files = [
- {file = "sphinxcontrib-mermaid-0.8.1.tar.gz", hash = "sha256:fa3e5325d4ba395336e6137d113f55026b1a03ccd115dc54113d1d871a580466"},
- {file = "sphinxcontrib_mermaid-0.8.1-py3-none-any.whl", hash = "sha256:15491c24ec78cf1626b1e79e797a9ce87cb7959cf38f955eb72dd5512aeb6ce9"},
+ {file = "sphinxcontrib-mermaid-0.9.2.tar.gz", hash = "sha256:252ef13dd23164b28f16d8b0205cf184b9d8e2b714a302274d9f59eb708e77af"},
+ {file = "sphinxcontrib_mermaid-0.9.2-py3-none-any.whl", hash = "sha256:6795a72037ca55e65663d2a2c1a043d636dc3d30d418e56dd6087d1459d98a5d"},
]
[[package]]
@@ -2531,4 +2551,4 @@ compatible-mypy = ["mypy"]
[metadata]
lock-version = "2.0"
python-versions = "^3.9"
-content-hash = "42db5b38693543a85180829970df730f45956c2bbe6e56d348b7f6fe6d133eb4"
+content-hash = "ccad710783cb888f79e700e7397b10b4778cd61fe63283f5ddd4b4c6eea865e0"
diff --git a/pyproject.toml b/pyproject.toml
index 8496b4bb0..e9c35b7af 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -60,11 +60,11 @@ attrs = "^23.2"
httpx = "^0.27"
wemake-python-styleguide = "^0.19"
-flake8-pytest-style = "^1.6"
+flake8-pytest-style = "^2.0"
flake8-pyi = "^24.1"
nitpick = "^0.35"
codespell = "^2.2"
-slotscheck = "0.18"
+slotscheck = "^0.19"
pytest-cov = "^5.0"
pytest-randomly = "^3.12"
@@ -79,13 +79,12 @@ optional = true
[tool.poetry.group.docs.dependencies]
-sphinx = "^5.2"
+sphinx = "^7.3"
sphinx-autodoc-typehints = "^1.23"
-sphinxcontrib-mermaid = "0.8.1"
-sphinx-typlog-theme = "^0.8"
-sphinx-hoverxref = "^1.3"
+sphinxcontrib-mermaid = "^0.9"
+furo = "^2024.5"
m2r2 = "^0.3"
-tomlkit = "^0.12"
+tomli = "^2.0"
[tool.poetry.extras]
compatible-mypy = ["mypy"]
@@ -105,5 +104,5 @@ style = "https://raw.githubusercontent.com/wemake-services/wemake-python-stylegu
strict-imports = true
require-subclass = true
require-superclass = true
-exclude-modules = 'returns\.contrib\.mypy'
+exclude-modules = 'returns\.contrib\.'
exclude-classes = 'returns\.primitives\.exceptions:UnwrapFailedError'
diff --git a/returns/contrib/pytest/plugin.py b/returns/contrib/pytest/plugin.py
index 8aa70f7d6..5c5392f06 100644
--- a/returns/contrib/pytest/plugin.py
+++ b/returns/contrib/pytest/plugin.py
@@ -140,7 +140,7 @@ def pytest_configure(config) -> None:
)
-@pytest.fixture()
+@pytest.fixture
def returns() -> Iterator[ReturnsAsserts]:
"""Returns class with helpers assertions to check containers."""
with _spy_error_handling() as errors_handled:
diff --git a/returns/curry.py b/returns/curry.py
index dbe8d139d..e14915194 100644
--- a/returns/curry.py
+++ b/returns/curry.py
@@ -111,8 +111,8 @@ def curry(function: Callable[..., _ReturnType]) -> Callable[..., _ReturnType]:
when they know that they are doing.
See also:
- - https://en.wikipedia.org/wiki/Currying
- - https://stackoverflow.com/questions/218025/
+ - https://en.wikipedia.org/wiki/Currying
+ - https://stackoverflow.com/questions/218025/
"""
argspec = Signature.from_callable(function).bind_partial()
diff --git a/tests/test_contrib/test_pytest/test_plugin_error_handler.py b/tests/test_contrib/test_pytest/test_plugin_error_handler.py
index 37f61ea08..399468c9d 100644
--- a/tests/test_contrib/test_pytest/test_plugin_error_handler.py
+++ b/tests/test_contrib/test_pytest/test_plugin_error_handler.py
@@ -76,7 +76,7 @@ def test_error_not_handled(returns: ReturnsAsserts, container):
assert not returns._errors_handled # noqa: WPS437
-@pytest.mark.anyio()
+@pytest.mark.anyio
@pytest.mark.parametrize('container', [
FutureResult.from_value(1),
FutureResult.from_failure(1),
diff --git a/tests/test_converters/test_flatten.py b/tests/test_converters/test_flatten.py
index e6ca0fe89..a38c800d2 100644
--- a/tests/test_converters/test_flatten.py
+++ b/tests/test_converters/test_flatten.py
@@ -62,7 +62,7 @@ def test_flatten_context(container, merged):
assert flatten(container)(...) == merged(...)
-@pytest.mark.anyio()
+@pytest.mark.anyio
async def test_flatten_future(subtests):
"""Ensures that `flatten` is always returning the correct type."""
futures = [
@@ -79,7 +79,7 @@ async def test_flatten_future(subtests):
assert await flatten(container) == await merged # type: ignore
-@pytest.mark.anyio()
+@pytest.mark.anyio
async def test_flatten_context_future_result(subtests):
"""Ensures that `flatten` is always returning the correct type."""
futures = [
@@ -99,7 +99,7 @@ async def test_flatten_context_future_result(subtests):
)(...) == await merged(...)
-@pytest.mark.anyio()
+@pytest.mark.anyio
async def test_non_flatten_future(subtests):
"""Ensures that `flatten` is always returning the correct type."""
futures = [
@@ -116,7 +116,7 @@ async def test_non_flatten_future(subtests):
)
-@pytest.mark.anyio()
+@pytest.mark.anyio
async def test_non_flatten_context_future_result(subtests):
"""Ensures that `flatten` is always returning the correct type."""
futures = [
diff --git a/tests/test_future/test_future_container/test_asyncize_decorator.py b/tests/test_future/test_future_container/test_asyncize_decorator.py
index d88339941..5415d0eb9 100644
--- a/tests/test_future/test_future_container/test_asyncize_decorator.py
+++ b/tests/test_future/test_future_container/test_asyncize_decorator.py
@@ -8,7 +8,7 @@ def _function(arg: int) -> float:
return arg / 2
-@pytest.mark.anyio()
+@pytest.mark.anyio
async def test_asyncify_decorator():
"""Ensure that function marked with ``@asyncify`` is awaitable."""
coro = _function(2)
diff --git a/tests/test_future/test_future_container/test_future_decorator.py b/tests/test_future/test_future_container/test_future_decorator.py
index 62a0b801d..abd898a16 100644
--- a/tests/test_future/test_future_container/test_future_decorator.py
+++ b/tests/test_future/test_future_container/test_future_decorator.py
@@ -9,7 +9,7 @@ async def _coro(arg: int) -> float:
return arg / 2
-@pytest.mark.anyio()
+@pytest.mark.anyio
async def test_safe_decorator():
"""Ensure that coroutine marked with ``@future`` returns ``Future``."""
future_instance = _coro(1)
diff --git a/tests/test_future/test_future_container/test_future_equality.py b/tests/test_future/test_future_container/test_future_equality.py
index f0f1c08e0..14ad5a06c 100644
--- a/tests/test_future/test_future_container/test_future_equality.py
+++ b/tests/test_future/test_future_container/test_future_equality.py
@@ -9,7 +9,7 @@ def test_nonequality():
assert hash(Future.from_value(1))
-@pytest.mark.anyio()
+@pytest.mark.anyio
async def test_equality():
"""Ensures that containers are not compared to regular values."""
assert await Future.from_value(2) == await Future.from_value(2)
diff --git a/tests/test_future/test_future_container/test_future_units.py b/tests/test_future/test_future_container/test_future_units.py
index f7b2c32ea..06490ab6c 100644
--- a/tests/test_future/test_future_container/test_future_units.py
+++ b/tests/test_future/test_future_container/test_future_units.py
@@ -6,7 +6,7 @@
from returns.io import IO
-@pytest.mark.anyio()
+@pytest.mark.anyio
async def test_inner_value(subtests):
"""Ensure that coroutine correct value is preserved for all units."""
containers: List[Awaitable[Any]] = [
diff --git a/tests/test_future/test_future_result/test_future_result_decorator.py b/tests/test_future/test_future_result/test_future_result_decorator.py
index be2486db1..5bdad8bc3 100644
--- a/tests/test_future/test_future_result/test_future_result_decorator.py
+++ b/tests/test_future/test_future_result/test_future_result_decorator.py
@@ -9,7 +9,7 @@ async def _coro(arg: int) -> float:
return 1 / arg
-@pytest.mark.anyio()
+@pytest.mark.anyio
async def test_future_safe_decorator():
"""Ensure that coroutine marked with ``@future_safe``."""
future_instance = _coro(2)
@@ -18,7 +18,7 @@ async def test_future_safe_decorator():
assert await future_instance == IOSuccess(0.5)
-@pytest.mark.anyio()
+@pytest.mark.anyio
async def test_future_safe_decorator_failure():
"""Ensure that coroutine marked with ``@future_safe``."""
future_instance = _coro(0)
diff --git a/tests/test_future/test_future_result/test_future_result_equality.py b/tests/test_future/test_future_result/test_future_result_equality.py
index e0f434c2f..21d4981ff 100644
--- a/tests/test_future/test_future_result/test_future_result_equality.py
+++ b/tests/test_future/test_future_result/test_future_result_equality.py
@@ -9,7 +9,7 @@ def test_nonequality():
assert hash(FutureResult.from_value(1))
-@pytest.mark.anyio()
+@pytest.mark.anyio
async def test_equality():
"""Ensures that containers are not compared to regular values."""
assert await FutureResult.from_value(
diff --git a/tests/test_future/test_future_result/test_future_result_units.py b/tests/test_future/test_future_result/test_future_result_units.py
index 932ef9973..ac92fc2ec 100644
--- a/tests/test_future/test_future_result/test_future_result_units.py
+++ b/tests/test_future/test_future_result/test_future_result_units.py
@@ -5,7 +5,7 @@
from returns.result import Failure, Success
-@pytest.mark.anyio()
+@pytest.mark.anyio
async def test_inner_value(subtests):
"""Ensure that coroutine correct value is preserved for all units."""
containers = [
diff --git a/tests/test_iterables/test_fold/test_collect.py b/tests/test_iterables/test_fold/test_collect.py
index 673ed199d..5b708220e 100644
--- a/tests/test_iterables/test_fold/test_collect.py
+++ b/tests/test_iterables/test_fold/test_collect.py
@@ -117,7 +117,7 @@ def test_fold_collect_reader(iterable, sequence):
)(...) == sequence(...)
-@pytest.mark.anyio()
+@pytest.mark.anyio
async def test_fold_collect_reader_future_result(subtests):
"""Iterable for ``ReaderFutureResult`` and ``Fold``."""
containers: List[Tuple[ # noqa: WPS234
@@ -159,7 +159,7 @@ async def test_fold_collect_reader_future_result(subtests):
)(...) == await sequence(...)
-@pytest.mark.anyio()
+@pytest.mark.anyio
async def test_fold_collect_future(subtests):
"""Iterable for ``Future`` and ``Fold``."""
containers: List[Tuple[ # noqa: WPS234
@@ -180,7 +180,7 @@ async def test_fold_collect_future(subtests):
) == await sequence
-@pytest.mark.anyio()
+@pytest.mark.anyio
async def test_fold_collect_future_result(subtests):
"""Iterable for ``FutureResult`` and ``Fold``."""
containers: List[Tuple[ # noqa: WPS234
diff --git a/tests/test_iterables/test_fold/test_collect_all.py b/tests/test_iterables/test_fold/test_collect_all.py
index e86f9367a..adf294f50 100644
--- a/tests/test_iterables/test_fold/test_collect_all.py
+++ b/tests/test_iterables/test_fold/test_collect_all.py
@@ -96,7 +96,7 @@ def test_collect_all_reader_result(iterable, sequence):
)(...) == sequence(...)
-@pytest.mark.anyio()
+@pytest.mark.anyio
async def test_collect_all_reader_future_result(subtests):
"""Iterable for ``ReaderFutureResult`` and ``Fold``."""
containers: List[Tuple[ # noqa: WPS234
@@ -138,7 +138,7 @@ async def test_collect_all_reader_future_result(subtests):
)(...) == await sequence(...)
-@pytest.mark.anyio()
+@pytest.mark.anyio
async def test_collect_all_future_result(subtests):
"""Iterable for ``FutureResult`` and ``Fold``."""
containers: List[Tuple[ # noqa: WPS234
diff --git a/tests/test_iterables/test_fold/test_loop.py b/tests/test_iterables/test_fold/test_loop.py
index de3f57624..a45c02469 100644
--- a/tests/test_iterables/test_fold/test_loop.py
+++ b/tests/test_iterables/test_fold/test_loop.py
@@ -125,7 +125,7 @@ def test_fold_loop_reader(iterable, sequence):
)(...) == sequence(...)
-@pytest.mark.anyio()
+@pytest.mark.anyio
async def test_fold_loop_reader_future_result(subtests):
"""Iterable for ``ReaderFutureResult`` and ``Fold``."""
containers: List[Tuple[ # noqa: WPS234
@@ -174,7 +174,7 @@ async def test_fold_loop_reader_future_result(subtests):
)(...) == await sequence(...)
-@pytest.mark.anyio()
+@pytest.mark.anyio
async def test_fold_collect_future(subtests):
"""Iterable for ``Future`` and ``Fold``."""
containers: List[Tuple[ # noqa: WPS234
@@ -195,7 +195,7 @@ async def test_fold_collect_future(subtests):
) == await sequence
-@pytest.mark.anyio()
+@pytest.mark.anyio
async def test_fold_collect_future_result(subtests):
"""Iterable for ``FutureResult`` and ``Fold``."""
containers: List[Tuple[ # noqa: WPS234
diff --git a/tests/test_pipeline/test_managed/test_managed_future_result.py b/tests/test_pipeline/test_managed/test_managed_future_result.py
index 2d4451e5b..aeb2d122d 100644
--- a/tests/test_pipeline/test_managed/test_managed_future_result.py
+++ b/tests/test_pipeline/test_managed/test_managed_future_result.py
@@ -49,7 +49,7 @@ def __call__(
return FutureResult.from_failure('release failure')
-@pytest.mark.anyio()
+@pytest.mark.anyio
@pytest.mark.parametrize(('acquire', 'use', 'release', 'final_result', 'log'), [
# Acquire success:
(
@@ -123,7 +123,7 @@ async def test_all_success(acquire, use, release, final_result, log):
assert pipeline_logs == log
-@pytest.mark.anyio()
+@pytest.mark.anyio
async def test_full_typing():
"""This test is here to be a case for typing."""
logs: List[Tuple[str, Result[str, str]]] = []
diff --git a/tests/test_pipeline/test_managed/test_managed_reader_future_result.py b/tests/test_pipeline/test_managed/test_managed_reader_future_result.py
index 493a944f9..d1d883693 100644
--- a/tests/test_pipeline/test_managed/test_managed_reader_future_result.py
+++ b/tests/test_pipeline/test_managed/test_managed_reader_future_result.py
@@ -49,7 +49,7 @@ def __call__(
return ReaderFutureResult.from_failure('release failure')
-@pytest.mark.anyio()
+@pytest.mark.anyio
@pytest.mark.parametrize(('acquire', 'use', 'release', 'final_result', 'log'), [
# Acquire success:
(
@@ -123,7 +123,7 @@ async def test_all_success(acquire, use, release, final_result, log):
assert pipeline_logs == log
-@pytest.mark.anyio()
+@pytest.mark.anyio
async def test_full_typing():
"""This test is here to be a case for typing."""
logs: List[Tuple[str, Result[str, str]]] = []