Skip to content

Commit e1ee1f5

Browse files
authored
Merge pull request #12 from aosingh/v1.0.3
v1.1.0
2 parents f6e6c5a + 4baeb5b commit e1ee1f5

18 files changed

Lines changed: 437 additions & 146 deletions

.github/workflows/sqlite_build.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@ on: push
33

44
jobs:
55
unittests:
6-
name:
6+
name: sqlite-rx unitests
77
runs-on: ${{ matrix.os }}
88
strategy:
99
fail-fast: false
1010
matrix:
1111
os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04]
12-
python-version: [3.6, 3.7, 3.8, 3.9, '3.10.0-beta.3', 'pypy3']
12+
python-version: ['3.7', '3.8', '3.9', '3.10', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9']
1313

1414
steps:
1515
- name: Checkout
1616
uses: actions/checkout@v2
1717

1818
- name: Setup Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v2
19+
uses: actions/setup-python@v4
2020
with:
2121
python-version: ${{ matrix.python-version }}
2222

2323
- name: Install Dependencies
2424
run: |
25-
python3 -m pip install --upgrade pip
26-
pip install click pytest coverage
25+
python3 -m pip install --upgrade pip setuptools
26+
pip install pytest coverage
2727
pip install -e .
2828
pip install coverage
2929

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ venv/
1414
start_server.py
1515
run_client.py
1616
curve_client.py
17+
.pypy3venv/
1718

Dockerfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
1-
FROM python:3-alpine as base
1+
FROM python:3.10.1-slim as base
22

33
COPY . /sqlite_rx
44

55
WORKDIR /svc
66

7-
RUN apk update && apk add build-base libzmq musl-dev zeromq-dev
8-
97
RUN pip install --upgrade pip
108
RUN pip install Cython
11-
RUN pip install wheel && pip wheel --wheel-dir=/svc/wheels /sqlite_rx
9+
RUN pip install wheel && pip wheel --wheel-dir=/svc/wheels /sqlite_rx[cli]
1210
RUN rm -rf /sqlite_rx
1311

1412

15-
FROM python:3-alpine
16-
RUN apk update && apk add libzmq
13+
FROM python:3.10.1-slim
1714

1815
COPY --from=base /svc /svc
1916
WORKDIR /svc

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Abhishek Singh & Contributors
3+
Copyright (c) 2022 Abhishek Singh & Contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

requirements.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
click
2-
msgpack
3-
pyzmq
4-
tornado
1+
billiard==4.0.0
2+
click==8.1.3
3+
msgpack==1.0.4
4+
pyzmq==23.2.0
5+
tornado==6.2

requirements_dev.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
coverage==6.3.2
2+
pip
3+
pytest==7.1.1
4+
setuptools
5+
twine

setup.cfg

Lines changed: 61 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,67 @@
1-
[nosetests]
2-
detailed-errors = 1
3-
with-coverage = 0
4-
verbosity = 2
5-
cover-package = sqlite_rx
6-
cover-html = 1
7-
tests = sqlite_rx/tests
1+
[metadata]
2+
name = sqlite_rx
3+
version = 1.1.0
4+
description = Python SQLite Client and Server
5+
long_description = file: README.md
6+
long_description_content_type = text/markdown
7+
keywords = sqlite, client, server, fast, secure
8+
url = https://aosingh.github.io/sqlite_rx/
9+
classifiers =
10+
Topic :: Database :: Database Engines/Servers
11+
Development Status :: 5 - Production/Stable
12+
Intended Audience :: Education
13+
Intended Audience :: Developers
14+
Intended Audience :: Science/Research
15+
Intended Audience :: System Administrators
16+
License :: OSI Approved :: MIT License
17+
Programming Language :: Python :: 3 :: Only
18+
Programming Language :: Python :: 3.7
19+
Programming Language :: Python :: 3.8
20+
Programming Language :: Python :: 3.9
21+
Operating System :: POSIX :: Linux
22+
Operating System :: Unix
23+
Operating System :: Microsoft :: Windows
24+
Operating System :: MacOS
25+
author = Abhishek Singh
26+
author_email = abhishek.singh20141@gmail.com
27+
maintainer = Abhishek Singh
28+
maintainer_email = abhishek.singh20141@gmail.com
29+
30+
[options]
31+
zip_safe = False
32+
packages = find:
33+
package_dir =
34+
sqlite_rx=sqlite_rx
35+
include_package_data = True
36+
scripts =
37+
bin/curve-keygen
38+
install_requires =
39+
billiard==4.0.2
40+
msgpack==1.0.4
41+
pyzmq==23.2.0
42+
tornado==6.2
43+
test_require =
44+
pytest==7.1.1
45+
coverage==6.3.2
46+
python_requires = >=3.7
47+
48+
[options.packages.find]
49+
where = sqlite_rx
50+
exclude = tests
51+
52+
[options.entry_points]
53+
console_scripts =
54+
sqlite-server = sqlite_rx.cli.server:main
55+
sqlite-client = sqlite_rx.cli.client:main
56+
57+
[options.extras_require]
58+
cli =
59+
click==8.0.4
60+
rich==12.0.1
61+
pygments==2.11.2
862

963
[coverage:run]
1064
branch = True
1165
concurrency = multiprocessing
1266
parallel = True
1367
source = sqlite_rx
14-
[easy_install]

setup.py

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,41 @@
1111

1212
VERSION = __version__
1313
DISTNAME = 'sqlite_rx'
14-
LICENSE = 'GNU GPLv3'
14+
LICENSE = 'MIT License'
1515
AUTHOR = 'Abhishek Singh'
1616
MAINTAINER = 'Abhishek Singh'
17-
MAINTAINER_EMAIL = 'aosingh@asu.edu'
18-
DESCRIPTION = ('Python SQLite Client and Server')
17+
MAINTAINER_EMAIL = 'abhishek.singh20141@gmail.com'
18+
DESCRIPTION = 'Python SQLite Client and Server'
1919
URL = 'https://github.com/aosingh/sqlite_rx'
2020

2121
PACKAGES = ['sqlite_rx']
2222

23-
DEPENDENCIES = ['msgpack', 'pyzmq', 'tornado', 'click', 'billiard']
23+
INSTALL_REQUIRES = ['msgpack==1.0.4',
24+
'pyzmq==23.2.0',
25+
'tornado==6.2',
26+
'billiard==4.0.2']
27+
28+
CLI_REQUIRES = ['click==8.1.3', 'rich==12.0.1', 'pygments==2.11.2']
29+
30+
TEST_REQUIRE = ['pytest==7.1.1',
31+
'coverage==6.3.2']
2432

2533
classifiers = [
34+
'Topic :: Database :: Database Engines/Servers',
2635
'Development Status :: 5 - Production/Stable',
2736
'Intended Audience :: Education',
2837
'Intended Audience :: Developers',
2938
'Intended Audience :: Science/Research',
3039
'Intended Audience :: System Administrators',
31-
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
40+
'License :: OSI Approved :: MIT License',
3241
'Programming Language :: Python :: 3 :: Only',
33-
'Programming Language :: Python :: 3.6',
3442
'Programming Language :: Python :: 3.7',
3543
'Programming Language :: Python :: 3.8',
3644
'Programming Language :: Python :: 3.9',
45+
'Programming Language :: Python :: 3.10',
3746
'Operating System :: POSIX :: Linux',
3847
'Operating System :: Unix',
3948
'Operating System :: Microsoft :: Windows',
40-
'Topic :: Database :: Database Engines/Servers',
4149
'Operating System :: MacOS'
4250
]
4351
keywords = 'sqlite client server fast secure'
@@ -56,15 +64,21 @@
5664
url=URL,
5765
version=VERSION,
5866
scripts=['bin/curve-keygen'],
59-
entry_points = {
67+
entry_points={
6068
'console_scripts': [
61-
'sqlite-server=sqlite_rx.cli:main'
69+
'sqlite-server=sqlite_rx.cli.server:main',
70+
'sqlite-client=sqlite_rx.cli.client:main'
6271
]
6372
},
73+
extras_require={
74+
'cli': CLI_REQUIRES
75+
},
6476
packages=find_packages(exclude=("tests",)),
6577
package_dir={'sqlite_rx': 'sqlite_rx'},
66-
install_requires=DEPENDENCIES,
78+
install_requires=INSTALL_REQUIRES,
79+
test_require=TEST_REQUIRE,
6780
include_package_data=True,
6881
classifiers=classifiers,
6982
keywords=keywords,
83+
python_requires='>=3.7'
7084
)

sqlite_rx/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
__version__ = "1.0.2"
1+
__version__ = "1.1.0"
22
__author__ = "Abhishek Singh"
3-
__authoremail__ = "aosingh@asu.edu"
3+
__authoremail__ = "abhishek.singh20141@gmail.com"
44

55

66
def get_default_logger_settings(level: str = "DEBUG"):
7-
87
return {
98
'version': 1,
109
'disable_existing_loggers': False,
@@ -43,4 +42,4 @@ def get_default_logger_settings(level: str = "DEBUG"):
4342

4443

4544
def get_version():
46-
return __version__
45+
return __version__

sqlite_rx/auth.py

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -199,16 +199,10 @@ def __init__(self,
199199
"""
200200

201201
self.my_id = key_id
202-
self.curvedir = destination_dir if destination_dir else os.path.join(
203-
os.path.expanduser("~"), ".curve")
204-
self.public_key = os.path.join(
205-
self.curvedir, "{}.key".format(self.my_id))
206-
self.private_key = os.path.join(
207-
self.curvedir,
208-
"{}.key_secret".format(
209-
self.my_id))
210-
self.authorized_clients_dir = os.path.join(
211-
self.curvedir, "authorized_clients")
202+
self.curvedir = destination_dir if destination_dir else os.path.join(os.path.expanduser("~"), ".curve")
203+
self.public_key = os.path.join(self.curvedir, "{}.key".format(self.my_id))
204+
self.private_key = os.path.join(self.curvedir, "{}.key_secret".format(self.my_id))
205+
self.authorized_clients_dir = os.path.join(self.curvedir, "authorized_clients")
212206

213207
def setup_secure_server(self,
214208
server,
@@ -225,9 +219,7 @@ def setup_secure_server(self,
225219
226220
"""
227221
try:
228-
foo, bar = zmq.auth.load_certificate(self.private_key)
229-
server.curve_publickey = foo
230-
server.curve_secretkey = bar
222+
server.curve_publickey, server.curve_secretkey = zmq.auth.load_certificate(self.private_key)
231223
server.curve_server = True
232224
LOG.info("Secure setup completed using on %s using curve key %s", bind_address, self.my_id)
233225
return server
@@ -259,17 +251,14 @@ def setup_secure_client(self,
259251
260252
"""
261253
try:
262-
foo, bar = zmq.auth.load_certificate(self.private_key)
263-
client.curve_publickey = foo
264-
client.curve_secretkey = bar
254+
client.curve_publickey, client.curve_secretkey = zmq.auth.load_certificate(self.private_key)
265255
except IOError:
266256
LOG.exception("Couldn't load the client private key: %s", self.private_key)
267257
raise
268258
else:
269259
# Clients need server's public key for encryption
270260
try:
271-
foo, _ = zmq.auth.load_certificate(os.path.join(self.curvedir, f"{servername}.key"))
272-
client.curve_serverkey = foo
261+
client.curve_serverkey, _ = zmq.auth.load_certificate(os.path.join(self.curvedir, f"{servername}.key"))
273262
except IOError:
274263
LOG.exception(
275264
"Couldn't load the server public key %s ", os.path.join(self.curvedir, f"{servername}.key"))

0 commit comments

Comments
 (0)