summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/django-waffle/default.nix
blob: 95cdf739e689efb9f905e8ff54219876841a106c (plain)
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
{
  buildPythonPackage,
  fetchFromGitHub,
  django,
  lib,
  setuptools,
  pytestCheckHook,
  pytest-django,
}:

buildPythonPackage (finalAttrs: {
  pname = "django-waffle";
  version = "5.0.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "django-waffle";
    repo = "django-waffle";
    tag = "v${finalAttrs.version}";
    hash = "sha256-wirB2Y4iONmAMVt9o8aTkeB1WQzcvktQOAMEeXMM1x8=";
  };

  patches = [
    # Middleware object requires a request -> response callable
    ./middleware-compat.patch
  ];

  build-system = [ setuptools ];

  dependencies = [ django ];

  nativeCheckInputs = [
    pytest-django
    pytestCheckHook
  ];

  preCheck = ''
    export DJANGO_SETTINGS_MODULE=test_settings
  '';

  meta = {
    changelog = "https://github.com/django-waffle/django-waffle/releases/tag/${finalAttrs.src.tag}";
    description = "Feature flipper for Django";
    homepage = "https://waffle.readthedocs.io/en/stable/";
    maintainers = [ lib.maintainers.ma27 ];
    license = lib.licenses.bsd3;
  };
})