depot/third_party/nixpkgs/pkgs/development/python-modules/pycep-parser/default.nix

59 lines
1 KiB
Nix
Raw Normal View History

{ lib
, assertpy
, buildPythonPackage
, fetchFromGitHub
, lark
, poetry-core
, pytestCheckHook
, pythonOlder
, regex
, typing-extensions
}:
buildPythonPackage rec {
pname = "pycep-parser";
version = "0.3.2";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "gruebel";
repo = "pycep";
rev = version;
hash = "sha256-ud26xJQWdu7wtv75/K16HSSw0MvaSr3H1hDZBPjSzYE=";
};
nativeBuildInputs = [
poetry-core
];
propagatedBuildInputs = [
lark
regex
typing-extensions
];
checkInputs = [
assertpy
pytestCheckHook
];
postPatch = ''
substituteInPlace pyproject.toml \
--replace 'version = "0.3.2-alpha.4"' 'version = "${version}"' \
--replace 'regex = "^2022.3.2"' 'regex = "*"'
'';
pythonImportsCheck = [
"pycep"
];
meta = with lib; {
description = "Python based Bicep parser";
homepage = "https://github.com/gruebel/pycep";
license = with licenses; [ asl20 ];
maintainers = with maintainers; [ fab ];
};
}