47 lines
899 B
Nix
47 lines
899 B
Nix
{ lib
|
|
, buildPythonPackage
|
|
, fetchFromGitHub
|
|
, simpleeval
|
|
, pythonOlder
|
|
, coveralls
|
|
, wcmatch
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "casbin";
|
|
version = "1.15.5";
|
|
format = "setuptools";
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = pname;
|
|
repo = "pycasbin";
|
|
rev = "refs/tags/v${version}";
|
|
sha256 = "sha256-7q9zTuqdIUAiipA5kh8CwQa/TeiXGsKuGGvYYwTjObw=";
|
|
};
|
|
|
|
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 ];
|
|
};
|
|
}
|