diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml index c1361ff..0bb8f83 100644 --- a/.github/workflows/test-coverage.yml +++ b/.github/workflows/test-coverage.yml @@ -17,7 +17,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: 3.12 - uses: actions/cache@v2 name: Configure pip caching diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4e6e596..11c4741 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.11", "3.12"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/tests/test_tsellm.py b/tests/test_tsellm.py index 261b1ad..f4a47e6 100644 --- a/tests/test_tsellm.py +++ b/tests/test_tsellm.py @@ -24,6 +24,7 @@ def test_cli(db_path): table.insert({"prompt": "hello"}) table.insert({"prompt": "world"}) - assert db.execute( - "select prompt from prompts" - ).fetchall() == [("hello",), ("world",)] + assert db.execute("select prompt from prompts").fetchall() == [ + ("hello",), + ("world",), + ] diff --git a/tsellm/cli.py b/tsellm/cli.py index 9d01710..3836be5 100644 --- a/tsellm/cli.py +++ b/tsellm/cli.py @@ -64,21 +64,25 @@ def cli(*args): prog="python -m tsellm", ) parser.add_argument( - "filename", type=str, default=":memory:", nargs="?", + "filename", + type=str, + default=":memory:", + nargs="?", help=( "SQLite database to open (defaults to ':memory:'). " "A new database is created if the file does not previously exist." ), ) parser.add_argument( - "sql", type=str, nargs="?", - help=( - "An SQL query to execute. " - "Any returned rows are printed to stdout." - ), + "sql", + type=str, + nargs="?", + help=("An SQL query to execute. " "Any returned rows are printed to stdout."), ) parser.add_argument( - "-v", "--version", action="version", + "-v", + "--version", + action="version", version=f"SQLite version {sqlite3.sqlite_version}", help="Print underlying SQLite library version", ) @@ -94,13 +98,15 @@ def cli(*args): eofkey = "CTRL-Z" else: eofkey = "CTRL-D" - banner = dedent(f""" + banner = dedent( + f""" tsellm shell, running on SQLite version {sqlite3.sqlite_version} Connected to {db_name} Each command will be run using execute() on the cursor. Type ".help" for more information; type ".quit" or {eofkey} to quit. - """).strip() + """ + ).strip() sys.ps1 = "tsellm> " sys.ps2 = " ... "