1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4
5# tests
6, django
7, djangorestframework
8, python
9}:
10
11buildPythonPackage rec {
12 pname = "rules";
13 version = "3.3.0";
14 format = "setuptools";
15
16 src = fetchFromGitHub {
17 owner = "dfunckt";
18 repo = "django-rules";
19 rev = "v${version}";
20 hash = "sha256-UFRfRwcvxEn0fD3ScJJ7f/EHd93BOpY3cEF9QDryJZY=";
21 };
22
23 pythonImportsCheck = [
24 "rules"
25 ];
26
27 nativeCheckInputs = [
28 django
29 djangorestframework
30 ];
31
32 checkPhase = ''
33 runHook preCheck
34 ${python.interpreter} tests/manage.py test testsuite -v2
35 runHook postCheck
36 '';
37
38 meta = with lib; {
39 description = "Awesome Django authorization, without the database";
40 homepage = "https://github.com/dfunckt/django-rules";
41 changelog = "https://github.com/dfunckt/django-rules/blob/${src.rev}/CHANGELOG.md";
42 license = licenses.mit;
43 maintainers = with maintainers; [ hexa ];
44 };
45}