Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 hatchling,
7 django,
8 redis,
9 rq,
10 prometheus-client,
11 sentry-sdk,
12 pytest-django,
13 pytestCheckHook,
14 pyyaml,
15 redisTestHook,
16}:
17
18buildPythonPackage rec {
19 pname = "django-rq";
20 version = "3.2.2";
21 pyproject = true;
22
23 src = fetchFromGitHub {
24 owner = "rq";
25 repo = "django-rq";
26 tag = "v${version}";
27 hash = "sha256-vKvEFySTgIWqe6RYnl3POtjCEbCJZsRKL2KcRs9bv30=";
28 };
29
30 build-system = [ hatchling ];
31
32 dependencies = [
33 django
34 redis
35 rq
36 ];
37
38 optional-dependencies = {
39 prometheus = [ prometheus-client ];
40 sentry = [ sentry-sdk ];
41 };
42
43 pythonImportsCheck = [ "django_rq" ];
44
45 # redis hook does not support darwin
46 doCheck = !stdenv.hostPlatform.isDarwin;
47
48 nativeCheckInputs = [
49 pytest-django
50 pytestCheckHook
51 pyyaml
52 redisTestHook
53 ]
54 ++ lib.concatAttrValues optional-dependencies;
55
56 preCheck = ''
57 export DJANGO_SETTINGS_MODULE=tests.settings
58 '';
59
60 meta = {
61 description = "Simple app that provides django integration for RQ (Redis Queue)";
62 homepage = "https://github.com/rq/django-rq";
63 changelog = "https://github.com/rq/django-rq/releases/tag/${src.tag}";
64 license = lib.licenses.mit;
65 maintainers = with lib.maintainers; [ hexa ];
66 };
67}