72 lines
1.2 KiB
Nix
72 lines
1.2 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitHub
|
|
, buildPythonPackage
|
|
, pythonOlder
|
|
|
|
# build-system
|
|
, hatchling
|
|
|
|
# dependencies
|
|
, click
|
|
, redis
|
|
|
|
# tests
|
|
, psutil
|
|
, pytestCheckHook
|
|
, redis-server
|
|
, sentry-sdk
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "rq";
|
|
version = "1.16.1";
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "rq";
|
|
repo = "rq";
|
|
rev = "fd261d5d8fc0fe604fa396ee6b9c9b7a7bb4142f";
|
|
hash = "sha256-0pRknrF7dtW7210iS8HDWDRRsSJXzgFZYlPy0eK/Rs4=";
|
|
};
|
|
|
|
build-system = [
|
|
hatchling
|
|
];
|
|
|
|
dependencies = [
|
|
click
|
|
redis
|
|
];
|
|
|
|
nativeCheckInputs = [
|
|
psutil
|
|
pytestCheckHook
|
|
sentry-sdk
|
|
];
|
|
|
|
preCheck = lib.optionalString stdenv.isLinux ''
|
|
PATH=$out/bin:$PATH
|
|
${redis-server}/bin/redis-server &
|
|
REDIS_PID=$!
|
|
'';
|
|
|
|
postCheck = lib.optionalString stdenv.isLinux ''
|
|
kill $REDIS_PID
|
|
'';
|
|
|
|
pythonImportsCheck = [
|
|
"rq"
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "Library for creating background jobs and processing them";
|
|
homepage = "https://github.com/nvie/rq/";
|
|
changelog = "https://github.com/rq/rq/releases/tag/v${version}";
|
|
license = licenses.bsd2;
|
|
maintainers = with maintainers; [ mrmebelman ];
|
|
};
|
|
}
|
|
|