Skip to content

Commit

Permalink
py 3.11 and 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Florents-Tselai committed Jun 22, 2024
1 parent 92bbc37 commit 9929ca5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
7 changes: 4 additions & 3 deletions tests/test_tsellm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",),
]
24 changes: 15 additions & 9 deletions tsellm/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
Expand All @@ -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 = " ... "

Expand Down

0 comments on commit 9929ca5

Please sign in to comment.