Skip to content

Commit

Permalink
Workflow triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
danielebriggi committed May 24, 2024
1 parent 22724e4 commit 119cf70
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 8 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ name: Test and Release

on:
push:
pull_request:
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -40,7 +39,11 @@ jobs:
SQLITE_DB: ${{ vars.SQLITE_DB }}
SQLITE_PORT: ${{ vars.SQLITE_PORT }}
run: |
pytest -v src/tests
pytest --cov -v src/tests
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
release:
if: ${{ github.ref == 'refs/heads/main' }}
needs: tests
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ main.dSYM/
.env
*.pyc
*.pyo
.coverage

.DS_Store

Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Python SDK for SQLite Cloud

![Build Status](https://github.com/sqlitecloud/python/actions/workflows/deploy.yaml/badge.svg "Build Status") ![Jupyter Notebook](https://img.shields.io/badge/jupyter-%23FA0F00.svg?style=plastic&logo=jupyter&logoColor=white)
![Build Status](https://github.com/sqlitecloud/python/actions/workflows/deploy.yaml/badge.svg "Build Status")
[![codecov](https://codecov.io/github/sqlitecloud/python/graph/badge.svg?token=38G6FGOWKP)](https://codecov.io/github/sqlitecloud/python)
![PyPI - Version](https://img.shields.io/pypi/v/sqlitecloud?link=https%3A%2F%2Fpypi.org%2Fproject%2FSqliteCloud%2F)
![PyPI - Downloads](https://img.shields.io/pypi/dm/sqlitecloud?link=https%3A%2F%2Fpypi.org%2Fproject%2FSqliteCloud%2F)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/sqlitecloud?link=https%3A%2F%2Fpypi.org%2Fproject%2FSqliteCloud%2F)



SQLiteCloud is a powerful Python package that allows you to interact with the SQLite Cloud backend server seamlessly. It provides methods for various database operations. This package is designed to simplify database operations in Python applications, making it easier than ever to work with SQLite Cloud.

Expand Down
2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
typing-extensions==4.1.1
pytest==7.0.1
pytest-mock==3.6.1
pytest-cov==4.0.0
coverage==6.2
python-dotenv==0.20.0
lz4==3.1.10
bump2version==1.0.1
Expand Down
6 changes: 3 additions & 3 deletions src/sqlitecloud/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,12 @@ def _internal_pubsub_thread(self, connection: SQCloudConnect) -> None:
ready_to_read, _, errors = select.select(
[connection.pubsub_socket], [], []
)
# eg, no data to read
if len(ready_to_read) == 0:
continue
# eg, if the socket is closed
if len(errors) > 0:
break
# eg, no data to read
if len(ready_to_read) == 0:
continue

data = connection.pubsub_socket.recv(blen)
if not data:
Expand Down
4 changes: 2 additions & 2 deletions src/tests/integration/test_pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ def assert_callback(conn, result, data):
pubsub2 = SqliteCloudPubSub()
pubsub2.notify_channel(connection2, channel, "message-in-a-bottle")

client.disconnect(connection2)

# wait for callback to be called
flag.wait(30)

assert callback_called

client.disconnect(connection2)

def test_listen_table_for_update(self, sqlitecloud_connection):
connection, client = sqlitecloud_connection

Expand Down

0 comments on commit 119cf70

Please sign in to comment.