Skip to content

Commit 95b3a1c

Browse files
authored
Merge pull request #3 from aosingh/pypy3
Pypy3
2 parents 0b6d55c + c0385c1 commit 95b3a1c

10 files changed

Lines changed: 52 additions & 17 deletions

File tree

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ language: python
22
os:
33
- linux
44
python:
5+
- "3.6"
56
- "3.7"
67
- "3.8"
8+
- "pypy3"
79
script:
810
- pip install nose
911
- pip install coverage

Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
FROM alpine:edge
1+
FROM pypy:3-slim
22

3-
RUN apk update && apk add build-base libzmq musl-dev python3 python3-dev zeromq-dev py-pip
3+
RUN apt-get update
4+
RUN apt-get -y install g++
5+
RUN apt-get -y install libzmq3-dev
46

57
COPY . /sqlite_rx
68
WORKDIR /sqlite_rx
79

8-
RUN pip install -U Cython
9-
RUN pip install -r requirements.txt
10-
RUN pip install -e .
10+
RUN pypy3 -m pip install -r requirements.txt
11+
RUN pypy3 setup.py install

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# sqlite_rx [![Travis](https://travis-ci.org/aosingh/sqlite_rx.svg?branch=master)](https://travis-ci.org/aosingh/sqlite_rx) [![Python 3.7](https://img.shields.io/badge/python-3.7-blue.svg)](https://www.python.org/downloads/release/python-370/) [![Python 3.8](https://img.shields.io/badge/python-3.8-blue.svg)](https://www.python.org/downloads/release/python-380/) [![PyPI version](https://badge.fury.io/py/sqlite-rx.svg)](https://pypi.python.org/pypi/sqlite-rx) [![Coverage Status](https://coveralls.io/repos/github/aosingh/sqlite_rx/badge.svg?branch=master)](https://coveralls.io/github/aosingh/sqlite_rx?branch=master)
2-
1+
# sqlite_rx [![Travis](https://travis-ci.org/aosingh/sqlite_rx.svg?branch=master)](https://travis-ci.org/aosingh/sqlite_rx) [![PyPI version](https://badge.fury.io/py/sqlite-rx.svg)](https://pypi.python.org/pypi/sqlite-rx) [![Coverage Status](https://coveralls.io/repos/github/aosingh/sqlite_rx/badge.svg?branch=master)](https://coveralls.io/github/aosingh/sqlite_rx?branch=master)
2+
[![Python 3.6](https://img.shields.io/badge/python-3.6-blue.svg)]((https://www.python.org/downloads/release/python-370/)) [![Python 3.7](https://img.shields.io/badge/python-3.7-blue.svg)](https://www.python.org/downloads/release/python-370/) [![Python 3.8](https://img.shields.io/badge/python-3.8-blue.svg)](https://www.python.org/downloads/release/python-380/)
3+
[![PyPy3](https://img.shields.io/badge/python-PyPy3-blue.svg)](https://www.pypy.org/index.html)
34
## Background
45

56
[SQLite](https://www.sqlite.org/index.html) is a lightweight database written in C.

docker-compose.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ services:
33

44
sqlite_server:
55
image: aosingh/sqlite_rx
6-
command: sqlite-server --zap --curvezmq --log-level DEBUG --database /data/database.db --key-id id_server_Abhisheks-MacBook-Pro.local_curve
6+
command: sqlite-server --log-level DEBUG --database /data/database.db
77
ports:
8-
- 5000:5000
8+
- 5001:5000
99
volumes:
10-
- data:/data
11-
- /Users/as/.curve:/root/.curve
10+
- data:/data
1211

1312
volumes:
1413
data: {}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: "3"
2+
services:
3+
4+
sqlite_server:
5+
image: aosingh/sqlite_rx_pypy
6+
command: sqlite-server --log-level DEBUG --database /data/database.db
7+
ports:
8+
- 5000:5000
9+
volumes:
10+
- data:/data
11+
12+
volumes:
13+
data: {}

dockerfiles/Dockerfile_cpython

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM alpine:edge
2+
3+
RUN apk update && apk add build-base libzmq musl-dev python3 python3-dev zeromq-dev py-pip
4+
5+
COPY . /sqlite_rx
6+
WORKDIR /sqlite_rx
7+
8+
RUN pip install -U Cython
9+
RUN pip install -r requirements.txt
10+
RUN pip install -e .

sqlite_rx/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.9.97"
1+
__version__ = "0.9.98"
22
__author__ = "Abhishek Singh"
33
__authoremail__ = "aosingh@asu.edu"
44

sqlite_rx/cli/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import logging.config
22

33
import click
4+
import platform
45

56
from pprint import pformat
67

@@ -28,6 +29,7 @@ def main(log_level,
2829
curve_dir,
2930
key_id):
3031
logging.config.dictConfig(get_default_logger_settings(level=log_level))
32+
LOG.info("Python Platform %s" % platform.python_implementation())
3133
kwargs = {
3234
'bind_address': f'tcp://{advertise_host}:{port}',
3335
'database': database,

sqlite_rx/server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ def setup(self):
5555
"""Creates a ZMQ `context` and a Tornado `eventloop` for the SQLiteServer process
5656
"""
5757
self.context = zmq.Context()
58-
self.loop = ioloop.IOLoop.instance()
58+
self.loop = ioloop.IOLoop()
59+
# self.loop = ioloop.IOLoop.instance()
5960

6061
def stream(self,
6162
sock_type,

sqlite_rx/tests/test_authenticated_server.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import logging.config
22
import os
3+
import platform
34
import shutil
45
import socket
56
import tempfile
@@ -13,6 +14,11 @@
1314

1415
logging.config.dictConfig(get_default_logger_settings(level="DEBUG"))
1516

17+
sqlite_error_prefix = "sqlite3.OperationalError"
18+
19+
if platform.python_implementation() == "PyPy":
20+
sqlite_error_prefix = "_sqlite3.OperationalError"
21+
1622
@contextmanager
1723
def get_server_auth_files():
1824
with tempfile.TemporaryDirectory() as curve_dir:
@@ -66,8 +72,8 @@ def test_table_not_present(self):
6672
expected_result = {
6773
'items': [],
6874
'error': {
69-
'message': 'sqlite3.OperationalError: no such table: IDOLS',
70-
'type': 'sqlite3.OperationalError'}}
75+
'message': '{0}: no such table: IDOLS'.format(sqlite_error_prefix),
76+
'type': '{0}'.format(sqlite_error_prefix)}}
7177
self.assertIsInstance(result, dict)
7278
self.assertDictEqual(result, expected_result)
7379

@@ -110,8 +116,8 @@ def test_not_present_without_zap(self):
110116
expected_result = {
111117
'items': [],
112118
'error': {
113-
'message': 'sqlite3.OperationalError: no such table: IDOLS',
114-
'type': 'sqlite3.OperationalError'}}
119+
'message': '{0}: no such table: IDOLS'.format(sqlite_error_prefix),
120+
'type': '{0}'.format(sqlite_error_prefix)}}
115121
self.assertIsInstance(result, dict)
116122
self.assertDictEqual(result, expected_result)
117123

0 commit comments

Comments
 (0)