diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 442ca15..0eab69d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - python-version: [ "3.11" ] + python-version: [ "3.11", "3.9" ] pydantic: [ "pydantic1", "pydantic2" ] steps: - uses: actions/checkout@v2 diff --git a/pyproject.toml b/pyproject.toml index 81f98f9..b221004 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "semra" dynamic = ["version"] description = 'Semantic Mapping Reasoning Assembler' readme = "README.md" -requires-python = ">=3.10" +requires-python = ">=3.9" license = "MIT" keywords = [] authors = [ @@ -16,6 +16,7 @@ authors = [ classifiers = [ "Development Status :: 4 - Beta", "Programming Language :: Python", + "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: Implementation :: CPython", @@ -31,6 +32,7 @@ dependencies = [ "bioregistry", "bioontologies", "pyobo", + "typing_extensions", ] [project.optional-dependencies] @@ -74,7 +76,7 @@ cov = [ ] [[tool.hatch.envs.all.matrix]] -python = ["3.10", "3.11"] +python = ["3.9", "3.11"] [tool.hatch.envs.lint] detached = true @@ -100,11 +102,11 @@ all = [ ] [tool.black] -target-version = ["py311"] +target-version = ["py39"] line-length = 120 [tool.ruff] -target-version = "py311" +target-version = "py39" line-length = 120 select = [ "A", diff --git a/src/semra/client.py b/src/semra/client.py index 556cdf4..badfde0 100644 --- a/src/semra/client.py +++ b/src/semra/client.py @@ -5,7 +5,7 @@ import os import typing as t from collections import Counter -from typing import Any, TypeAlias +from typing import Any import bioregistry import neo4j @@ -13,6 +13,7 @@ import networkx as nx import pydantic from neo4j import Transaction, unit_of_work +from typing_extensions import TypeAlias import semra from semra import Evidence, MappingSet, Reference @@ -25,9 +26,9 @@ Node: TypeAlias = t.Mapping[str, Any] -TxResult: TypeAlias = list[list[Any]] | None +TxResult: TypeAlias = t.Optional[list[list[Any]]] -ReferenceHint: TypeAlias = str | Reference +ReferenceHint: TypeAlias = t.Union[str, Reference] class Neo4jClient: