1 { buildPythonPackage, cffi, fetchFromGitHub, lib, postgresql, pytestCheckHook, six }:
3 buildPythonPackage rec {
4 pname = "psycopg2cffi";
8 # The original repo exists at https://github.com/chtd/psycopg2cffi, however
9 # this is mostly unmaintained and does not build for PyPy. Given that the
10 # whole point of this cffi alternative to psycopg2 is to use it with PyPy, I
11 # chose to use a working fork instead, which was linked in the relevant issue:
12 # https://github.com/chtd/psycopg2cffi/issues/113#issuecomment-730548574
14 # If/when these changes get merged back upstream we should revert to using the
15 # original source as opposed to the fork.
16 src = fetchFromGitHub {
19 rev = "c202b25cd861d5e8f0f55c329764ff1da9f020c0";
20 sha256 = "09hsnjkix1c0vlhmfvrp8pchpnz2ya4xrchyq15czj527nx2dmy2";
23 nativeBuildInputs = [ postgresql ];
24 propagatedBuildInputs = [ six cffi ];
25 checkInputs = [ pytestCheckHook ];
27 # NB: The tests need a postgres instance running to test against, and so we
31 pythonImportsCheck = [ "psycopg2cffi" ];
34 description = "An implementation of the psycopg2 module using cffi";
35 homepage = "https://pypi.org/project/psycopg2cffi/";
36 license = with licenses; [ lgpl3Plus ];
37 maintainers = with maintainers; [ lovesegfault ];