Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source = sqlite_rx
concurrency =
thread
multiprocessing
debug =
debug =
multiproc
omit =
/*/tests/*
Expand All @@ -14,8 +14,8 @@ omit =
/home/travis/virtualenv/*
./sqlite_rx/run_client.py
./sqlite_rx/start_server.py
# plugins =
# plugins =
# billiard_coverage_plugin

[html]
directory = htmlcov
directory = htmlcov
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ start_server.py
run_client.py
curve_client.py
.github

10 changes: 4 additions & 6 deletions .github/workflows/sqlite_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.8', 'pypy-3.9', 'pypy3.10']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', 'pypy3.10', 'pypy3.11']

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -25,11 +25,9 @@ jobs:
python3 -m pip install --upgrade pip setuptools
pip install pytest coverage
pip install -e .
pip install coverage


- name: Run Unittests
run: |
coverage run -m pytest --verbose sqlite_rx/tests
coverage combine
coverage report -m

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ start_server.py
run_client.py
curve_client.py
.pypy3venv/

18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
args: ['--maxkb=2000']
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.291
hooks:
- id: ruff
args: ["check", "--select", "I", "--fix"]
31 changes: 27 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
FROM python:3.10.5-slim as base
FROM python:3-slim AS base

ARG USERNAME=sqliteuser
ARG UID=1001
ARG GID=1001
ARG HOME_DIR=/home/${USERNAME}

# Upgrade OS packages
RUN set -ex \
&& apt-get update \
&& apt-get upgrade -y \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Create the group and user
RUN groupadd --gid ${GID} ${USERNAME} \
&& useradd -m -u ${UID} -g ${GID} -d ${HOME_DIR} -s /bin/bash ${USERNAME}

RUN chown ${USER_NAME}:${USERNAME} ${HOME_DIR}

FROM base AS builder
COPY . /sqlite_rx

WORKDIR /svc
Expand All @@ -10,10 +30,13 @@ RUN pip install wheel && pip wheel --wheel-dir=/svc/wheels /sqlite_rx[cli]
RUN rm -rf /sqlite_rx


FROM python:3.10.5-slim
FROM base

COPY --from=base /svc /svc
COPY --from=builder /svc /svc
WORKDIR /svc

RUN pip install --upgrade pip
RUN pip install --no-index /svc/wheels/*.whl
RUN pip install --no-index /svc/wheels/*.whl

USER ${USERNAME}
WORKDIR ${HOME_DIR}
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
# sqlite_rx
# sqlite_rx
[![PyPI version](https://badge.fury.io/py/sqlite-rx.svg)](https://pypi.python.org/pypi/sqlite-rx) [![sqlite-rx](https://github.com/aosingh/sqlite_rx/actions/workflows/sqlite_build.yaml/badge.svg)](https://github.com/aosingh/sqlite_rx/actions) [![Downloads](https://pepy.tech/badge/sqlite-rx)](https://pepy.tech/project/sqlite-rx)


[![Python 3.8](https://img.shields.io/badge/python-3.8-blue.svg)](https://www.python.org/downloads/release/python-380/)
[![Python 3.9](https://img.shields.io/badge/python-3.9-blue.svg)]((https://www.python.org/downloads/release/python-390/))
[![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-3100/)
[![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/release/python-3110/)
[![Python 3.12](https://img.shields.io/badge/python-3.12-blue.svg)](https://www.python.org/downloads/release/python-3120/)
[![Python 3.13](https://img.shields.io/badge/python-3.13-blue.svg)](https://www.python.org/downloads/release/python-3130/)
[![Python 3.14](https://img.shields.io/badge/python-3.14-blue.svg)](https://www.python.org/downloads/release/python-3140/)


[![PyPy3.8](https://img.shields.io/badge/python-PyPy3.8-blue.svg)](https://www.pypy.org/download.html)
[![PyPy3.9](https://img.shields.io/badge/python-PyPy3.9-blue.svg)](https://www.pypy.org/download.html)
[![PyPy3.10](https://img.shields.io/badge/python-PyPy3.10-blue.svg)](https://www.pypy.org/download.html)
[![PyPy3.11](https://img.shields.io/badge/python-PyPy3.11-blue.svg)](https://www.pypy.org/download.html)


#### For documentation, usage and examples refer [https://aosingh.github.io/sqlite_rx/](https://aosingh.github.io/sqlite_rx/)

# Introduction

[SQLite](https://www.sqlite.org/index.html) is a lightweight database written in C.
[SQLite](https://www.sqlite.org/index.html) is a lightweight database written in C.
Python has in-built support to interact with the database (locally) which is either stored on disk or in memory.

With `sqlite_rx`, clients should be able to communicate with an `SQLiteServer` in a fast, simple and secure manner and execute queries remotely.
Expand Down Expand Up @@ -47,10 +46,10 @@ from sqlite_rx.server import SQLiteServer

def main():

# database is a path-like object giving the pathname
# of the database file to be opened.
# You can use ":memory:" to open a database connection to a database
# database is a path-like object giving the pathname
# of the database file to be opened.

# You can use ":memory:" to open a database connection to a database
# that resides in RAM instead of on disk

server = SQLiteServer(database=":memory:",
Expand Down Expand Up @@ -85,4 +84,3 @@ with client:

{'error': None, 'items': []}
```

2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ services:
- data:/data

volumes:
data: {}
data: {}
2 changes: 1 addition & 1 deletion docker_examples/docker-compose-curvezmq.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ services:
- /Users/as/.curve:/root/.curve

volumes:
data: {}
data: {}
2 changes: 1 addition & 1 deletion docker_examples/docker-compose-ondisk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ services:
- data:/data

volumes:
data: {}
data: {}
2 changes: 1 addition & 1 deletion docker_examples/docker-compose-pypy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ services:
- data:/data

volumes:
data: {}
data: {}
2 changes: 1 addition & 1 deletion docker_examples/docker-compose-zapcurvezmq.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ services:
- /Users/as/.curve:/root/.curve

volumes:
data: {}
data: {}
1 change: 0 additions & 1 deletion dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ WORKDIR /svc

RUN pip install --upgrade pip
RUN pip install --no-index --find-links=/svc/wheels sqlite_rx

2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile_pypy3
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ COPY . /sqlite_rx
WORKDIR /sqlite_rx

RUN pypy3 -m pip install -r requirements.txt
RUN pypy3 setup.py install
RUN pypy3 setup.py install
100 changes: 99 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,101 @@
[build-system]
requires = ['setuptools >= 40.8.0', 'wheel']
build-backend = "setuptools.build_meta"
build-backend = "setuptools.build_meta"

[project]
name = "sqlite_rx"
dynamic = ["version"]
description = "Python SQLite Client and Server"
readme = {file = "README.md", content-type = "text/markdown"}
requires-python = ">=3.10"
authors = [
{name="Abhishek Singh", email="abhishek.singh20141@gmail.com"}
]
maintainers =[
{name="Abhishek Singh", email="abhishek.singh20141@gmail.com"}
]
keywords = [
"sqlite",
"server",
"client",
"secure"
]
license = "MIT"
license-files = ["LICENSE"]
classifiers = [
"Topic :: Database :: Database Engines/Servers",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Education",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Intended Audience :: System Administrators",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Operating System :: POSIX :: Linux",
"Operating System :: Unix",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS"
]
dependencies = [
"msgpack",
"tornado",
"pyzmq",
"billiard"
]

[project.optional-dependencies]
test = [
"coverage",
"pytest",
]
cli = [
"click",
"rich",
"pygments",
]

[project.scripts]
curve-keygen = "sqlite_rx.cli.keygen:main"
sqlite-server = "sqlite_rx.cli.server:main"
sqlite-client = "sqlite_rx.cli.client:main"


[project.urls]
Homepage = "https://github.com/aosingh/sqlite_rx"
Repository = "https://github.com/aosingh/sqlite_rx"
Issues = "https://github.com/aosingh/sqlite_rx/issues"
Documentation = "https://aosingh.github.io/sqlite_rx/"
CI = "https://github.com/aosingh/sqlite_rx/actions"

[tool.setuptools]
packages = ["sqlite_rx", "sqlite_rx.cli"]

[tool.setuptools.dynamic]
version = { attr = "sqlite_rx.version.__version__" }

[tool.black]
line-length = 79
target-version = ["py310", "py311", "py312", "py313"]
required-version = 24

[tool.ruff]
line-length = 79
target-version = "py310"
per-file-ignores = { "__init__.py" = ["F401"] }

[tool.pytest.ini_options]
minversion = "8.3.0"
testpaths = [
"tests"
]

[tools.coverage.run]
branch = true
concurrency = "multiprocessing"
parallel = true
source = "sqlite_rx"
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
billiard==4.2.1
click==8.1.7
msgpack==1.1.0
pyzmq==26.2.0
tornado==6.4.2
billiard
click
msgpack
pyzmq
tornado
1 change: 1 addition & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ wheel
pytest
setuptools
twine
pre-commit
Loading