From 5da57c051c04c2cff95a7c19def91077a9856c32 Mon Sep 17 00:00:00 2001 From: zariiii9003 <52598363+zariiii9003@users.noreply.github.com> Date: Tue, 17 Oct 2023 11:54:26 +0200 Subject: [PATCH] add typing_extensions for ParamSpec --- pyproject.toml | 2 +- src/pycanape/utils.py | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 84765ac..1ae2a4e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,7 @@ classifiers = [ dependencies = [ "psutil", "numpy>=1.21", + "typing-extensions;python_version<'3.10'", ] dynamic = ["version"] @@ -82,7 +83,6 @@ select = [ "E", # pycodestyle "EM", # flake8-errmsg "F", # pyflakes - "FURB", "G", # flake8-logging-format "I", # isort "ISC", # flake8-implicit-str-concat diff --git a/src/pycanape/utils.py b/src/pycanape/utils.py index 8196efa..253cda1 100644 --- a/src/pycanape/utils.py +++ b/src/pycanape/utils.py @@ -4,14 +4,21 @@ import ctypes import logging +import sys import winreg from collections.abc import Callable from ctypes.util import find_library from threading import Lock -from typing import Any, ParamSpec, TypeVar +from typing import Any, TypeVar import psutil +if sys.version_info >= (3, 10): + from typing import ParamSpec +else: + from typing_extensions import ParamSpec + + LOG = logging.getLogger(__name__) LOCK = Lock()