From 1de70a1aaecf90dbbd9317f8dd8060aa27aa10ed Mon Sep 17 00:00:00 2001 From: sneakers-the-rat Date: Tue, 2 Jul 2024 00:10:28 -0700 Subject: [PATCH] python 3.10 compat & update lockfiles --- nwb_linkml/pdm.lock | 2 +- nwb_linkml/pyproject.toml | 1 + nwb_linkml/src/nwb_linkml/adapters/adapter.py | 7 ++++++- pdm.lock | 3 ++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/nwb_linkml/pdm.lock b/nwb_linkml/pdm.lock index 841093c..ac66fb6 100644 --- a/nwb_linkml/pdm.lock +++ b/nwb_linkml/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "dev"] strategy = ["cross_platform", "inherit_metadata"] lock_version = "4.4.2" -content_hash = "sha256:8400c0a688063dce308afa6d2db8500688953be4199c186f592c9f0ca84ad1f9" +content_hash = "sha256:94d398adc70609c1254f79f19c1b8ee5feb0adfc6c38b58415f7f506b94e8782" [[package]] name = "annotated-types" diff --git a/nwb_linkml/pyproject.toml b/nwb_linkml/pyproject.toml index 72c3664..edb53af 100644 --- a/nwb_linkml/pyproject.toml +++ b/nwb_linkml/pyproject.toml @@ -21,6 +21,7 @@ dependencies = [ "dask>=2023.9.2", "blosc2>=2.2.7", "tqdm>=4.66.1", + 'typing-extensions>=4.12.2;python_version<"3.11"', ] [project.urls] diff --git a/nwb_linkml/src/nwb_linkml/adapters/adapter.py b/nwb_linkml/src/nwb_linkml/adapters/adapter.py index f31f800..e16e1a3 100644 --- a/nwb_linkml/src/nwb_linkml/adapters/adapter.py +++ b/nwb_linkml/src/nwb_linkml/adapters/adapter.py @@ -12,10 +12,10 @@ from typing import ( Tuple, Type, TypeVar, - TypeVarTuple, Union, Unpack, ) +import sys from linkml_runtime.linkml_model import ( ClassDefinition, @@ -28,6 +28,11 @@ from pydantic import BaseModel from nwb_schema_language import Attribute, Dataset, Group, Schema +if sys.version_info.minor >= 11: + from typing import TypeVarTuple +else: + from typing_extensions import TypeVarTuple + T = TypeVar("T", Dataset, Attribute, Schema, Group, BaseModel) Ts = TypeVarTuple("Ts") Td = TypeVar("Td", bound=Union[Definition, SchemaDefinition, TypeDefinition]) diff --git a/pdm.lock b/pdm.lock index afeb680..0978fa5 100644 --- a/pdm.lock +++ b/pdm.lock @@ -1466,7 +1466,7 @@ files = [ [[package]] name = "nwb-linkml" -version = "0.1.0" +version = "0.2.0" requires_python = "<3.13,>=3.10" editable = true path = "./nwb_linkml" @@ -1485,6 +1485,7 @@ dependencies = [ "pyyaml>=6.0", "rich>=13.5.2", "tqdm>=4.66.1", + "typing-extensions>=4.12.2; python_version < \"3.11\"", ] [[package]]