about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pglast/default.nix
blob: c3b34b1fc19982ea4a7ccde1ab8925fdb9087ebe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ lib
, buildPythonPackage
, fetchPypi
, isPy3k
, setuptools
, pytest
}:

buildPythonPackage rec {
  pname = "pglast";
  version = "3.7";

  src = fetchPypi {
    inherit pname version;
    sha256 = "3f0f36cebdb68d5b3aaacb11cbf09db44250194845fbf3b49b0aef93c30991bf";
  };

  disabled = !isPy3k;

  # ModuleNotFoundError: No module named 'pkg_resources'
  propagatedBuildInputs = [ setuptools ];

  postPatch = ''
    substituteInPlace setup.cfg \
      --replace "--cov=pglast --cov-report term-missing" ""
  '';

  checkInputs = [ pytest ];

  # pytestCheckHook doesn't work
  # ImportError: cannot import name 'parse_sql' from 'pglast'
  checkPhase = ''
    pytest
  '';

  meta = with lib; {
    homepage = "https://github.com/lelit/pglast";
    description = "PostgreSQL Languages AST and statements prettifier";
    changelog = "https://github.com/lelit/pglast/raw/v${version}/CHANGES.rst";
    license = licenses.gpl3Plus;
    maintainers = [ maintainers.marsam ];
  };
}