From 8c6bbf8b57882a96845a09468c257de0b3758aca Mon Sep 17 00:00:00 2001 From: apalala Date: Tue, 5 Nov 2024 10:44:33 -0400 Subject: [PATCH 1/3] update to Py313 and test with latest libraries --- requirements-test.txt | 2 +- ruff.toml | 1 + tatsu/collections/orderedset.py | 5 ++++- tatsu/util/parproc.py | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/requirements-test.txt b/requirements-test.txt index 9ec3eaea..231f3ed3 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,4 +1,4 @@ -astroid> +astroid docutils mypy pandoc diff --git a/ruff.toml b/ruff.toml index abf3684a..d55fd9f7 100644 --- a/ruff.toml +++ b/ruff.toml @@ -41,6 +41,7 @@ lint.ignore = [ "SIM114", # if-with-same-arms "TRY003", # raise-vanilla-args "TRY300", # try-consider-else + "UP031", # use of % formatting ] exclude = [] diff --git a/tatsu/collections/orderedset.py b/tatsu/collections/orderedset.py index 5efc2137..fb924017 100644 --- a/tatsu/collections/orderedset.py +++ b/tatsu/collections/orderedset.py @@ -13,7 +13,7 @@ T = TypeVar('T') -class OrderedSet(MutableSet[T], Sequence[T]): # noqa: PLW1641 +class OrderedSet(MutableSet[T], Sequence[T]): def __init__(self, iterable: Iterable[T] | None = None): if iterable is not None: self._map = dict.fromkeys(iterable) @@ -21,6 +21,9 @@ def __init__(self, iterable: Iterable[T] | None = None): self._map = {} self._list_cache: Sequence[T] | None = None + def __hash__(self): + return self._map.__hash__() + def __len__(self): return len(self._map) diff --git a/tatsu/util/parproc.py b/tatsu/util/parproc.py index 715fafec..9300ff97 100644 --- a/tatsu/util/parproc.py +++ b/tatsu/util/parproc.py @@ -122,7 +122,7 @@ def parallel_proc(payloads, process, *args, **kwargs): pmap = _pmap if parallel else map yield from pmap(process, tasks) except KeyboardInterrupt: - return [] + return def _build_progressbar(total): From 37ee6d6923712b1609869a0a70c0427b2693c615 Mon Sep 17 00:00:00 2001 From: apalala Date: Tue, 5 Nov 2024 10:52:30 -0400 Subject: [PATCH 2/3] [readme] update --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index ee5ab7dd..73ad6eae 100644 --- a/README.rst +++ b/README.rst @@ -32,7 +32,7 @@ input, much like the `re`_ module does with regular expressions, or it can gener |TatSu| supports `left-recursive`_ rules in PEG_ grammars using the algorithm_ by *Laurent* and *Mens*. The generated AST_ has the expected left associativity. -|TatSu| requires a maintained version of Python (3.11+ at the moment). While no code +|TatSu| requires a maintained version of Python (3.13+ at the moment). While no code in |TatSu| yet depends on new language or standard library features, the authors don't want to be constrained by Python version compatibility considerations when developing features that will be part of future releases. From e07573a56a4baee8996e2da988e039ba4e5dc1f3 Mon Sep 17 00:00:00 2001 From: apalala Date: Tue, 5 Nov 2024 11:02:13 -0400 Subject: [PATCH 3/3] [test] update pipelines to py313 --- .github/workflows/default.yml | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/default.yml b/.github/workflows/default.yml index fc0f0fc5..bd9cf741 100644 --- a/.github/workflows/default.yml +++ b/.github/workflows/default.yml @@ -13,8 +13,8 @@ jobs: fail-fast: false matrix: python-version: [ + '3.13', '3.12', - '3.11', ] steps: diff --git a/tox.ini b/tox.ini index 2432f42c..f4783e4e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py313, py312, py311 +envlist = py313, py312 skipsdist = True [testenv]