nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchPypi,
4 buildPythonPackage,
5 postgresql,
6 unittestCheckHook,
7}:
8
9buildPythonPackage rec {
10 pname = "pgsanity";
11 version = "0.3.0";
12 format = "setuptools";
13
14 src = fetchPypi {
15 inherit pname version;
16 sha256 = "sha256-Po/DPQpk54w1gWOL9aArN6I8dmMb7uRYxuRMI6MIDKU=";
17 };
18
19 nativeCheckInputs = [
20 unittestCheckHook
21 ];
22
23 unittestFlagsArray = [ "test" ];
24
25 propagatedBuildInputs = [ postgresql ];
26
27 # To find "ecpg"
28 nativeBuildInputs = [ (lib.getDev postgresql) ];
29
30 meta = {
31 homepage = "https://github.com/markdrago/pgsanity";
32 description = "Checks the syntax of Postgresql SQL files";
33 mainProgram = "pgsanity";
34 longDescription = ''
35 PgSanity checks the syntax of Postgresql SQL files by
36 taking a file that has a list of bare SQL in it,
37 making that file look like a C file with embedded SQL,
38 run it through ecpg and
39 let ecpg report on the syntax errors of the SQL.
40 '';
41 license = lib.licenses.mit;
42 maintainers = with lib.maintainers; [ nalbyuites ];
43 };
44}