Skip to content

Commit b3a3967

Browse files
authored
Version 0.23.0 (#1854)
1 parent efc1d24 commit b3a3967

26 files changed

+196
-242
lines changed

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You can set these variables from the command line.
55
SPHINXOPTS =
66
SPHINXBUILD = sphinx-build
7-
SPHINXPROJ = dotenv-linter
7+
SPHINXPROJ = returns
88
SOURCEDIR = .
99
BUILDDIR = _build
1010

docs/_templates/layout.html

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/_templates/moreinfo.html

Lines changed: 0 additions & 17 deletions
This file was deleted.

docs/conf.py

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,16 @@
1313
import os
1414
import sys
1515

16+
import tomli
17+
1618
sys.path.insert(0, os.path.abspath('..'))
1719

1820

1921
# -- Project information -----------------------------------------------------
2022

21-
def _get_project_meta() -> str:
22-
import tomlkit # noqa: WPS433
23-
24-
with open('../pyproject.toml') as pyproject:
25-
file_contents = pyproject.read()
26-
27-
return tomlkit.parse(file_contents)['tool']['poetry']
23+
def _get_project_meta():
24+
with open('../pyproject.toml', mode='rb') as pyproject:
25+
return tomli.load(pyproject)['tool']['poetry']
2826

2927

3028
pkg_meta = _get_project_meta()
@@ -60,9 +58,6 @@ def _get_project_meta() -> str:
6058

6159
# Used to build graphs:
6260
'sphinxcontrib.mermaid',
63-
64-
# Used to generate tooltips for our references:
65-
'hoverxref.extension',
6661
]
6762

6863
autoclass_content = 'class'
@@ -79,10 +74,6 @@ def _get_project_meta() -> str:
7974
# https://pypi.org/project/sphinx-autodoc-typehints/
8075
always_document_param_types = True
8176

82-
# See https://sphinx-hoverxref.readthedocs.io/en/latest/configuration.html
83-
hoverxref_auto_ref = True
84-
hoverxref_domains = ['py']
85-
8677
# Add any paths that contain templates here, relative to this directory.
8778
templates_path = ['_templates']
8879

@@ -116,20 +107,12 @@ def _get_project_meta() -> str:
116107

117108
# The theme to use for HTML and HTML Help pages. See the documentation for
118109
# a list of builtin themes.
119-
html_theme = 'sphinx_typlog_theme'
110+
html_theme = 'furo'
120111

121112
# Theme options are theme-specific and customize the look and feel of a theme
122113
# further. For a list of options available for each theme, see the
123114
# documentation.
124-
html_theme_options = {
125-
'logo_name': 'returns',
126-
'description': (
127-
'Make your functions return something meaningful, typed, and safe!'
128-
),
129-
'github_user': 'dry-python',
130-
'github_repo': 'returns',
131-
'color': '#E8371A',
132-
}
115+
html_theme_options = {}
133116

134117
# Add any paths that contain custom static files (such as style sheets) here,
135118
# relative to this directory. They are copied after the builtin static files,
@@ -138,15 +121,7 @@ def _get_project_meta() -> str:
138121

139122
# Custom sidebar templates, must be a dictionary that maps document names
140123
# to template names.
141-
html_sidebars = {
142-
'**': [
143-
'logo.html',
144-
'globaltoc.html',
145-
'github.html',
146-
'searchbox.html',
147-
'moreinfo.html',
148-
],
149-
}
124+
html_sidebars = {}
150125

151126

152127
# -- Extension configuration -------------------------------------------------

docs/pages/container.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ And we can see how this state is evolving during the execution.
4242
.. mermaid::
4343
:caption: State evolution.
4444

45-
graph LR
46-
F1["Container(Initial)"] --> F2["Container(UserId(1))"]
47-
F2 --> F3["Container(UserAccount(156))"]
48-
F3 --> F4["Container(FailedLoginAttempt(1))"]
49-
F4 --> F5["Container(SentNotificationId(992))"]
45+
graph LR
46+
F1["Container(Initial)"] --> F2["Container(UserId(1))"]
47+
F2 --> F3["Container(UserAccount(156))"]
48+
F3 --> F4["Container(FailedLoginAttempt(1))"]
49+
F4 --> F5["Container(SentNotificationId(992))"]
5050

5151

5252
Working with a container
@@ -68,11 +68,11 @@ Here's how it looks:
6868
.. mermaid::
6969
:caption: Illustration of ``map`` method.
7070

71-
graph LR
72-
F1["Container[A]"] -- "map(function)" --> F2["Container[B]"]
71+
graph LR
72+
F1["Container[A]"] -- "map(function)" --> F2["Container[B]"]
7373

74-
style F1 fill:green
75-
style F2 fill:green
74+
style F1 fill:green
75+
style F2 fill:green
7676

7777
.. code:: python
7878
@@ -108,13 +108,13 @@ Here's how it looks:
108108
.. mermaid::
109109
:caption: Illustration of ``bind`` method.
110110

111-
graph LR
112-
F1["Container[A]"] -- "bind(function)" --> F2["Container[B]"]
113-
F1["Container[A]"] -- "bind(function)" --> F3["Container[C]"]
111+
graph LR
112+
F1["Container[A]"] -- "bind(function)" --> F2["Container[B]"]
113+
F1["Container[A]"] -- "bind(function)" --> F3["Container[C]"]
114114

115-
style F1 fill:green
116-
style F2 fill:green
117-
style F3 fill:red
115+
style F1 fill:green
116+
style F2 fill:green
117+
style F3 fill:red
118118

119119
.. code:: python
120120

docs/pages/context.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,12 @@ There's how execution flows:
246246
.. mermaid::
247247
:caption: RequiresContext execution flow.
248248

249-
graph LR
250-
F1["first(1)"] --> F2["RequiresContext(inner)"]
251-
F2 --> F3
252-
F3["container('abc')"] --> F4["True"]
253-
F4 --> F5
254-
F5["bool_to_str(True)"] --> F6["'ok'"]
249+
graph LR
250+
F1["first(1)"] --> F2["RequiresContext(inner)"]
251+
F2 --> F3
252+
F3["container('abc')"] --> F4["True"]
253+
F4 --> F5
254+
F5["bool_to_str(True)"] --> F6["'ok'"]
255255

256256
The rule is: the dependencies are injected at the very last moment in time.
257257
And then normal logical execution happens.

docs/pages/contrib/mypy_plugins.rst

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -91,64 +91,46 @@ Plugin definition
9191
~~~~~~~~~~~~~~~~~
9292

9393
.. automodule:: returns.contrib.mypy._consts
94-
:members:
94+
:members:
9595

9696
.. autoclasstree:: returns.contrib.mypy.returns_plugin
97-
:strict:
97+
:strict:
9898

9999
.. automodule:: returns.contrib.mypy.returns_plugin
100-
:members:
100+
:members:
101101

102102
Kind
103103
~~~~
104104

105-
.. autoclasstree:: returns.contrib.mypy._features.kind
106-
:strict:
107-
108105
.. automodule:: returns.contrib.mypy._features.kind
109-
:members:
106+
:members:
110107

111108
Curry
112109
~~~~~
113110

114-
.. autoclasstree:: returns.contrib.mypy._features.curry
115-
:strict:
116-
117111
.. automodule:: returns.contrib.mypy._features.curry
118-
:members:
112+
:members:
119113

120114
Partial
121115
~~~~~~~
122116

123-
.. autoclasstree:: returns.contrib.mypy._features.partial
124-
:strict:
125-
126117
.. automodule:: returns.contrib.mypy._features.partial
127-
:members:
118+
:members:
128119

129120
Flow
130121
~~~~
131122

132-
.. autoclasstree:: returns.contrib.mypy._features.flow
133-
:strict:
134-
135123
.. automodule:: returns.contrib.mypy._features.flow
136-
:members:
124+
:members:
137125

138126
Pipe
139127
~~~~
140128

141-
.. autoclasstree:: returns.contrib.mypy._features.pipe
142-
:strict:
143-
144129
.. automodule:: returns.contrib.mypy._features.pipe
145-
:members:
130+
:members:
146131

147132
Do notation
148133
~~~~~~~~~~~
149134

150-
.. autoclasstree:: returns.contrib.mypy._features.do_notation
151-
:strict:
152-
153135
.. automodule:: returns.contrib.mypy._features.do_notation
154-
:members:
136+
:members:

docs/pages/railway.rst

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,27 @@ or we can fix the situation.
2828
.. mermaid::
2929
:caption: Railway oriented programming.
3030

31-
graph LR
32-
S1 -- bind --> S3
33-
S1 -- bind --> F2
34-
S3 -- map --> S5
35-
S5 -- bind --> S7
36-
S5 -- bind --> F6
37-
38-
F2 -- alt --> F4
39-
F4 -- lash --> F6
40-
F4 -- lash --> S5
41-
F6 -- lash --> F8
42-
F6 -- lash --> S7
43-
44-
style S1 fill:green
45-
style S3 fill:green
46-
style S5 fill:green
47-
style S7 fill:green
48-
style F2 fill:red
49-
style F4 fill:red
50-
style F6 fill:red
51-
style F8 fill:red
31+
graph LR
32+
S1 -- bind --> S3
33+
S1 -- bind --> F2
34+
S3 -- map --> S5
35+
S5 -- bind --> S7
36+
S5 -- bind --> F6
37+
38+
F2 -- alt --> F4
39+
F4 -- lash --> F6
40+
F4 -- lash --> S5
41+
F6 -- lash --> F8
42+
F6 -- lash --> S7
43+
44+
style S1 fill:green
45+
style S3 fill:green
46+
style S5 fill:green
47+
style S7 fill:green
48+
style F2 fill:red
49+
style F4 fill:red
50+
style F6 fill:red
51+
style F8 fill:red
5252

5353
Returning execution to the right track
5454
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -69,11 +69,11 @@ Let's start from the first one:
6969
.. mermaid::
7070
:caption: Illustration of ``alt`` method.
7171

72-
graph LR
73-
F1["Container[A]"] -- "alt(function)" --> F2["Container[B]"]
72+
graph LR
73+
F1["Container[A]"] -- "alt(function)" --> F2["Container[B]"]
7474

75-
style F1 fill:red
76-
style F2 fill:red
75+
style F1 fill:red
76+
style F2 fill:red
7777

7878
.. code:: python
7979
@@ -89,13 +89,13 @@ It can also lash your flow and get on the successful track again:
8989
.. mermaid::
9090
:caption: Illustration of ``lash`` method.
9191

92-
graph LR
93-
F1["Container[A]"] -- "lash(function)" --> F2["Container[B]"]
94-
F1["Container[A]"] -- "lash(function)" --> F3["Container[C]"]
92+
graph LR
93+
F1["Container[A]"] -- "lash(function)" --> F2["Container[B]"]
94+
F1["Container[A]"] -- "lash(function)" --> F3["Container[C]"]
9595

96-
style F1 fill:red
97-
style F2 fill:green
98-
style F3 fill:red
96+
style F1 fill:red
97+
style F2 fill:green
98+
style F3 fill:red
9999

100100
.. code:: python
101101

0 commit comments

Comments
 (0)