Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(python): support for 3.13 #195

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
strategy:
matrix:
python:
- '3.13'
- '3.12'
- '3.11'
- '3.10'
Expand Down Expand Up @@ -53,7 +54,7 @@ jobs:
# one for > 3.9)
run: pytest tests/type_checking/test_result.yml
- name: Run tests (pattern matching)
if: matrix.python == '3.10' || matrix.python == '3.11' || matrix.python == '3.12'
if: matrix.python == '3.10' || matrix.python == '3.11' || matrix.python == '3.12' || matrix.python == '3.13'
run: pytest tests/test_pattern_matching.py

# Linters
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ Possible log types:

## [Unreleased]


- `[changed]` Improve type narrowing for `is_ok` and `is_err` type guards by
replacing `typing.TypeGuard` with `typing.TypeIs` (#193)
- `[added]` Add support for Python 3.13 (#181)

## [0.17.0] - 2024-06-02

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[tool.mypy]
python_version = "3.12"
python_version = "3.13"
files = [
"src",
"tests",
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ classifiers =
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Programming Language :: Python :: 3 :: Only

[options]
Expand Down
7 changes: 5 additions & 2 deletions src/result/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@
Union,
)

from typing_extensions import TypeIs

if sys.version_info >= (3, 10):
from typing import ParamSpec, TypeAlias
else:
from typing_extensions import ParamSpec, TypeAlias

if sys.version_info >= (3, 13):
from typing import TypeIs
else:
from typing_extensions import TypeIs


T = TypeVar("T", covariant=True) # Success type
E = TypeVar("E", covariant=True) # Error type
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py312,py311,py310,py39,py38
envlist = py313,py312,py311,py310,py39,py38

[testenv]
deps = -rrequirements-dev.txt
Expand Down
Loading