1{ lib
2, buildPythonPackage
3, fetchPypi
4, pythonOlder
5, setuptools
6, pytest
7}:
8
9buildPythonPackage rec {
10 pname = "pglast";
11 version = "3.17";
12 format = "setuptools";
13
14 disabled = pythonOlder "3.7";
15
16 src = fetchPypi {
17 inherit pname version;
18 hash = "sha256-C2SWuX6Lt4R62rkNJ9qOoVK50j+TUkhoGUw+seWjTQw=";
19 };
20
21 propagatedBuildInputs = [
22 setuptools
23 ];
24
25 postPatch = ''
26 substituteInPlace setup.cfg \
27 --replace "--cov=pglast --cov-report term-missing" ""
28 '';
29
30 checkInputs = [
31 pytest
32 ];
33
34 # pytestCheckHook doesn't work
35 # ImportError: cannot import name 'parse_sql' from 'pglast'
36 checkPhase = ''
37 pytest
38 '';
39
40 meta = with lib; {
41 homepage = "https://github.com/lelit/pglast";
42 description = "PostgreSQL Languages AST and statements prettifier";
43 changelog = "https://github.com/lelit/pglast/raw/v${version}/CHANGES.rst";
44 license = licenses.gpl3Plus;
45 maintainers = with maintainers; [ marsam ];
46 };
47}