1 { lib, buildPythonPackage, fetchFromGitHub, postgresql, testing-common-database
2 , pg8000, pytestCheckHook, psycopg2, sqlalchemy }:
4 buildPythonPackage rec {
5 pname = "testing.postgresql";
6 # Version 1.3.0 isn't working so let's use the latest commit from GitHub
7 version = "unstable-2017-10-31";
9 src = fetchFromGitHub {
12 rev = "c81ded434d00ec8424de0f9e1f4063c778c6aaa8";
13 sha256 = "1asqsi38di768i1sc1qm1k068dj0906ds6lnx7xcbxws0s25m2q3";
16 # Add PostgreSQL to search path
18 substituteInPlace src/testing/postgresql.py \
19 --replace "/usr/local/pgsql" "${postgresql}"
22 propagatedBuildInputs = [ testing-common-database pg8000 ];
24 # Fix tests for Darwin build. See:
25 # https://github.com/NixOS/nixpkgs/pull/74716#issuecomment-598546916
26 __darwinAllowLocalNetworking = true;
28 checkInputs = [ pytestCheckHook psycopg2 sqlalchemy ];
31 description = "Use temporary postgresql instance in testing";
32 homepage = "https://github.com/tk0miya/testing.postgresql";
33 license = licenses.asl20;
34 platforms = platforms.linux;
35 maintainers = with maintainers; [ jluttine ];