Skip to content

Commit 9f5da81

Browse files
authored
Add support for Python 3.11 (rustedpy#107)
* Add support for Python 3.11 * Address new behaviour from latest version of mypy * Revert change to require typing_extensions for python 3.10 * Add PR reference
1 parent f0e6f11 commit 9f5da81

File tree

6 files changed

+9
-7
lines changed

6 files changed

+9
-7
lines changed

.github/workflows/ci.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
strategy:
1515
matrix:
1616
python:
17+
- '3.11'
1718
- '3.10'
1819
- '3.9'
1920
- '3.8'
@@ -47,7 +48,7 @@ jobs:
4748
- name: Run tests
4849
run: pytest --ignore=tests/test_pattern_matching.py
4950
- name: Run tests (pattern matching)
50-
if: matrix.python == '3.10'
51+
if: matrix.python == '3.10' || matrix.python == '3.11'
5152
run: pytest tests/test_pattern_matching.py
5253

5354
# Linters

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Possible log types:
1414
## [Unreleased]
1515

1616
- `[added]` Implement `unwrap_or_raise` (#95)
17+
- `[added]` Add support for Python 3.11 (#107)
1718

1819
## [0.8.0] - 2022-04-17
1920

pyproject.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["setuptools", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[tool.mypy]
6-
python_version = "3.10"
6+
python_version = "3.11"
77
files = [
88
"src",
99
"tests",
@@ -24,7 +24,6 @@ no_implicit_reexport = true
2424
show_column_numbers = true
2525
show_error_codes = true
2626
show_error_context = true
27-
show_none_errors = true
2827
strict_equality = true
2928
strict_optional = true
3029
warn_redundant_casts = true

setup.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ classifiers =
1818
Programming Language :: Python :: 3.8
1919
Programming Language :: Python :: 3.9
2020
Programming Language :: Python :: 3.10
21+
Programming Language :: Python :: 3.11
2122
Programming Language :: Python :: 3 :: Only
2223

2324
[options]

tests/type-checking/test_result.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@
4848
4949
ok_int: Ok[int] = Ok(42)
5050
ok_float: Ok[float] = ok_int
51-
ok_int = ok_float # E: Incompatible types in assignment (expression has type "Ok[float]", variable has type "Ok[int]")
51+
ok_int = ok_float # E: Incompatible types in assignment (expression has type "Ok[float]", variable has type "Ok[int]") [assignment]
5252
5353
err_type: Err[TypeError] = Err(TypeError("foo"))
5454
err_exc: Err[Exception] = err_type
55-
err_type = err_exc # E: Incompatible types in assignment (expression has type "Err[Exception]", variable has type "Err[TypeError]")
55+
err_type = err_exc # E: Incompatible types in assignment (expression has type "Err[Exception]", variable has type "Err[TypeError]") [assignment]
5656
5757
result_int_type: Result[int, TypeError] = ok_int or err_type
5858
result_float_exc: Result[float, Exception] = result_int_type
59-
result_int_type = result_float_exc # E: Incompatible types in assignment (expression has type "Union[Ok[float], Err[Exception]]", variable has type "Union[Ok[int], Err[TypeError]]")
59+
result_int_type = result_float_exc # E: Incompatible types in assignment (expression has type "Union[Ok[float], Err[Exception]]", variable has type "Union[Ok[int], Err[TypeError]]") [assignment]

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py310,py39,py38,py37
2+
envlist = py311,py310,py39,py38,py37
33

44
[testenv]
55
deps = -rrequirements-dev.txt

0 commit comments

Comments
 (0)