From d973c9e300177c3fa122815da9f88dc38d2f3f0b Mon Sep 17 00:00:00 2001 From: ChuyueSun Date: Tue, 21 May 2024 22:15:45 -0700 Subject: [PATCH 1/3] support py3.10 --- pantograph/expr.py | 10 +++++----- poetry.lock | 18 +++++++----------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/pantograph/expr.py b/pantograph/expr.py index dee9711..6c54241 100644 --- a/pantograph/expr.py +++ b/pantograph/expr.py @@ -2,7 +2,7 @@ Data structuers for expressions and goals """ from dataclasses import dataclass -from typing import Optional, Self, Union +from typing import Optional, Union Expr = str @@ -16,7 +16,7 @@ class Variable: name: Optional[str] = None @staticmethod - def parse(payload: dict) -> Self: + def parse(payload: dict): name = payload.get("userName") t = parse_expr(payload["type"]) v = payload.get("value") @@ -39,11 +39,11 @@ class Goal: is_conversion: bool = False @staticmethod - def sentence(target: Expr) -> Self: + def sentence(target: Expr): return Goal(variables=[], target=target) @staticmethod - def parse(payload: dict) -> Self: + def parse(payload: dict): name = payload.get("userName") variables = [Variable.parse(v) for v in payload["vars"]] target = parse_expr(payload["target"]) @@ -73,7 +73,7 @@ class GoalState: return not self.goals @staticmethod - def parse(payload: dict, _sentinel: list[int]) -> Self: + def parse(payload: dict, _sentinel: list[int]): state_id = payload["nextStateId"] goals = [Goal.parse(g) for g in payload["goals"]] return GoalState(state_id, goals, _sentinel) diff --git a/poetry.lock b/poetry.lock index 261ace1..be1c94f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,15 +1,10 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. - [[package]] name = "pexpect" version = "4.9.0" description = "Pexpect allows easy control of interactive console applications." +category = "main" optional = false python-versions = "*" -files = [ - {file = "pexpect-4.9.0-py2.py3-none-any.whl", hash = "sha256:7236d1e080e4936be2dc3e326cec0af72acf9212a7e1d060210e70a47e253523"}, - {file = "pexpect-4.9.0.tar.gz", hash = "sha256:ee7d41123f3c9911050ea2c2dac107568dc43b2d3b0c7557a33212c398ead30f"}, -] [package.dependencies] ptyprocess = ">=0.5" @@ -18,14 +13,15 @@ ptyprocess = ">=0.5" name = "ptyprocess" version = "0.7.0" description = "Run a subprocess in a pseudo terminal" +category = "main" optional = false python-versions = "*" -files = [ - {file = "ptyprocess-0.7.0-py2.py3-none-any.whl", hash = "sha256:4b41f3967fce3af57cc7e94b888626c18bf37a083e3651ca8feeb66d492fef35"}, - {file = "ptyprocess-0.7.0.tar.gz", hash = "sha256:5c5d0a3b48ceee0b48485e0c26037c0acd7d29765ca3fbb5cb3831d347423220"}, -] [metadata] -lock-version = "2.0" +lock-version = "1.1" python-versions = "^3.11" content-hash = "aaae6d4832f97d9ad1b145776be94a2c44a7e77068bb1b3a05241a81dde23909" + +[metadata.files] +pexpect = [] +ptyprocess = [] From 1e5a9c0fb4f0c382a550739b5acc44a3623b7929 Mon Sep 17 00:00:00 2001 From: Chuyue Sun Date: Fri, 24 May 2024 21:34:55 -0700 Subject: [PATCH 2/3] change pyproject toml to python3.10 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1450528..83ba788 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ license = "GPL-3" readme = "README.md" [tool.poetry.dependencies] -python = "^3.11" +python = "^3.10" pexpect = "^4.9.0" [tool.poetry.build] From 516a93851ac3231448af552f508f333dd80c457b Mon Sep 17 00:00:00 2001 From: Chuyue Sun Date: Fri, 24 May 2024 22:42:32 -0700 Subject: [PATCH 3/3] update readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index f66d9f2..5d02305 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,10 @@ Update submodule ``` bash git submodule update --init ``` +Install dependencies +```bash +poetry install +``` Execute ```bash