From 33a0f3bd3bb42ff6e88e9e9d6a73b7f210a493d5 Mon Sep 17 00:00:00 2001 From: nocarryr Date: Sun, 23 Jun 2024 17:19:55 -0500 Subject: [PATCH] Use typing-extensions for Py<3.11 --- pyproject.toml | 1 + src/lupy/sampling.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c24213b..904eec1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,6 +34,7 @@ classifiers = [ dependencies = [ "numpy", "scipy", + "typing-extensions; python_version<'3.11'" ] [project.urls] diff --git a/src/lupy/sampling.py b/src/lupy/sampling.py index e55544e..f3fe703 100644 --- a/src/lupy/sampling.py +++ b/src/lupy/sampling.py @@ -1,6 +1,10 @@ from __future__ import annotations -from typing import TypeVar, NamedTuple, Self +from typing import TypeVar, NamedTuple +try: + from typing_extensions import Self +except ImportError: + from typing import Self from fractions import Fraction import threading