about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/django-login-required-middleware/default.nix
blob: 6c69ef7ef27af6f61eb67dc2489f0a119fae0ebc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{ lib
, buildPythonPackage
, django
, djangorestframework
, fetchFromGitHub
, python
, setuptools-scm
}:

buildPythonPackage rec {
  pname = "django-login-required-middleware";
  version = "0.9.0";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "CleitonDeLima";
    repo = pname;
    rev = "refs/tags/${version}";
    hash = "sha256-WFQ/JvKh6gkUxPV27QBd2TzwFS8hfQGmcTInTnmh6iA=";
  };

  SETUPTOOLS_SCM_PRETEND_VERSION = version;

  nativeBuildInputs = [
    setuptools-scm
  ];

  propagatedBuildInputs = [
    django
  ];

  checkInputs = [
    djangorestframework
  ];

  pythonImportsCheck = [
    "login_required"
  ];

  checkPhase = ''
    ${python.interpreter} -m django test --settings tests.settings
  '';

  meta = with lib; {
    description = "Requires login to all requests through middleware in Django";
    homepage = "https://github.com/CleitonDeLima/django-login-required-middleware";
    license = licenses.mit;
    maintainers = with maintainers; [ onny ];
  };
}