Skip to content

Commit 11a04d8

Browse files
committed
Initial rename to returns
1 parent 38e297b commit 11a04d8

40 files changed

+125
-114
lines changed

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ install:
1717
- poetry install
1818

1919
script:
20-
- poetry run flake8 dry_monads tests docs
21-
- poetry run mypy dry_monads tests/**/*.py
20+
- poetry run flake8 returns tests docs
21+
- poetry run mypy returns tests/**/*.py
2222
- poetry run pytest
2323
- poetry run doc8 -q docs
2424
- poetry check

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
We follow Semantic Versions since the `0.1.0` release.
44

5+
## Version 0.3.0, Renamed to `returns`
6+
7+
The project is renamed to `returns` and moved to `dry-python` org.
8+
9+
### Features
10+
11+
- Adds `.pyi` files for all modules,
12+
to enable `mypy` support for 3rd party users
13+
14+
515
## Version 0.2.0
616

717
### Features

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pytest
4040
To run linting:
4141

4242
```bash
43-
flake8 dry_monads tests docs
43+
flake8 returns tests docs
4444
```
4545

4646
These steps are mandatory during the CI.
@@ -52,7 +52,7 @@ We use `mypy` to run type checks on our code.
5252
To use it:
5353

5454
```bash
55-
mypy dry_monads
55+
mypy returns
5656
```
5757

5858
This step is mandatory during the CI.

README.md

+13-12
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
# dry-monads
1+
# returns
22

3-
[![wemake.services](https://img.shields.io/badge/%20-wemake.services-green.svg?label=%20&logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC%2FxhBQAAAAFzUkdCAK7OHOkAAAAbUExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP%2F%2F%2F5TvxDIAAAAIdFJOUwAjRA8xXANAL%2Bv0SAAAADNJREFUGNNjYCAIOJjRBdBFWMkVQeGzcHAwksJnAPPZGOGAASzPzAEHEGVsLExQwE7YswCb7AFZSF3bbAAAAABJRU5ErkJggg%3D%3D)](https://wemake.services) [![Build Status](https://travis-ci.org/sobolevn/dry-monads.svg?branch=master)](https://travis-ci.org/sobolevn/dry-monads) [![Coverage Status](https://coveralls.io/repos/github/sobolevn/dry-monads/badge.svg?branch=master)](https://coveralls.io/github/sobolevn/dry-monads?branch=master) [![Documentation Status](https://readthedocs.org/projects/dry-monads/badge/?version=latest)](https://dry-monads.readthedocs.io/en/latest/?badge=latest) [![Python Version](https://img.shields.io/pypi/pyversions/dry-monads.svg)](https://pypi.org/project/dry-monads/) [![wemake-python-styleguide](https://img.shields.io/badge/style-wemake-000000.svg)](https://github.com/wemake-services/wemake-python-styleguide)
3+
[![wemake.services](https://img.shields.io/badge/%20-wemake.services-green.svg?label=%20&logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC%2FxhBQAAAAFzUkdCAK7OHOkAAAAbUExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP%2F%2F%2F5TvxDIAAAAIdFJOUwAjRA8xXANAL%2Bv0SAAAADNJREFUGNNjYCAIOJjRBdBFWMkVQeGzcHAwksJnAPPZGOGAASzPzAEHEGVsLExQwE7YswCb7AFZSF3bbAAAAABJRU5ErkJggg%3D%3D)](https://wemake.services) [![Build Status](https://travis-ci.org/dry-python/returns.svg?branch=master)](https://travis-ci.org/dry-python/returns) [![Coverage Status](https://coveralls.io/repos/github/dry-python/returns/badge.svg?branch=master)](https://coveralls.io/github/dry-python/returns?branch=master) [![Documentation Status](https://readthedocs.org/projects/returns/badge/?version=latest)](https://returns.readthedocs.io/en/latest/?badge=latest) [![Python Version](https://img.shields.io/pypi/pyversions/returns.svg)](https://pypi.org/project/returns/) [![wemake-python-styleguide](https://img.shields.io/badge/style-wemake-000000.svg)](https://github.com/wemake-services/wemake-python-styleguide)
44

55

6-
Monads for `python` made simple and safe.
6+
Make your functions return something meaningful and safe!and safe.
77

88

99
## Features
1010

1111
- Provides primitives to write declarative business logic
1212
- Fully typed with annotations and checked with `mypy`,
1313
allowing you to write type-safe code as well
14-
- No operator overloading or other unpythonic stuff that makes your eyes bleed
14+
- Pythonic and pleasant to write and to read (!)
1515

1616

1717
## Installation
1818

1919

2020
```bash
21-
pip install dry-monads
21+
pip install returns
2222
```
2323

2424

2525
## What's inside?
2626

2727
We have several the most iconic monads inside:
2828

29-
- [Result, Failure, and Success](https://dry-monads.readthedocs.io/en/latest/pages/either.html) (also known as `Either`, `Left`, and `Right`)
30-
- [Maybe, Some, and Nothing](https://dry-monads.readthedocs.io/en/latest/pages/maybe.html)
29+
- [Result, Failure, and Success](https://returns.readthedocs.io/en/latest/pages/either.html) (also known as `Either`, `Left`, and `Right`)
30+
- [Maybe, Some, and Nothing](https://returns.readthedocs.io/en/latest/pages/maybe.html)
3131

3232
We also care about code readability and developer experience,
3333
so we have included some useful features to make your life easier:
3434

35-
- [Do notation](https://dry-monads.readthedocs.io/en/latest/pages/do-notation.html)
36-
- [Helper functions](https://dry-monads.readthedocs.io/en/latest/pages/functions.html)
35+
- [Do notation](https://returns.readthedocs.io/en/latest/pages/do-notation.html)
36+
- [Helper functions](https://returns.readthedocs.io/en/latest/pages/functions.html)
3737

3838

3939
## Example
4040

4141

4242
```python
43-
from dry_monads.do_notation import do_notation
44-
from dry_monads.either import Result, Success, Failure
43+
from returns.do_notation import do_notation
44+
from returns.either import Result, Success, Failure
4545

4646
class CreateAccountAndUser(object):
4747
"""Creates new Account-User pair."""
@@ -58,7 +58,8 @@ class CreateAccountAndUser(object):
5858

5959
```
6060

61-
We are [covering what's going on in this example](https://dry-monads.readthedocs.io/en/latest/pages/do-notation.html) in the docs.
61+
We are [covering what's going on in this example](https://returns.readthedocs.io/en/latest/pages/do-notation.html) in the docs.
62+
6263

6364
## Inspirations
6465

docs/_templates/moreinfo.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ <h3>
33
</h3>
44
<ul>
55
<li>
6-
<a href="https://github.com/sobolevn/dry-monads">GitHub</a>
6+
<a href="https://github.com/dry-python/returns">GitHub</a>
77
</li>
88
<li>
9-
<a href="https://pypi.python.org/pypi/dry-monads">PyPI</a>
9+
<a href="https://pypi.python.org/pypi/returns">PyPI</a>
1010
</li>
1111
<li>
12-
<a href="https://travis-ci.org/sobolevn/dry-monads">Travis CI</a>
12+
<a href="https://travis-ci.org/dry-python/returns">Travis CI</a>
1313
</li>
1414
<li>
15-
<a href="https://coveralls.io/github/sobolevn/dry-monads?branch=master">Coverage</a>
15+
<a href="https://coveralls.io/github/dry-python/returns?branch=master">Coverage</a>
1616
</li>
1717
</ul>

docs/conf.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ def _get_project_meta():
118118
# further. For a list of options available for each theme, see the
119119
# documentation.
120120
html_theme_options = {
121-
'logo_name': 'dry-monads',
121+
'logo_name': 'returns',
122122
'description': 'Monads for python made simple and safe',
123-
'github_user': 'sobolevn',
124-
'github_repo': 'dry-monads',
123+
'github_user': 'dry-python',
124+
'github_repo': 'returns',
125125
}
126126

127127
# Add any paths that contain custom static files (such as style sheets) here,

docs/pages/do-notation.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ Here's the code to illustrate the task.
2525

2626
.. code:: python
2727
28-
from dry_monads.do_notation import do_notation
29-
from dry_monads.either import Result, Success, Failure
28+
from returns.do_notation import do_notation
29+
from returns.either import Result, Success, Failure
3030
3131
3232
class CreateAccountAndUser(object):
@@ -130,7 +130,7 @@ And at the same time the produced code is simple and readable.
130130
And that's it!
131131

132132
See also:
133-
- https://dry-rb.org/gems/dry-monads/do-notation/
133+
- https://dry-rb.org/gems/returns/do-notation/
134134
- https://en.wikibooks.org/wiki/Haskell/do_notation
135135
- https://wiki.haskell.org/Do_notation_considered_harmful
136136

@@ -143,16 +143,16 @@ due to `mypy issue <https://github.com/python/mypy/issues/3157>`_:
143143

144144
.. code:: python
145145
146-
from dry_monads.do_notation import do_notation
147-
from dry_monads.either import Success
146+
from returns.do_notation import do_notation
147+
from returns.either import Success
148148
149149
@do_notation
150150
def function(param: int) -> Success[int]:
151151
return Success(param)
152152
153153
reveal_type(function)
154-
# Actual => def (*Any, **Any) -> dry_monads.either.Right*[builtins.int]
155-
# Expected => def (int) -> dry_monads.either.Right*[builtins.int]
154+
# Actual => def (*Any, **Any) -> returns.either.Right*[builtins.int]
155+
# Expected => def (int) -> returns.either.Right*[builtins.int]
156156
157157
This effect can be reduced with the help of `Design by Contract <https://en.wikipedia.org/wiki/Design_by_contract>`_
158158
with these implementations:
@@ -164,5 +164,5 @@ with these implementations:
164164
API Reference
165165
-------------
166166

167-
.. automodule:: dry_monads.do_notation
167+
.. automodule:: returns.do_notation
168168
:members:

docs/pages/either.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ and ``Failure`` indicates that something has failed.
1313

1414
.. code:: python
1515
16-
from dry_monads.either import Result, Success, Failure
16+
from returns.either import Result, Success, Failure
1717
1818
def find_user(user_id: int) -> Either['User', str]:
1919
user = User.objects.filter(id=user_id)
@@ -36,7 +36,7 @@ and other ``None`` exception-friends.
3636
API Reference
3737
-------------
3838

39-
.. autoclasstree:: dry_monads.either
39+
.. autoclasstree:: returns.either
4040

41-
.. automodule:: dry_monads.either
41+
.. automodule:: returns.either
4242
:members:

docs/pages/functions.rst

+10-10
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ We feature several helper functions to make your developer experience better.
66
is_successful
77
-------------
88

9-
:func:`is_succesful <dry_monads.functions.is_successful>` is used to
9+
:func:`is_succesful <returns.functions.is_successful>` is used to
1010
tell whether or not your monad is a success.
1111
We treat only treat monads that does not throw as a successful ones,
12-
basically: :class:`Right <dry_monads.either.Right>`
13-
and :class:`Some <dry_monads.maybe.Some>`.
12+
basically: :class:`Right <returns.either.Right>`
13+
and :class:`Some <returns.maybe.Some>`.
1414

1515
.. code:: python
1616
17-
from dry_monads.either import Success, Failure
18-
from dry_monads.functions import is_successful
19-
from dry_monads.maybe import Some, Nothing
17+
from returns.either import Success, Failure
18+
from returns.functions import is_successful
19+
from returns.maybe import Some, Nothing
2020
2121
is_successful(Some(1)) and is_successful(Success(1))
2222
# => True
@@ -27,13 +27,13 @@ and :class:`Some <dry_monads.maybe.Some>`.
2727
safe
2828
----
2929

30-
:func:`safe <dry_monads.functions.safe>` is used to convert
30+
:func:`safe <returns.functions.safe>` is used to convert
3131
regular functions that can throw exceptions to functions
32-
that return :class:`Either <dry_monads.either.Either>` monad.
32+
that return :class:`Either <returns.either.Either>` monad.
3333

3434
.. code:: python
3535
36-
from dry_monads.functions import safe
36+
from returns.functions import safe
3737
3838
@safe
3939
def divide(number: int) -> float:
@@ -48,5 +48,5 @@ that return :class:`Either <dry_monads.either.Either>` monad.
4848
API Reference
4949
-------------
5050

51-
.. automodule:: dry_monads.functions
51+
.. automodule:: returns.functions
5252
:members:

docs/pages/maybe.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ based on just a single value:
1313

1414
.. code:: python
1515
16-
from dry_monads.maybe import Maybe
16+
from returns.maybe import Maybe
1717
1818
Maybe.new(1)
1919
# => Some(1)
@@ -56,7 +56,7 @@ It might be very useful for complex operations like the following one:
5656
API Reference
5757
-------------
5858

59-
.. autoclasstree:: dry_monads.maybe
59+
.. autoclasstree:: returns.maybe
6060

61-
.. automodule:: dry_monads.maybe
61+
.. automodule:: returns.maybe
6262
:members:

0 commit comments

Comments
 (0)