1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 buildPythonPackage,
6 pythonOlder,
7
8 # build-system
9 hatchling,
10
11 # dependencies
12 click,
13 redis,
14
15 # tests
16 psutil,
17 pytestCheckHook,
18 redis-server,
19 sentry-sdk,
20}:
21
22buildPythonPackage rec {
23 pname = "rq";
24 version = "1.16.2";
25 pyproject = true;
26
27 disabled = pythonOlder "3.7";
28
29 src = fetchFromGitHub {
30 owner = "rq";
31 repo = "rq";
32 rev = "refs/tags/v${version}";
33 hash = "sha256-8uhCV4aJNbY273jOa9D5OlgEG1w3hXVncClKQTO9Pyk=";
34 };
35
36 build-system = [ hatchling ];
37
38 dependencies = [
39 click
40 redis
41 ];
42
43 nativeCheckInputs = [
44 psutil
45 pytestCheckHook
46 sentry-sdk
47 ];
48
49 preCheck = ''
50 PATH=$out/bin:$PATH
51 ${redis-server}/bin/redis-server &
52 '';
53
54 postCheck = ''
55 kill %%
56 '';
57
58 __darwinAllowLocalNetworking = true;
59
60 disabledTests = [
61 # https://github.com/rq/rq/commit/fd261d5d8fc0fe604fa396ee6b9c9b7a7bb4142f
62 "test_clean_large_registry"
63 ];
64
65 pythonImportsCheck = [ "rq" ];
66
67 meta = with lib; {
68 description = "Library for creating background jobs and processing them";
69 homepage = "https://github.com/nvie/rq/";
70 changelog = "https://github.com/rq/rq/releases/tag/v${version}";
71 license = licenses.bsd2;
72 maintainers = with maintainers; [ mrmebelman ];
73 };
74}