From 6905d630362834974ab2912a06ff38cc292df464 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Dec 2025 01:22:12 +0000 Subject: [PATCH 01/10] Initial plan From 7911985d14b68ed2bb703221453ab496a1f1faa3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Dec 2025 01:28:14 +0000 Subject: [PATCH 02/10] Implement tyro-based CLI with --addr/-a flag support Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com> --- ddss/main.py | 57 ++++++++++++++++++++++++++++++++------------------ pyproject.toml | 1 + 2 files changed, 38 insertions(+), 20 deletions(-) diff --git a/ddss/main.py b/ddss/main.py index c285f96..e8ce0cf 100644 --- a/ddss/main.py +++ b/ddss/main.py @@ -1,7 +1,8 @@ -import sys import asyncio import tempfile import pathlib +from typing import Annotated, Optional +import tyro from .orm import initialize_database from .ds import main as ds from .egg import main as egg @@ -36,25 +37,41 @@ async def main(addr): def cli(): - if len(sys.argv) == 1: - tmpdir = tempfile.TemporaryDirectory() - path = pathlib.Path(tmpdir.name) / "ddss.db" - addr = f"sqlite:///{path.as_posix()}" - elif len(sys.argv) == 2 and sys.argv[1] not in ["--help", "-help", "-h", "/help", "/h", "/?"]: - addr = sys.argv[1] - else: - print(f"Usage: {sys.argv[0]} []") - sys.exit(1) - for key, value in sqlalchemy_driver.items(): - if addr.startswith(f"{key}://"): - addr = addr.replace(f"{key}://", f"{key}+{value}://") - if addr.startswith(f"{key}+{value}://"): - break - else: - print(f"Unsupported database address: {addr}") - sys.exit(1) - print(f"addr: {addr}") - asyncio.run(main(addr)) + """DDSS - Distributed Deductive System Sorts + + Run DDSS with an interactive deductive reasoning environment. + """ + + def run( + addr: Annotated[ + Optional[str], + tyro.conf.arg( + aliases=["-a"], + help="Database address URL. Supported: sqlite://, mysql://, mariadb://, postgresql://. " + "If not provided, uses a temporary SQLite database." + ) + ] = None, + ) -> None: + """Start DDSS with the specified database address.""" + if addr is None: + tmpdir = tempfile.TemporaryDirectory() + path = pathlib.Path(tmpdir.name) / "ddss.db" + addr = f"sqlite:///{path.as_posix()}" + + # Add driver suffix to database URL if needed + for key, value in sqlalchemy_driver.items(): + if addr.startswith(f"{key}://"): + addr = addr.replace(f"{key}://", f"{key}+{value}://") + if addr.startswith(f"{key}+{value}://"): + break + else: + print(f"Unsupported database address: {addr}") + raise SystemExit(1) + + print(f"addr: {addr}") + asyncio.run(main(addr)) + + tyro.cli(run) if __name__ == "__main__": diff --git a/pyproject.toml b/pyproject.toml index 86f69d8..b6feb3e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,6 +12,7 @@ dependencies = [ "apyds-egg~=0.0.11", "prompt-toolkit~=3.0.52", "sqlalchemy[aiosqlite,aiomysql,postgresql-asyncpg]~=2.0.45", + "tyro~=0.9.15", ] [project.urls] From 0e6c4928fa40cf3a7c433c853fb7a459374b79d4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Dec 2025 01:30:51 +0000 Subject: [PATCH 03/10] Address code review comments: fix resource cleanup and use sys.exit Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com> --- ddss/main.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ddss/main.py b/ddss/main.py index e8ce0cf..c0e3c1d 100644 --- a/ddss/main.py +++ b/ddss/main.py @@ -1,6 +1,7 @@ import asyncio import tempfile import pathlib +import sys from typing import Annotated, Optional import tyro from .orm import initialize_database @@ -36,6 +37,10 @@ async def main(addr): } +# Global to keep temporary directory alive during execution +_tmpdir = None + + def cli(): """DDSS - Distributed Deductive System Sorts @@ -53,9 +58,11 @@ def run( ] = None, ) -> None: """Start DDSS with the specified database address.""" + # Use a global to keep the temporary directory alive + global _tmpdir if addr is None: - tmpdir = tempfile.TemporaryDirectory() - path = pathlib.Path(tmpdir.name) / "ddss.db" + _tmpdir = tempfile.TemporaryDirectory() + path = pathlib.Path(_tmpdir.name) / "ddss.db" addr = f"sqlite:///{path.as_posix()}" # Add driver suffix to database URL if needed @@ -66,7 +73,7 @@ def run( break else: print(f"Unsupported database address: {addr}") - raise SystemExit(1) + sys.exit(1) print(f"addr: {addr}") asyncio.run(main(addr)) From 8dbe623c03df7510278e143e61a836f1d510beb8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Dec 2025 01:37:24 +0000 Subject: [PATCH 04/10] Update tyro to 1.0.3 and restructure CLI functions - Update tyro dependency from ~=0.9.15 to ~=1.0.3 - Rename async main() to async run() - Move nested run() function to module-level main() - Simplify cli() to just call tyro.cli(main) Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com> --- ddss/main.py | 68 +++++++++++++++++++++++++------------------------- pyproject.toml | 2 +- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/ddss/main.py b/ddss/main.py index c0e3c1d..0f0b8de 100644 --- a/ddss/main.py +++ b/ddss/main.py @@ -11,7 +11,7 @@ from .output import main as output -async def main(addr): +async def run(addr): engine, session = await initialize_database(addr) try: await asyncio.wait( @@ -41,44 +41,44 @@ async def main(addr): _tmpdir = None +def main( + addr: Annotated[ + Optional[str], + tyro.conf.arg( + aliases=["-a"], + help="Database address URL. Supported: sqlite://, mysql://, mariadb://, postgresql://. " + "If not provided, uses a temporary SQLite database." + ) + ] = None, +) -> None: + """Start DDSS with the specified database address.""" + # Use a global to keep the temporary directory alive + global _tmpdir + if addr is None: + _tmpdir = tempfile.TemporaryDirectory() + path = pathlib.Path(_tmpdir.name) / "ddss.db" + addr = f"sqlite:///{path.as_posix()}" + + # Add driver suffix to database URL if needed + for key, value in sqlalchemy_driver.items(): + if addr.startswith(f"{key}://"): + addr = addr.replace(f"{key}://", f"{key}+{value}://") + if addr.startswith(f"{key}+{value}://"): + break + else: + print(f"Unsupported database address: {addr}") + sys.exit(1) + + print(f"addr: {addr}") + asyncio.run(run(addr)) + + def cli(): """DDSS - Distributed Deductive System Sorts Run DDSS with an interactive deductive reasoning environment. """ - - def run( - addr: Annotated[ - Optional[str], - tyro.conf.arg( - aliases=["-a"], - help="Database address URL. Supported: sqlite://, mysql://, mariadb://, postgresql://. " - "If not provided, uses a temporary SQLite database." - ) - ] = None, - ) -> None: - """Start DDSS with the specified database address.""" - # Use a global to keep the temporary directory alive - global _tmpdir - if addr is None: - _tmpdir = tempfile.TemporaryDirectory() - path = pathlib.Path(_tmpdir.name) / "ddss.db" - addr = f"sqlite:///{path.as_posix()}" - - # Add driver suffix to database URL if needed - for key, value in sqlalchemy_driver.items(): - if addr.startswith(f"{key}://"): - addr = addr.replace(f"{key}://", f"{key}+{value}://") - if addr.startswith(f"{key}+{value}://"): - break - else: - print(f"Unsupported database address: {addr}") - sys.exit(1) - - print(f"addr: {addr}") - asyncio.run(main(addr)) - - tyro.cli(run) + tyro.cli(main) if __name__ == "__main__": diff --git a/pyproject.toml b/pyproject.toml index b6feb3e..10711d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ dependencies = [ "apyds-egg~=0.0.11", "prompt-toolkit~=3.0.52", "sqlalchemy[aiosqlite,aiomysql,postgresql-asyncpg]~=2.0.45", - "tyro~=0.9.15", + "tyro~=1.0.3", ] [project.urls] From 5c113252c418a5c3b04060489675aead2f3732c2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Dec 2025 01:46:45 +0000 Subject: [PATCH 05/10] Address PR review comments: remove global, add component parameter, improve docstrings - Remove global _tmpdir variable (no longer needed) - Replace sys.exit(1) with raise SystemExit(1) - Move docstring from cli() to main() for proper --help display - Add component parameter to select which components to run - Default components: ["input", "output", "ds", "egg"] - Run uv lock to update lockfile with tyro 1.0.3 Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com> --- ddss/main.py | 58 +++++++++++++++++++++++++++++++--------------------- uv.lock | 37 +++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 23 deletions(-) diff --git a/ddss/main.py b/ddss/main.py index 0f0b8de..6eda3a4 100644 --- a/ddss/main.py +++ b/ddss/main.py @@ -1,7 +1,6 @@ import asyncio import tempfile import pathlib -import sys from typing import Annotated, Optional import tyro from .orm import initialize_database @@ -11,16 +10,27 @@ from .output import main as output -async def run(addr): +async def run(addr, components): engine, session = await initialize_database(addr) + + # Map component names to their main functions + component_map = { + "ds": ds, + "egg": egg, + "input": input, + "output": output, + } + + # Create tasks only for requested components + tasks = [ + asyncio.create_task(component_map[component](addr, engine, session)) + for component in components + if component in component_map + ] + try: await asyncio.wait( - [ - asyncio.create_task(ds(addr, engine, session)), - asyncio.create_task(egg(addr, engine, session)), - asyncio.create_task(input(addr, engine, session)), - asyncio.create_task(output(addr, engine, session)), - ], + tasks, return_when=asyncio.FIRST_COMPLETED, ) except asyncio.CancelledError: @@ -37,10 +47,6 @@ async def run(addr): } -# Global to keep temporary directory alive during execution -_tmpdir = None - - def main( addr: Annotated[ Optional[str], @@ -50,15 +56,25 @@ def main( "If not provided, uses a temporary SQLite database." ) ] = None, + component: Annotated[ + Optional[list[str]], + tyro.conf.arg( + help="Components to run. Available: input, output, ds, egg." + ) + ] = None, ) -> None: - """Start DDSS with the specified database address.""" - # Use a global to keep the temporary directory alive - global _tmpdir + """DDSS - Distributed Deductive System Sorts + + Run DDSS with an interactive deductive reasoning environment. + """ if addr is None: - _tmpdir = tempfile.TemporaryDirectory() - path = pathlib.Path(_tmpdir.name) / "ddss.db" + tmpdir = tempfile.TemporaryDirectory() + path = pathlib.Path(tmpdir.name) / "ddss.db" addr = f"sqlite:///{path.as_posix()}" + if component is None: + component = ["input", "output", "ds", "egg"] + # Add driver suffix to database URL if needed for key, value in sqlalchemy_driver.items(): if addr.startswith(f"{key}://"): @@ -67,17 +83,13 @@ def main( break else: print(f"Unsupported database address: {addr}") - sys.exit(1) + raise SystemExit(1) print(f"addr: {addr}") - asyncio.run(run(addr)) + asyncio.run(run(addr, component)) def cli(): - """DDSS - Distributed Deductive System Sorts - - Run DDSS with an interactive deductive reasoning environment. - """ tyro.cli(main) diff --git a/uv.lock b/uv.lock index cac8cfe..bca3e87 100644 --- a/uv.lock +++ b/uv.lock @@ -239,6 +239,7 @@ dependencies = [ { name = "apyds-egg" }, { name = "prompt-toolkit" }, { name = "sqlalchemy", extra = ["aiomysql", "aiosqlite", "postgresql-asyncpg"] }, + { name = "tyro" }, ] [package.optional-dependencies] @@ -260,9 +261,19 @@ requires-dist = [ { name = "pytest-cov", marker = "extra == 'dev'", specifier = "~=7.0.0" }, { name = "ruff", marker = "extra == 'dev'", specifier = "~=0.14.10" }, { name = "sqlalchemy", extras = ["aiomysql", "aiosqlite", "postgresql-asyncpg"], specifier = "~=2.0.45" }, + { name = "tyro", specifier = "~=1.0.3" }, ] provides-extras = ["dev"] +[[package]] +name = "docstring-parser" +version = "0.17.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/b2/9d/c3b43da9515bd270df0f80548d9944e389870713cc1fe2b8fb35fe2bcefd/docstring_parser-0.17.0.tar.gz", hash = "sha256:583de4a309722b3315439bb31d64ba3eebada841f2e2cee23b99df001434c912", size = 27442, upload-time = "2025-07-21T07:35:01.868Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/55/e2/2537ebcff11c1ee1ff17d8d0b6f4db75873e3b0fb32c2d4a2ee31ecb310a/docstring_parser-0.17.0-py3-none-any.whl", hash = "sha256:cf2569abd23dce8099b300f9b4fa8191e9582dda731fd533daf54c4551658708", size = 36896, upload-time = "2025-07-21T07:35:00.684Z" }, +] + [[package]] name = "greenlet" version = "3.3.0" @@ -542,6 +553,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/77/b8/0135fadc89e73be292b473cb820b4f5a08197779206b33191e801feeae40/tomli-2.3.0-py3-none-any.whl", hash = "sha256:e95b1af3c5b07d9e643909b5abbec77cd9f1217e6d0bca72b0234736b9fb1f1b", size = 14408, upload-time = "2025-10-08T22:01:46.04Z" }, ] +[[package]] +name = "typeguard" +version = "4.4.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/c7/68/71c1a15b5f65f40e91b65da23b8224dad41349894535a97f63a52e462196/typeguard-4.4.4.tar.gz", hash = "sha256:3a7fd2dffb705d4d0efaed4306a704c89b9dee850b688f060a8b1615a79e5f74", size = 75203, upload-time = "2025-06-18T09:56:07.624Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1b/a9/e3aee762739c1d7528da1c3e06d518503f8b6c439c35549b53735ba52ead/typeguard-4.4.4-py3-none-any.whl", hash = "sha256:b5f562281b6bfa1f5492470464730ef001646128b180769880468bd84b68b09e", size = 34874, upload-time = "2025-06-18T09:56:05.999Z" }, +] + [[package]] name = "typing-extensions" version = "4.15.0" @@ -551,6 +574,20 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" }, ] +[[package]] +name = "tyro" +version = "1.0.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "docstring-parser" }, + { name = "typeguard" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/c8/c5/2513339a36f300f477e4742706b977d3a8784485c8df037b64712ccd0c5e/tyro-1.0.3.tar.gz", hash = "sha256:6b3d73af2a5bb87247cc98b3e0d0bd5443010617e38250e6780b9f8998e1541e", size = 450742, upload-time = "2025-12-21T09:11:37.184Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/34/ac/8719fcb891c690394751114952e65f6f9f31259b6f62a10d7825b81f887e/tyro-1.0.3-py3-none-any.whl", hash = "sha256:d16758525b4c6ddd06fabb15ef821702b47aa829e0181be80ce71aa99acf99d9", size = 180664, upload-time = "2025-12-21T09:11:38.454Z" }, +] + [[package]] name = "wcwidth" version = "0.2.14" From ad76b5655ceb4be22ddbe906cf1c679f2100ff2b Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Wed, 24 Dec 2025 09:49:55 +0800 Subject: [PATCH 06/10] Update uv.lock. --- uv.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uv.lock b/uv.lock index bca3e87..38a6bf8 100644 --- a/uv.lock +++ b/uv.lock @@ -16,11 +16,11 @@ wheels = [ [[package]] name = "aiosqlite" -version = "0.22.0" +version = "0.22.1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/3a/0d/449c024bdabd0678ae07d804e60ed3b9786facd3add66f51eee67a0fccea/aiosqlite-0.22.0.tar.gz", hash = "sha256:7e9e52d72b319fcdeac727668975056c49720c995176dc57370935e5ba162bb9", size = 14707, upload-time = "2025-12-13T18:32:45.762Z" } +sdist = { url = "https://files.pythonhosted.org/packages/4e/8a/64761f4005f17809769d23e518d915db74e6310474e733e3593cfc854ef1/aiosqlite-0.22.1.tar.gz", hash = "sha256:043e0bd78d32888c0a9ca90fc788b38796843360c855a7262a532813133a0650", size = 14821, upload-time = "2025-12-23T19:25:43.997Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/ef/39/b2181148075272edfbbd6d87e6cd78cc71dca243446fa3b381fd4116950b/aiosqlite-0.22.0-py3-none-any.whl", hash = "sha256:96007fac2ce70eda3ca1bba7a3008c435258a592b8fbf2ee3eeaa36d33971a09", size = 17263, upload-time = "2025-12-13T18:32:44.619Z" }, + { url = "https://files.pythonhosted.org/packages/00/b7/e3bf5133d697a08128598c8d0abc5e16377b51465a33756de24fa7dee953/aiosqlite-0.22.1-py3-none-any.whl", hash = "sha256:21c002eb13823fad740196c5a2e9d8e62f6243bd9e7e4a1f87fb5e44ecb4fceb", size = 17405, upload-time = "2025-12-23T19:25:42.139Z" }, ] [[package]] From 79cc843b432a72de1117b0f4e92e92b16dc58b5a Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Wed, 24 Dec 2025 09:50:08 +0800 Subject: [PATCH 07/10] Fix pre commit hook. --- ddss/main.py | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/ddss/main.py b/ddss/main.py index 6eda3a4..1e808b8 100644 --- a/ddss/main.py +++ b/ddss/main.py @@ -12,7 +12,7 @@ async def run(addr, components): engine, session = await initialize_database(addr) - + # Map component names to their main functions component_map = { "ds": ds, @@ -20,14 +20,14 @@ async def run(addr, components): "input": input, "output": output, } - + # Create tasks only for requested components tasks = [ asyncio.create_task(component_map[component](addr, engine, session)) for component in components if component in component_map ] - + try: await asyncio.wait( tasks, @@ -53,28 +53,25 @@ def main( tyro.conf.arg( aliases=["-a"], help="Database address URL. Supported: sqlite://, mysql://, mariadb://, postgresql://. " - "If not provided, uses a temporary SQLite database." - ) + "If not provided, uses a temporary SQLite database.", + ), ] = None, component: Annotated[ - Optional[list[str]], - tyro.conf.arg( - help="Components to run. Available: input, output, ds, egg." - ) + Optional[list[str]], tyro.conf.arg(help="Components to run. Available: input, output, ds, egg.") ] = None, ) -> None: """DDSS - Distributed Deductive System Sorts - + Run DDSS with an interactive deductive reasoning environment. """ if addr is None: tmpdir = tempfile.TemporaryDirectory() path = pathlib.Path(tmpdir.name) / "ddss.db" addr = f"sqlite:///{path.as_posix()}" - + if component is None: component = ["input", "output", "ds", "egg"] - + # Add driver suffix to database URL if needed for key, value in sqlalchemy_driver.items(): if addr.startswith(f"{key}://"): @@ -84,7 +81,7 @@ def main( else: print(f"Unsupported database address: {addr}") raise SystemExit(1) - + print(f"addr: {addr}") asyncio.run(run(addr, component)) From 9bbefdda9f5b66cf13c32eda8ed62f97de45acf8 Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Wed, 24 Dec 2025 09:54:33 +0800 Subject: [PATCH 08/10] Update main.py --- ddss/main.py | 49 +++++++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/ddss/main.py b/ddss/main.py index 1e808b8..5e2fa51 100644 --- a/ddss/main.py +++ b/ddss/main.py @@ -9,28 +9,26 @@ from .input import main as input from .output import main as output +component_map = { + "ds": ds, + "egg": egg, + "input": input, + "output": output, +} + async def run(addr, components): engine, session = await initialize_database(addr) - # Map component names to their main functions - component_map = { - "ds": ds, - "egg": egg, - "input": input, - "output": output, - } - - # Create tasks only for requested components - tasks = [ - asyncio.create_task(component_map[component](addr, engine, session)) - for component in components - if component in component_map - ] - try: + try: + coroutines = [component_map[component](addr, engine, session) for component in components] + except KeyError as e: + print(f"error: unsupported component {e}") + raise asyncio.CancelledError() + await asyncio.wait( - tasks, + [asyncio.create_task(coro) for coro in coroutines], return_when=asyncio.FIRST_COMPLETED, ) except asyncio.CancelledError: @@ -52,34 +50,33 @@ def main( Optional[str], tyro.conf.arg( aliases=["-a"], - help="Database address URL. Supported: sqlite://, mysql://, mariadb://, postgresql://. " - "If not provided, uses a temporary SQLite database.", + help="Database address URL. If not provided, uses a temporary SQLite database.", ), ] = None, component: Annotated[ - Optional[list[str]], tyro.conf.arg(help="Components to run. Available: input, output, ds, egg.") - ] = None, + list[str], + tyro.conf.arg( + aliases=["-c"], + help="Components to run.", + ), + ] = ["input", "output", "ds", "egg"], ) -> None: """DDSS - Distributed Deductive System Sorts - Run DDSS with an interactive deductive reasoning environment. + Run DDSS with an interactive deductive environment. """ if addr is None: tmpdir = tempfile.TemporaryDirectory() path = pathlib.Path(tmpdir.name) / "ddss.db" addr = f"sqlite:///{path.as_posix()}" - if component is None: - component = ["input", "output", "ds", "egg"] - - # Add driver suffix to database URL if needed for key, value in sqlalchemy_driver.items(): if addr.startswith(f"{key}://"): addr = addr.replace(f"{key}://", f"{key}+{value}://") if addr.startswith(f"{key}+{value}://"): break else: - print(f"Unsupported database address: {addr}") + print(f"error: unsupported database: {addr}") raise SystemExit(1) print(f"addr: {addr}") From c691d30733327ab1c2e986ad5b07ff68210e28b0 Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Wed, 24 Dec 2025 10:05:48 +0800 Subject: [PATCH 09/10] Add two more components. --- ddss/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ddss/main.py b/ddss/main.py index 5e2fa51..ec67ae6 100644 --- a/ddss/main.py +++ b/ddss/main.py @@ -8,12 +8,16 @@ from .egg import main as egg from .input import main as input from .output import main as output +from .load import main as load +from .dump import main as dump component_map = { "ds": ds, "egg": egg, "input": input, "output": output, + "load": load, + "dump": dump, } From f45c320e98e653d80ef5a46eba204024404149f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hao=20Zhang=28=E5=BC=A0=E6=B5=A9=29?= Date: Wed, 24 Dec 2025 10:10:57 +0800 Subject: [PATCH 10/10] Update ddss/main.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- ddss/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddss/main.py b/ddss/main.py index ec67ae6..6343fef 100644 --- a/ddss/main.py +++ b/ddss/main.py @@ -21,7 +21,7 @@ } -async def run(addr, components): +async def run(addr: str, components: list[str]) -> None: engine, session = await initialize_database(addr) try: