Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

Commit f03d96e

Browse files
committed
improve CI and pre-commit configurations
hrana-test-server is now a submodule, to simplify execution. Improve README.rst docs for development.
1 parent fef8777 commit f03d96e

5 files changed

Lines changed: 41 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@ on:
44
push:
55
branches: [ master ]
66
pull_request:
7-
branches: [ '*' ]
7+
types:
8+
- opened
9+
- synchronize
10+
- reopened
11+
- ready_for_review
12+
13+
concurrency:
14+
group: ci-check-${{ github.ref }}
15+
cancel-in-progress: true
816

917
jobs:
1018
check:
@@ -15,6 +23,8 @@ jobs:
1523
"python-version": ["3.7", "3.11"]
1624
steps:
1725
- uses: actions/checkout@v3
26+
with:
27+
submodules: true
1828
- name: "Install Poetry"
1929
run: "pip install poetry"
2030
- name: "Setup Python"
@@ -25,10 +35,3 @@ jobs:
2535
- name: "Install poetry dependencies"
2636
run: "poetry install --no-interaction"
2737
- uses: pre-commit/action@v3.0.0
28-
- name: "Checkout hrana-test-server"
29-
uses: actions/checkout@v3
30-
with:
31-
repository: "libsql/hrana-test-server"
32-
path: "hrana-test-server"
33-
- name: "Test with server v2"
34-
run: "poetry run python hrana-test-server/server_v2.py pytest --verbose"

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "hrana-test-server"]
2+
path = hrana-test-server
3+
url = https://github.com/libsql/hrana-test-server
4+
branch = main

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ repos:
3232
hooks:
3333
- id: pytest-check
3434
name: pytest-check
35-
entry: pytest
35+
entry: poetry run python hrana-test-server/server_v2.py pytest --verbose
3636
language: system
3737
pass_filenames: false
3838
always_run: true
39+
types: [python]

README.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,29 @@ Then, in your Python app, you can connect to the database via::
3232
Note that ``secure=true`` query/search parameter will force the usage of
3333
secure WebSockets (``wss://``) to connect to the remote server.
3434

35+
Development
36+
-----------
37+
38+
This project uses `poetry<https://python-poetry.org/>`_, can be tested with
39+
`pytest<https://pytest.org/>`_ and should be checked with
40+
`pre-commit<https://pre-commit.com/>`_. A
41+
`pure-python<https://github.com/libsql/hrana-test-server>`_ test server is used
42+
as a submodule::
43+
44+
git clone https://github.com/libsql/sqlalchemy-libsql.git
45+
cd sqlalchemy-libsql
46+
git submodule init && git submodule update # hrana-test-server
47+
48+
pre-commit install # install git-hooks
49+
poetry install --with dev # pytest
50+
51+
pre-commit run -a # check all files in the project, runs pytest
52+
53+
poetry run pytest
54+
poetry run pytest --log-debug=libsql_client # debug libsql_client usage
55+
# run against WSS server:
56+
poetry run pytest --dburi "sqlite+libsql://server.com?secure=true&authToken=JWT_HERE"
57+
3558

3659
The SQLAlchemy Project
3760
======================

hrana-test-server

Submodule hrana-test-server added at 68f9f4d

0 commit comments

Comments
 (0)