2019-12-16 18:24:22 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, simpleeval
|
2021-11-18 22:01:32 +00:00
|
|
|
, pythonOlder
|
2019-12-16 18:24:22 +00:00
|
|
|
, coveralls
|
2021-09-22 21:13:48 +00:00
|
|
|
, wcmatch
|
2019-12-16 18:24:22 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "casbin";
|
2022-04-30 13:53:27 +00:00
|
|
|
version = "1.16.3";
|
2021-11-18 22:01:32 +00:00
|
|
|
format = "setuptools";
|
2019-12-16 18:24:22 +00:00
|
|
|
|
2021-11-18 22:01:32 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2019-12-16 18:24:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = "pycasbin";
|
2022-04-17 18:31:39 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2022-04-30 13:53:27 +00:00
|
|
|
sha256 = "sha256-7URIk76iQ1u59RM1VeqO5qqTg+0kCPtsP+2Y5CxCZ3I=";
|
2019-12-16 18:24:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
simpleeval
|
2021-09-22 21:13:48 +00:00
|
|
|
wcmatch
|
2019-12-16 18:24:22 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
coveralls
|
|
|
|
];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
coverage run -m unittest discover -s tests -t tests
|
|
|
|
'';
|
|
|
|
|
2021-09-22 21:13:48 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"casbin"
|
|
|
|
];
|
|
|
|
|
2019-12-16 18:24:22 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "An authorization library that supports access control models like ACL, RBAC, ABAC in Python";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/casbin/pycasbin";
|
2019-12-16 18:24:22 +00:00
|
|
|
license = licenses.asl20;
|
2021-09-22 21:13:48 +00:00
|
|
|
maintainers = with maintainers; [ costrouc ];
|
2019-12-16 18:24:22 +00:00
|
|
|
};
|
|
|
|
}
|