summary refs log tree commit diff
path: root/pkgs/development/python-modules/pq/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/pq/default.nix')
-rw-r--r--pkgs/development/python-modules/pq/default.nix41
1 files changed, 41 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/pq/default.nix b/pkgs/development/python-modules/pq/default.nix
new file mode 100644
index 00000000000..1227a674988
--- /dev/null
+++ b/pkgs/development/python-modules/pq/default.nix
@@ -0,0 +1,41 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, psycopg2
+, isPy27
+}:
+
+buildPythonPackage rec {
+  pname = "pq";
+  version = "1.8.1";
+  disabled = isPy27;
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "9e2c0195488263902ebc9da8df6c82bebe4ee32c79d9ecd0cdc2945afbf7ad32";
+  };
+
+  # psycopg2cffi is compatible with psycopg2 and author states that
+  # module is compatible with psycopg2
+  postConfigure = ''
+    substituteInPlace setup.py \
+      --replace "psycopg2cffi" "psycopg2"
+
+    substituteInPlace pq/tests.py \
+      --replace "psycopg2cffi" "psycopg2"
+  '';
+
+  checkInputs = [
+    psycopg2
+  ];
+
+  # tests require running postgresql cluster
+  doCheck = false;
+
+  meta = with lib; {
+    description = "PQ is a transactional queue for PostgreSQL";
+    homepage = https://github.com/malthe/pq/;
+    license = licenses.bsd3;
+    maintainers = [ maintainers.costrouc ];
+  };
+}