Skip to content

Commit

Permalink
feat(python): support for 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
kreathon committed Aug 19, 2024
1 parent 0b855e1 commit 0d6b4da
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
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,6 +13,8 @@ Possible log types:

## [Unreleased]


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

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

0 comments on commit 0d6b4da

Please sign in to comment.