linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / python-modules / testing-postgresql / default.nix
blob7ebff6ccc365e7da26b7153dbc6c840c3c650447
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 {
10     owner = "tk0miya";
11     repo = pname;
12     rev = "c81ded434d00ec8424de0f9e1f4063c778c6aaa8";
13     sha256 = "1asqsi38di768i1sc1qm1k068dj0906ds6lnx7xcbxws0s25m2q3";
14   };
16   # Add PostgreSQL to search path
17   prePatch = ''
18     substituteInPlace src/testing/postgresql.py \
19       --replace "/usr/local/pgsql" "${postgresql}"
20   '';
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 ];
30   meta = with lib; {
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 ];
36   };