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 22:13:48 +01:00
|
|
|
, wcmatch
|
2019-12-16 18:24:22 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "casbin";
|
2022-05-21 15:36:42 +01:00
|
|
|
version = "1.16.5";
|
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 19:31:39 +01:00
|
|
|
rev = "refs/tags/v${version}";
|
2022-05-21 15:36:42 +01:00
|
|
|
sha256 = "sha256-27j1iuqf0af4Cm3r32FJnWnjvvUcacuv2+1OL6z/mwM=";
|
2019-12-16 18:24:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
simpleeval
|
2021-09-22 22:13:48 +01: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 22:13:48 +01: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 02:11:51 +01:00
|
|
|
homepage = "https://github.com/casbin/pycasbin";
|
2019-12-16 18:24:22 +00:00
|
|
|
license = licenses.asl20;
|
2021-09-22 22:13:48 +01:00
|
|
|
maintainers = with maintainers; [ costrouc ];
|
2019-12-16 18:24:22 +00:00
|
|
|
};
|
|
|
|
}
|