depot/third_party/nixpkgs/pkgs/development/python-modules/pglast/default.nix
Default email 94427deb9d Project import generated by Copybara.
GitOrigin-RevId: f91ee3065de91a3531329a674a45ddcb3467a650
2023-05-24 16:37:59 +03:00

48 lines
996 B
Nix

{ lib
, buildPythonPackage
, fetchPypi
, pythonOlder
, setuptools
, pytest
}:
buildPythonPackage rec {
pname = "pglast";
version = "5.2";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-zj7/WGECL5Ou4F2FdFaA3M9F92ETZbhEXbZJ628gg0o=";
};
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
'';
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 = with maintainers; [ marsam ];
mainProgram = "pgpp";
};
}