nixpkgs/pkgs/development/python-modules/casbin/default.nix
2022-05-21 14:36:42 +00:00

48 lines
899 B
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, simpleeval
, pythonOlder
, coveralls
, wcmatch
}:
buildPythonPackage rec {
pname = "casbin";
version = "1.16.5";
format = "setuptools";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = pname;
repo = "pycasbin";
rev = "refs/tags/v${version}";
sha256 = "sha256-27j1iuqf0af4Cm3r32FJnWnjvvUcacuv2+1OL6z/mwM=";
};
propagatedBuildInputs = [
simpleeval
wcmatch
];
checkInputs = [
coveralls
];
checkPhase = ''
coverage run -m unittest discover -s tests -t tests
'';
pythonImportsCheck = [
"casbin"
];
meta = with lib; {
description = "An authorization library that supports access control models like ACL, RBAC, ABAC in Python";
homepage = "https://github.com/casbin/pycasbin";
license = licenses.asl20;
maintainers = with maintainers; [ costrouc ];
};
}