-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from sqlitecloud/github-workflow-testing-code-q…
…uality GitHub workflow testing code quality
- Loading branch information
Showing
29 changed files
with
596 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[flake8] | ||
# E203: it's a parse limit of flake8 | ||
# W503,E501,E701: https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#w503 | ||
ignore = E203, W503, E501, E701 | ||
# align to black choice | ||
max-line-length = 88 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,12 +5,11 @@ name: Test and Release | |
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -32,16 +31,19 @@ jobs: | |
isort --diff --check-only src | ||
- name: Tests | ||
env: | ||
SQLITE_CONNECTION_STRING: ${{ secrets.SQLITE_CONNECTION_STRING }} | ||
SQLITE_CONNECTION_STRING: ${{ vars.SQLITE_CONNECTION_STRING }} | ||
SQLITE_USER: ${{ secrets.SQLITE_USER }} | ||
SQLITE_PASSWORD: ${{ secrets.SQLITE_PASSWORD }} | ||
SQLITE_API_KEY: ${{ secrets.SQLITE_API_KEY }} | ||
SQLITE_HOST: ${{ secrets.SQLITE_HOST }} | ||
SQLITE_DB: ${{ secrets.SQLITE_DB }} | ||
SQLITE_PORT: ${{ secrets.SQLITE_PORT }} | ||
SQLITE_HOST: ${{ vars.SQLITE_HOST }} | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ main.dSYM/ | |
.env | ||
*.pyc | ||
*.pyo | ||
.coverage | ||
|
||
.DS_Store | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# | ||
# Keep these versions requirements.txt versions aligned. | ||
# | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.2.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: detect-private-key | ||
- id: check-merge-conflict | ||
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster | ||
- repo: https://github.com/psf/black-pre-commit-mirror | ||
rev: 22.8.0 | ||
hooks: | ||
- id: black | ||
# It is recommended to specify the latest version of Python | ||
# supported by your project here, or alternatively use | ||
# pre-commit's default_language_version, see | ||
# https://pre-commit.com/#top_level-default_language_version | ||
language_version: python3.6 | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.10.1 | ||
hooks: | ||
- id: isort | ||
name: isort | ||
- repo: https://github.com/PyCQA/autoflake | ||
rev: v1.4 | ||
hooks: | ||
- id: autoflake | ||
name: autoflake | ||
args: | ||
- "--in-place" | ||
- "--expand-star-imports" | ||
- "--remove-duplicate-keys" | ||
- "--remove-unused-variables" | ||
- "--remove-unused-variables" | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 5.0.4 | ||
hooks: | ||
- id: flake8 | ||
name: flake8 | ||
# stages: [push] | ||
- repo: https://github.com/PyCQA/bandit | ||
rev: 1.7.1 | ||
hooks: | ||
- id: bandit | ||
name: bandit | ||
entry: bandit | ||
args: | ||
- "-b" | ||
- "bandit-baseline.json" | ||
- "--configfile" | ||
- "bandit.yaml" | ||
- "-r" | ||
- "src" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,28 @@ | ||
# 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) | ||
<p align="center"> | ||
<img src="https://sqlitecloud.io/social/logo.png" height="300" alt="SQLite Cloud logo"> | ||
</p> | ||
|
||
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. | ||
![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](https://sqlitecloud.io) 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. | ||
|
||
- Site: [https://sqlitecloud.io](https://sqlitecloud.io/developers) | ||
- Documentation: https://..._coming!_ | ||
- Source: [https://github.com/sqlitecloud/python](https://github.com/sqlitecloud/python) | ||
|
||
## Installation | ||
|
||
You can install SqliteCloud Package using Python Package Index (PYPI): | ||
|
||
```bash | ||
$ pip install SqliteCloud | ||
$ pip install sqlitecloud | ||
``` | ||
|
||
## Usage | ||
|
@@ -34,7 +46,7 @@ conn = client.open_connection() | |
#### _Using string configuration_ | ||
|
||
```python | ||
account = SqliteCloudAccount("sqlitecloud://user:[email protected]:port/dbname?timeout=10&key2=value2&key3=value3") | ||
account = SqliteCloudAccount("sqlitecloud://user:[email protected]:port/dbname?apikey=myapikey") | ||
client = SqliteCloudClient(cloud_account=account) | ||
conn = client.open_connection() | ||
``` | ||
|
@@ -55,8 +67,18 @@ for row in result: | |
print(row) | ||
``` | ||
|
||
### _Specific value_ | ||
```python | ||
result.get_value(0, 0) | ||
``` | ||
|
||
### _Column name_ | ||
```python | ||
result.get_name(0) | ||
``` | ||
|
||
### _Close connection_ | ||
|
||
```python | ||
```python | ||
client.disconnect(conn) | ||
``` |
Oops, something went wrong.