Skip to content

Commit 28f14f8

Browse files
authored
Drop python3.9, m2r2, use myst-parser (#1971)
1 parent 0602e5e commit 28f14f8

File tree

19 files changed

+146
-269
lines changed

19 files changed

+146
-269
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
python-version: ['3.9', '3.10', '3.11', '3.12']
23+
python-version: ['3.10', '3.11', '3.12', '3.13']
2424

2525
steps:
2626
- uses: actions/checkout@v4
@@ -56,7 +56,6 @@ jobs:
5656
# Different python versions are covered differently:
5757
poetry run pytest returns docs/pages tests
5858
59-
poetry run doc8 -q docs
6059
poetry run codespell returns tests docs typesafety README.md CONTRIBUTING.md CHANGELOG.md
6160
6261
poetry run poetry check

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,19 @@ incremental in minor, bugfixes only are patches.
66
See [0Ver](https://0ver.org/).
77

88

9-
## 0.24.0 WIP
9+
## 0.24.0
1010

1111
### Features
1212

13+
- Drop `python3.9` support
14+
- Add `python3.13` support
15+
- Add support for `mypy>=1.12`
1316
- Add picky exceptions to `future_safe` decorator like `safe` has.
1417
- Improve inference of `ResultLike` objects when exception catching
1518
decorator is applied with explicit exception types
1619
- Add picky exceptions to `impure_safe` decorator like `safe` has. Issue #1543
1720
- Add partition function to result module. Issue #1905
18-
- Adds `default_error` parameter to `returns.converters.maybe_to_result`,
21+
- Add `default_error` parameter to `returns.converters.maybe_to_result`,
1922
which provides a default error value for `Failure`
2023

2124

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ Before submitting your code please do the following steps:
117117
6. Run `pytest` again to make sure it is still working
118118
7. Run `mypy` to ensure that types are correct
119119
8. Run `flake8` to ensure that style is correct
120-
9. Run `doc8` to ensure that docs are correct
121-
10. Run `slotscheck` to ensure that slots are correct
120+
9. Run `slotscheck` to ensure that slots are correct
122121

123122

124123
## Other help

docs/conf.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def _get_project_meta():
5151
'sphinx.ext.napoleon',
5252

5353
# Used to include .md files:
54-
'm2r2',
54+
'myst_parser',
5555

5656
# Used to insert typehints into the final docs:
5757
'sphinx_autodoc_typehints',
@@ -71,6 +71,11 @@ def _get_project_meta():
7171
'show-inheritance': True,
7272
}
7373

74+
suppress_warnings = [
75+
'myst.header',
76+
'myst.xref_missing',
77+
]
78+
7479
# https://pypi.org/project/sphinx-autodoc-typehints/
7580
always_document_param_types = True
7681

docs/index.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
.. mdinclude:: ../README.md
1+
returns
2+
=======
3+
4+
.. include:: ../README.md
5+
:parser: myst_parser.sphinx_
26

37
Contents
48
--------

docs/pages/changelog.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.. mdinclude:: ../../CHANGELOG.md
1+
.. include:: ../../CHANGELOG.md
2+
:parser: myst_parser.sphinx_

poetry.lock

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

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ _ = "returns.contrib.hypothesis._entrypoint:_setup_hook"
4646

4747

4848
[tool.poetry.dependencies]
49-
python = "^3.9"
49+
python = "^3.10"
5050

5151
typing-extensions = ">=4.0,<5.0"
5252
pytest = { version = "^8.0", optional = true }
@@ -72,7 +72,6 @@ pytest-mypy-plugins = "^3.1"
7272
pytest-subtests = "^0.13"
7373
pytest-shard = "^0.1"
7474

75-
doc8 = "^1.1"
7675

7776
[tool.poetry.group.docs]
7877
optional = true
@@ -83,7 +82,7 @@ sphinx = "^7.3"
8382
sphinx-autodoc-typehints = "^2.3"
8483
sphinxcontrib-mermaid = "^1.0"
8584
furo = "^2024.5"
86-
m2r2 = "^0.3"
85+
myst-parser = "^4.0"
8786
tomli = "^2.0"
8887

8988
[tool.poetry.extras]

setup.cfg

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -203,14 +203,6 @@ disallow_subclassing_any = False
203203
disallow_subclassing_any = False
204204

205205

206-
[doc8]
207-
# doc8 configuration: https://pypi.org/project/doc8/
208-
ignore-path = docs/_build
209-
max-line-length = 80
210-
sphinx = True
211-
ignore-path-errors=docs/pages/railway.rst;D000
212-
213-
214206
[codespell]
215207
# codespell configuration: https://pypi.org/project/codespell
216208
ignore-words-list = appliable,falsy

tests/conftest.py

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

typesafety/test_curry/test_curry/test_curry_arguments.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
- case: curry_pos_only_args
22
disable_cache: false
3-
skip: sys.version_info[:2] < (3, 8)
43
main: |
54
from returns.curry import curry
65

typesafety/test_curry/test_partial/test_partial_arguments.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
5454
- case: partial_pos_only_args
5555
disable_cache: false
56-
skip: sys.version_info[:2] < (3, 8)
5756
main: |
5857
from returns.curry import partial
5958

typesafety/test_curry/test_partial/test_partial_generic.yml

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -79,46 +79,9 @@
7979
main:22: note: Revealed type is "builtins.int"
8080
8181
82-
- case: partial_double_generic_complex37
83-
disable_cache: false
84-
skip: sys.version_info[:2] >= (3, 8)
85-
main: |
86-
from returns.curry import partial
87-
from typing import List, TypeVar, Union
88-
89-
A = TypeVar('A')
90-
B = TypeVar('B')
91-
92-
def multiple(
93-
a: int,
94-
*,
95-
b: List[B],
96-
c: List[A],
97-
) -> Union[A, B]:
98-
...
99-
100-
x: List[int]
101-
y: List[str]
102-
103-
reveal_type(partial(multiple))
104-
reveal_type(partial(multiple, 1))
105-
reveal_type(partial(multiple, 1, b=x))
106-
reveal_type(partial(multiple, 1, c=x))
107-
reveal_type(partial(multiple, 1, b=y))
108-
reveal_type(partial(multiple, 1, c=y))
109-
out: |
110-
main:18: note: Revealed type is "def [B, A] (a: builtins.int, *, b: builtins.list[B`-1], c: builtins.list[A`-2]) -> Union[A`-2, B`-1]"
111-
main:19: note: Revealed type is "def [B, A] (*, b: builtins.list[B`-1], c: builtins.list[A`-2]) -> Union[A`-2, B`-1]"
112-
main:20: note: Revealed type is "def [A] (*, c: builtins.list[A`-2]) -> Union[A`-2, builtins.int]"
113-
main:21: note: Revealed type is "def [B] (*, b: builtins.list[B`-1]) -> Union[builtins.int, B`-1]"
114-
main:22: note: Revealed type is "def [A] (*, c: builtins.list[A`-2]) -> Union[A`-2, builtins.str]"
115-
main:23: note: Revealed type is "def [B] (*, b: builtins.list[B`-1]) -> Union[builtins.str, B`-1]"
116-
117-
11882
# Python3.8+ sorts generic arguments differently:
11983
- case: partial_double_generic_complex38
12084
disable_cache: false
121-
skip: sys.version_info[:2] < (3, 8)
12285
main: |
12386
from returns.curry import partial
12487
from typing import List, TypeVar, Union

typesafety/test_future/test_future_container/test_do.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
- case: do_sync_error
2-
skip: sys.version_info[:2] < (3, 8)
32
disable_cache: false
43
main: |
54
from returns.future import Future
@@ -27,7 +26,6 @@
2726
2827
2928
- case: do_with_if
30-
skip: sys.version_info[:2] < (3, 8)
3129
disable_cache: false
3230
main: |
3331
from returns.future import Future

typesafety/test_future/test_future_result_container/test_do.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
- case: do_sync_error
2-
skip: sys.version_info[:2] < (3, 8)
32
disable_cache: false
43
main: |
54
from returns.future import FutureResult, FutureSuccess
@@ -81,7 +80,6 @@
8180
8281
8382
- case: do_with_if
84-
skip: sys.version_info[:2] < (3, 8)
8583
disable_cache: false
8684
main: |
8785
from returns.future import FutureSuccess, FutureResult

typesafety/test_io/test_io_container/test_do.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
1313
1414
- case: do_with_if
15-
skip: sys.version_info[:2] < (3, 8)
1615
disable_cache: false
1716
main: |
1817
from returns.io import IO

typesafety/test_io/test_ioresult_container/test_do.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
6767
6868
- case: do_with_if
69-
skip: sys.version_info[:2] < (3, 8)
7069
disable_cache: false
7170
main: |
7271
from returns.io import IOSuccess, IOResult

typesafety/test_maybe/test_do.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
4141
4242
- case: do_with_if
43-
skip: sys.version_info[:2] < (3, 8)
4443
disable_cache: false
4544
main: |
4645
from returns.maybe import Maybe

typesafety/test_result/test_do.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
5252
5353
- case: do_with_if
54-
skip: sys.version_info[:2] < (3, 8)
5554
disable_cache: false
5655
main: |
5756
from returns.result import Success, Result

0 commit comments

Comments
 (0)