2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, simpleeval
|
|
|
|
, isPy27
|
|
|
|
, coveralls
|
2021-09-23 15:35:13 +00:00
|
|
|
, wcmatch
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "casbin";
|
2021-10-04 12:37:57 +00:00
|
|
|
version = "1.9.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
disabled = isPy27;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = "pycasbin";
|
|
|
|
rev = "v${version}";
|
2021-10-04 12:37:57 +00:00
|
|
|
sha256 = "0awqdh4jsarf0lr2bl2qiaff1yk9vndq15jcl4abiig9wr2yghpc";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
simpleeval
|
2021-09-23 15:35:13 +00:00
|
|
|
wcmatch
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
coveralls
|
|
|
|
];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
coverage run -m unittest discover -s tests -t tests
|
|
|
|
'';
|
|
|
|
|
2021-09-23 15:35:13 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"casbin"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
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;
|
2021-09-23 15:35:13 +00:00
|
|
|
maintainers = with maintainers; [ costrouc ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|