git.iko.soy/typeable/nixpkgs
on master help sign in
pythonPackages.testing-postgresql: init at unstable-2017-10-31
commite4fb0f324c5f3573dfc1040a20cec423d9acc950 authorJaakko Luttinen <jaakko.luttinen@iki.fi> dateWed 27 Nov 2019, 19:15 (7 years ago) parent11da668
2 files changed+39
pkgs/development/python-modules/testing-postgresql/default.nix+37 pkgs/top-level/python-packages.nix+2
pkgs/development/python-modules/testing-postgresql/default.nixnew file+37
@@ -0,0 +1,37 @@
1+{ lib, buildPythonPackage, fetchFromGitHub, postgresql, testing-common-database
2+, pg8000, pytestCheckHook, psycopg2, sqlalchemy }:
3+
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";
8+
9+ src = fetchFromGitHub {
10+ owner = "tk0miya";
11+ repo = pname;
12+ rev = "c81ded434d00ec8424de0f9e1f4063c778c6aaa8";
13+ sha256 = "1asqsi38di768i1sc1qm1k068dj0906ds6lnx7xcbxws0s25m2q3";
14+ };
15+
16+ # Add PostgreSQL to search path
17+ prePatch = ''
18+ substituteInPlace src/testing/postgresql.py \
19+ --replace "/usr/local/pgsql" "${postgresql}"
20+ '';
21+
22+ propagatedBuildInputs = [ testing-common-database pg8000 ];
23+
24+ # Fix tests for Darwin build. See:
25+ # https://github.com/NixOS/nixpkgs/pull/74716#issuecomment-598546916
26+ __darwinAllowLocalNetworking = true;
27+
28+ checkInputs = [ pytestCheckHook psycopg2 sqlalchemy ];
29+
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+ };
37+}
pkgs/top-level/python-packages.nix+2
@@ -7122,6 +7122,8 @@ in {
71227122
71237123 testing-common-database = callPackage ../development/python-modules/testing-common-database { };
71247124
7125+ testing-postgresql = callPackage ../development/python-modules/testing-postgresql { };
7126+
71257127 testpath = callPackage ../development/python-modules/testpath { };
71267128
71277129 testrepository = callPackage ../development/python-modules/testrepository { };