Skip to content

Commit

Permalink
support down to py3.9, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBuchanan314 committed Dec 4, 2024
1 parent cce7698 commit 3f2ecfb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.11', '3.12', '3.13' ]
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
name: Python ${{ matrix.python-version }} tests
steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ build-backend = "setuptools.build_meta"

[project]
name = "atmst"
version = "0.0.3"
version = "0.0.4"
authors = [
{ name="David Buchanan", email="[email protected]" },
]
description = "A Python library for wrangling atproto-flavoured Merkle Search Trees"
readme = "README.md"
requires-python = ">=3.11"
requires-python = ">=3.9"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
Expand Down
9 changes: 6 additions & 3 deletions src/atmst/mst/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
from more_itertools import ilen
from itertools import takewhile
from dataclasses import dataclass
from typing import Tuple, Self, Optional

from typing import TYPE_CHECKING, Tuple, Optional
if TYPE_CHECKING: # Self doesn't exist <3.11
from typing import Self

from cbrrr import encode_dag_cbor, decode_dag_cbor, CID

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

@classmethod
def empty_root(cls) -> Self:
def empty_root(cls) -> "Self":
return cls(
subtrees=(None,),
keys=(),
Expand Down Expand Up @@ -78,7 +81,7 @@ def serialised(self) -> bytes:
})

@classmethod
def deserialise(cls, data: bytes) -> Self:
def deserialise(cls, data: bytes) -> "Self":
cbor = decode_dag_cbor(data)
if len(cbor) != 2: # e, l
raise ValueError("malformed MST node")
Expand Down
6 changes: 4 additions & 2 deletions src/atmst/mst/node_walker.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from dataclasses import dataclass
from typing import Tuple, Self, Optional, List, Iterable
from typing import TYPE_CHECKING, Tuple, Optional, List, Iterable
if TYPE_CHECKING: # Self doesn't exist <3.11
from typing import Self

from cbrrr import CID

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

def subtree_walker(self) -> Self:
def subtree_walker(self) -> "Self":
return NodeWalker(self.ns, self.subtree, self.lpath, self.rpath)

@property
Expand Down

0 comments on commit 3f2ecfb

Please sign in to comment.