fa5436e0a7
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
50 lines
1 KiB
Nix
50 lines
1 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
fetchPypi,
|
|
pythonOlder,
|
|
setuptools,
|
|
pytest,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "pglast";
|
|
version = "6.2";
|
|
format = "setuptools";
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
hash = "sha256-mGP7o52Wun6AdE2jMAJBmLR10EmN50qzbMzB06BFXMg=";
|
|
};
|
|
|
|
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; [ ];
|
|
mainProgram = "pgpp";
|
|
};
|
|
}
|