Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / pglast / default.nix
blob4edaa22bb16d94267bd0d489620672c8569df235
1 { lib
2 , buildPythonPackage
3 , fetchPypi
4 , pythonOlder
5 , setuptools
6 , pytest
7 }:
9 buildPythonPackage rec {
10   pname = "pglast";
11   version = "5.5";
12   format = "setuptools";
14   disabled = pythonOlder "3.7";
16   src = fetchPypi {
17     inherit pname version;
18     hash = "sha256-yz6Q+Vt7ZuT9NaxuQQA+BH7U6Efaim7No6GJmnOQo1o=";
19   };
21   propagatedBuildInputs = [
22     setuptools
23   ];
25   postPatch = ''
26     substituteInPlace setup.cfg \
27       --replace "--cov=pglast --cov-report term-missing" ""
28   '';
30   nativeCheckInputs = [
31     pytest
32   ];
34   # pytestCheckHook doesn't work
35   # ImportError: cannot import name 'parse_sql' from 'pglast'
36   checkPhase = ''
37     pytest
38   '';
40   pythonImportsCheck = [
41     "pglast"
42     "pglast.parser"
43   ];
45   meta = with lib; {
46     homepage = "https://github.com/lelit/pglast";
47     description = "PostgreSQL Languages AST and statements prettifier";
48     changelog = "https://github.com/lelit/pglast/blob/v${version}/CHANGES.rst";
49     license = licenses.gpl3Plus;
50     maintainers = with maintainers; [ marsam ];
51     mainProgram = "pgpp";
52   };