11 buildPythonPackage rec {
12 pname = "psycopg2cffi";
14 format = "setuptools";
17 # The original repo exists at https://github.com/chtd/psycopg2cffi, however
18 # this is mostly unmaintained and does not build for PyPy. Given that the
19 # whole point of this cffi alternative to psycopg2 is to use it with PyPy, I
20 # chose to use a working fork instead, which was linked in the relevant issue:
21 # https://github.com/chtd/psycopg2cffi/issues/113#issuecomment-730548574
23 # If/when these changes get merged back upstream we should revert to using the
24 # original source as opposed to the fork.
25 src = fetchFromGitHub {
28 rev = "c202b25cd861d5e8f0f55c329764ff1da9f020c0";
29 sha256 = "09hsnjkix1c0vlhmfvrp8pchpnz2ya4xrchyq15czj527nx2dmy2";
32 nativeBuildInputs = [ postgresql ];
34 propagatedBuildInputs = [ six cffi ];
36 nativeCheckInputs = [ postgresqlTestHook pytestCheckHook ];
39 # AssertionError: '{}' != []
44 PGDATABASE = "psycopg2_test";
47 pythonImportsCheck = [ "psycopg2cffi" ];
50 description = "An implementation of the psycopg2 module using cffi";
51 homepage = "https://pypi.org/project/psycopg2cffi/";
52 license = with licenses; [ lgpl3Plus ];
53 maintainers = with maintainers; [ lovesegfault ];