1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, simpleeval
5, pythonOlder
6, coveralls
7, wcmatch
8}:
9
10buildPythonPackage rec {
11 pname = "casbin";
12 version = "1.11.1";
13 format = "setuptools";
14
15 disabled = pythonOlder "3.6";
16
17 src = fetchFromGitHub {
18 owner = pname;
19 repo = "pycasbin";
20 rev = "v${version}";
21 sha256 = "sha256-gFGYpHd1kp4JMtoe47VbJ0uDnuGQegggbjXaw6nEMR4=";
22 };
23
24 propagatedBuildInputs = [
25 simpleeval
26 wcmatch
27 ];
28
29 checkInputs = [
30 coveralls
31 ];
32
33 checkPhase = ''
34 coverage run -m unittest discover -s tests -t tests
35 '';
36
37 pythonImportsCheck = [
38 "casbin"
39 ];
40
41 meta = with lib; {
42 description = "An authorization library that supports access control models like ACL, RBAC, ABAC in Python";
43 homepage = "https://github.com/casbin/pycasbin";
44 license = licenses.asl20;
45 maintainers = with maintainers; [ costrouc ];
46 };
47}