From 6db00d5df6f135528c6038cfa4743081f013213d Mon Sep 17 00:00:00 2001 From: androiddrew Date: Tue, 26 Dec 2017 19:46:31 -0500 Subject: [PATCH] Added support for pypy Added support for pypy by changing the wsgi.py to import pyscopg2cffi if pyscopg2 is not available. Added missing dependencies for to the requirements.txt file. Added a pypyenv/ to the .gitignore. --- .gitignore | 1 + requirements.txt | 2 ++ wsgi.py | 7 +++++++ 3 files changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index cbf8643..68efbfc 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ __pycache__/ # Distribution / packaging .Python env/ +pypyenv/ build/ develop-eggs/ dist/ diff --git a/requirements.txt b/requirements.txt index cc94d7c..e900d54 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,9 @@ coreschema==0.0.4 idna==2.6 itypes==1.1.0 Jinja2==2.9.6 +Logbook==1.1.0 MarkupSafe==1.0 +marshmallow==2.15.0 psycopg2==2.7.3.1 py==1.4.34 pycparser==2.18 diff --git a/wsgi.py b/wsgi.py index 32014bf..7a7bf74 100644 --- a/wsgi.py +++ b/wsgi.py @@ -1,3 +1,10 @@ +try: + import psycopg2 +except ImportError: + # Fall back to psycopg2cffi + from psycopg2cffi import compat + compat.register() + import os import sys from cookie_api import JSONRenderer, Base, application_factory