about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pgsanity/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/pgsanity/default.nix')
-rw-r--r--pkgs/development/python-modules/pgsanity/default.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/pgsanity/default.nix b/pkgs/development/python-modules/pgsanity/default.nix
new file mode 100644
index 000000000000..67c69aca2a25
--- /dev/null
+++ b/pkgs/development/python-modules/pgsanity/default.nix
@@ -0,0 +1,35 @@
+{ stdenv
+, python
+, fetchPypi
+, buildPythonPackage
+, postgresql }:
+
+buildPythonPackage rec {
+  pname = "pgsanity";
+  version = "0.2.9";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "de0bbd6fe4f98bf5139cb5f466eac2e2abaf5a7b050b9e4867b87bf360873173";
+  };
+
+  checkPhase = ''
+    ${python.interpreter} -m unittest discover -s test
+  '';
+
+  propagatedBuildInputs = [ postgresql ];
+
+  meta = with stdenv.lib; {
+    homepage = "http://github.com/markdrago/pgsanity";
+    description = "Checks the syntax of Postgresql SQL files";
+    longDescription = ''
+      PgSanity checks the syntax of Postgresql SQL files by
+      taking a file that has a list of bare SQL in it, 
+      making that file look like a C file with embedded SQL, 
+      run it through ecpg and 
+      let ecpg report on the syntax errors of the SQL.
+    '';
+    license = stdenv.lib.licenses.mit;
+    maintainers = with maintainers; [ nalbyuites ];
+  };
+}