e7ec2969af
GitOrigin-RevId: 9b19f5e77dd906cb52dade0b7bd280339d2a1f3d
53 lines
1 KiB
Nix
53 lines
1 KiB
Nix
{ lib
|
|
, buildPythonPackage
|
|
, fetchPypi
|
|
, pythonOlder
|
|
, setuptools
|
|
, pytest
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "pglast";
|
|
version = "5.8";
|
|
format = "setuptools";
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
hash = "sha256-+3ysQuGrAH5xCBKaP0T/PLfbmLuxiKHPB+76D32GG9E=";
|
|
};
|
|
|
|
propagatedBuildInputs = [
|
|
setuptools
|
|
];
|
|
|
|
postPatch = ''
|
|
substituteInPlace setup.cfg \
|
|
--replace "--cov=pglast --cov-report term-missing" ""
|
|
'';
|
|
|
|
nativeCheckInputs = [
|
|
pytest
|
|
];
|
|
|
|
# pytestCheckHook doesn't work
|
|
# ImportError: cannot import name 'parse_sql' from 'pglast'
|
|
checkPhase = ''
|
|
pytest
|
|
'';
|
|
|
|
pythonImportsCheck = [
|
|
"pglast"
|
|
"pglast.parser"
|
|
];
|
|
|
|
meta = with lib; {
|
|
homepage = "https://github.com/lelit/pglast";
|
|
description = "PostgreSQL Languages AST and statements prettifier";
|
|
changelog = "https://github.com/lelit/pglast/blob/v${version}/CHANGES.rst";
|
|
license = licenses.gpl3Plus;
|
|
maintainers = with maintainers; [ marsam ];
|
|
mainProgram = "pgpp";
|
|
};
|
|
}
|