Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 arrow, 4 blessed, 5 bson, 6 buildPythonPackage, 7 croniter, 8 django, 9 django-picklefield, 10 django-redis, 11 fetchFromGitHub, 12 hiredis, 13 pkgs, 14 poetry-core, 15 pytest-django, 16 pytestCheckHook, 17 stdenv, 18}: 19 20buildPythonPackage rec { 21 pname = "django-q2"; 22 version = "1.7.6"; 23 pyproject = true; 24 25 src = fetchFromGitHub { 26 owner = "django-q2"; 27 repo = "django-q2"; 28 tag = "v${version}"; 29 hash = "sha256-L2IrLKszo2UCpeioAwI8c636KwQgNCEJjHUDY2Ctv4A="; 30 }; 31 32 postPatch = '' 33 substituteInPlace django_q/tests/settings.py \ 34 --replace-fail "HiredisParser" "_HiredisParser" 35 ''; 36 37 build-system = [ 38 poetry-core 39 ]; 40 41 dependencies = [ 42 arrow 43 bson # required for mongodb but undocumented 44 django 45 django-picklefield 46 ]; 47 48 nativeCheckInputs = [ 49 blessed 50 croniter 51 django-redis 52 # pyredis refuses to load with hiredis<3.0.0 53 (hiredis.overrideAttrs ( 54 new: old: { 55 version = "3.1.0"; 56 src = old.src.override { 57 tag = "v${new.version}"; 58 hash = "sha256-ID5OJdARd2N2GYEpcYOpxenpZlhWnWr5fAClAgqEgGg="; 59 }; 60 } 61 )) 62 pytest-django 63 pytestCheckHook 64 ]; 65 66 pythonImportsCheck = [ "django_q" ]; 67 68 preCheck = '' 69 ${pkgs.valkey}/bin/redis-server & 70 REDIS_PID=$! 71 ''; 72 73 postCheck = '' 74 kill $REDIS_PID 75 ''; 76 77 env = { 78 MONGO_HOST = "127.0.0.1"; 79 REDIS_HOST = "127.0.0.1"; 80 }; 81 82 disabledTests = [ 83 # requires a running mongodb 84 "test_mongo" 85 ] 86 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 87 # fails with an assertion 88 "test_max_rss" 89 "test_recycle" 90 # cannot connect to redis 91 "test_broker" 92 "test_custom" 93 "test_redis" 94 "test_redis_connection" 95 ]; 96 97 disabledTestPaths = [ 98 "django_q/tests/test_commands.py" 99 ]; 100 101 pytestFlags = [ "-vv" ]; 102 103 __darwinAllowLocalNetworking = true; 104 105 meta = { 106 description = "Multiprocessing distributed task queue for Django based on Django-Q"; 107 homepage = "https://github.com/django-q2/django-q2"; 108 changelog = "https://github.com/django-q2/django-q2/releases/tag/v${version}"; 109 license = lib.licenses.mit; 110 maintainers = with lib.maintainers; [ SuperSandro2000 ]; 111 }; 112}