Skip to content

Commit 3f2ecfb

Browse files
support down to py3.9, bump version
1 parent cce7698 commit 3f2ecfb

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
runs-on: ubuntu-latest
77
strategy:
88
matrix:
9-
python-version: [ '3.11', '3.12', '3.13' ]
9+
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
1010
name: Python ${{ matrix.python-version }} tests
1111
steps:
1212
- uses: actions/checkout@v4

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ build-backend = "setuptools.build_meta"
66

77
[project]
88
name = "atmst"
9-
version = "0.0.3"
9+
version = "0.0.4"
1010
authors = [
1111
{ name="David Buchanan", email="d@vidbuchanan.co.uk" },
1212
]
1313
description = "A Python library for wrangling atproto-flavoured Merkle Search Trees"
1414
readme = "README.md"
15-
requires-python = ">=3.11"
15+
requires-python = ">=3.9"
1616
classifiers = [
1717
"Programming Language :: Python :: 3",
1818
"License :: OSI Approved :: MIT License",

src/atmst/mst/node.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
from more_itertools import ilen
55
from itertools import takewhile
66
from dataclasses import dataclass
7-
from typing import Tuple, Self, Optional
7+
8+
from typing import TYPE_CHECKING, Tuple, Optional
9+
if TYPE_CHECKING: # Self doesn't exist <3.11
10+
from typing import Self
811

912
from cbrrr import encode_dag_cbor, decode_dag_cbor, CID
1013

@@ -38,7 +41,7 @@ def __post_init__(self) -> None:
3841
raise ValueError("Mismatched keys/vals lengths")
3942

4043
@classmethod
41-
def empty_root(cls) -> Self:
44+
def empty_root(cls) -> "Self":
4245
return cls(
4346
subtrees=(None,),
4447
keys=(),
@@ -78,7 +81,7 @@ def serialised(self) -> bytes:
7881
})
7982

8083
@classmethod
81-
def deserialise(cls, data: bytes) -> Self:
84+
def deserialise(cls, data: bytes) -> "Self":
8285
cbor = decode_dag_cbor(data)
8386
if len(cbor) != 2: # e, l
8487
raise ValueError("malformed MST node")

src/atmst/mst/node_walker.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from dataclasses import dataclass
2-
from typing import Tuple, Self, Optional, List, Iterable
2+
from typing import TYPE_CHECKING, Tuple, Optional, List, Iterable
3+
if TYPE_CHECKING: # Self doesn't exist <3.11
4+
from typing import Self
35

46
from cbrrr import CID
57

@@ -45,7 +47,7 @@ def __init__(self, ns: NodeStore, root_cid: Optional[CID], lpath: Optional[str]=
4547
idx=0
4648
)]
4749

48-
def subtree_walker(self) -> Self:
50+
def subtree_walker(self) -> "Self":
4951
return NodeWalker(self.ns, self.subtree, self.lpath, self.rpath)
5052

5153
@property

0 commit comments

Comments
 (0)