nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 buildPythonPackage,
6
7 # build-system
8 hatchling,
9
10 # dependencies
11 click,
12 croniter,
13 redis,
14
15 # tests
16 addBinToPathHook,
17 psutil,
18 pytestCheckHook,
19 redisTestHook,
20 versionCheckHook,
21}:
22
23buildPythonPackage rec {
24 pname = "rq";
25 version = "2.6.1";
26 pyproject = true;
27
28 src = fetchFromGitHub {
29 owner = "rq";
30 repo = "rq";
31 tag = "v${version}";
32 hash = "sha256-4+zP3pOiZ+r/dt9F2NyxgJsyGPIHgj9XokuPxlWyS1g=";
33 };
34
35 build-system = [ hatchling ];
36
37 dependencies = [
38 click
39 croniter
40 redis
41 ];
42
43 nativeCheckInputs = [
44 addBinToPathHook
45 psutil
46 pytestCheckHook
47 redisTestHook
48 versionCheckHook
49 ];
50
51 preCheck = ''
52 redisTestPort=6379
53 '';
54
55 __darwinAllowLocalNetworking = true;
56
57 # redisTestHook does not work on darwin-x86_64
58 doCheck = !(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64);
59
60 disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
61 # PermissionError: [Errno 13] Permission denied: '/tmp/rq-tests.txt'
62 "test_deleted_jobs_arent_executed"
63 "test_suspend_worker_execution"
64 ];
65
66 pythonImportsCheck = [ "rq" ];
67
68 meta = {
69 description = "Library for creating background jobs and processing them";
70 homepage = "https://github.com/nvie/rq/";
71 changelog = "https://github.com/rq/rq/releases/tag/${src.tag}";
72 license = lib.licenses.bsd2;
73 maintainers = with lib.maintainers; [ mrmebelman ];
74 };
75}