diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 59622dd..88ea316 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/.github/workflows/pypi-release.yaml b/.github/workflows/pypi-release.yaml index e92a2b3..6903a3c 100644 --- a/.github/workflows/pypi-release.yaml +++ b/.github/workflows/pypi-release.yaml @@ -23,6 +23,9 @@ jobs: - name: Update version in setup.py run: >- sed -i "s/{{VERSION_PLACEHOLDER}}/${{ steps.tag.outputs.TAG_NAME }}/g" src/setup.py + - name: Include README in package + run: >- + cp README.md src/README.md - name: Build a binary wheel run: | cd src diff --git a/requirements.txt b/requirements.txt index ae5cd32..def1ed3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -lz4==3.1.10 +lz4>=3.1.10 # last version to support Python 3.6 diff --git a/src/MANIFEST.in b/src/MANIFEST.in index ea4b992..fd83249 100644 --- a/src/MANIFEST.in +++ b/src/MANIFEST.in @@ -1 +1,2 @@ -include README-PYPI.md +# copied from main README +include README.md diff --git a/src/README-PYPI.md b/src/README-PYPI.md deleted file mode 100644 index 0ed4bd4..0000000 --- a/src/README-PYPI.md +++ /dev/null @@ -1,63 +0,0 @@ -# Python SDK for SqliteCloud - -![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) - -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. - - -## Installation - -You can install SqliteCloud Package using Python Package Index (PYPI): - -```bash -$ pip install SqliteCloud -``` - -## Usage -
- -```python -from sqlitecloud.client import SqliteCloudClient -from sqlitecloud.types import SqliteCloudAccount - -``` - -### _Init a connection_ - -#### Using explicit configuration - -```python -account = SqliteCloudAccount(user, password, host, db_name, port) -client = SqliteCloudClient(cloud_account=account) -conn = client.open_connection() -``` - -#### _Using string configuration_ - -```python -account = SqliteCloudAccount("sqlitecloud://user:pass@host.com:port/dbname?timeout=10&key2=value2&key3=value3") -client = SqliteCloudClient(cloud_account=account) -conn = client.open_connection() -``` - -### _Execute a query_ -You can bind values to parametric queries: you can pass parameters as positional values in an array -```python -result = client.exec_query( - "SELECT * FROM table_name WHERE id = 1" - conn=conn -) -``` - -### _Iterate result_ -result is an iterable object -```python -for row in result: - print(row) -``` - -### _Close connection_ - -```python -client.disconnect(conn) -``` diff --git a/src/setup.py b/src/setup.py index 98fdc32..3c4c2f1 100644 --- a/src/setup.py +++ b/src/setup.py @@ -1,32 +1,22 @@ -import io -import os +from pathlib import Path from setuptools import find_packages, setup +# read the contents of your README file -def read_file(filename): - base_path = os.path.abspath(os.path.dirname(__file__)) - full_path = os.path.join(base_path, filename) - try: - with io.open(full_path, encoding="utf-8") as file: - return file.read() - except FileNotFoundError: - full_path = os.path.join(base_path, f"../{filename}") - with io.open(full_path, encoding="utf-8") as file: - return file.read() - +long_description = (Path(__file__).parent / "README.md").read_text() setup( name="SqliteCloud", version="0.0.76", author="sqlitecloud.io", description="A Python package for working with SQLite databases in the cloud.", - long_description=read_file("README-PYPI.md"), + long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/sqlitecloud/python", packages=find_packages(), install_requires=[ - "lz4 == 3.1.10", + "lz4 >= 3.1.10", ], classifiers=[ "Development Status :: 3 - Alpha",