Skip to content

Commit

Permalink
python3Packages.rq: fix build on darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
xanderio committed Apr 30, 2024
1 parent 09a5961 commit 8d2aa38
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pkgs/development/python-modules/rq/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{ lib
, stdenv
, fetchFromGitHub
, buildPythonPackage
, pythonOlder
Expand All @@ -16,8 +15,14 @@
, pytestCheckHook
, redis-server
, sentry-sdk
, writeText
}:

let
redisConf = writeText "redis.conf" ''
bind 127.0.0.1 ::1
'';
in
buildPythonPackage rec {
pname = "rq";
version = "1.16.1";
Expand Down Expand Up @@ -47,13 +52,14 @@ buildPythonPackage rec {
sentry-sdk
];

preCheck = lib.optionalString stdenv.isLinux ''
__darwinAllowLocalNetworking = true;
preCheck = ''
PATH=$out/bin:$PATH
${redis-server}/bin/redis-server &
${redis-server}/bin/redis-server ${redisConf} &
REDIS_PID=$!
'';

postCheck = lib.optionalString stdenv.isLinux ''
postCheck = ''
kill $REDIS_PID
'';

Expand Down

0 comments on commit 8d2aa38

Please sign in to comment.