diff --git a/pkgs/development/python-modules/celery/default.nix b/pkgs/development/python-modules/celery/default.nix index 13038c5803c..7e4aaf4dd24 100644 --- a/pkgs/development/python-modules/celery/default.nix +++ b/pkgs/development/python-modules/celery/default.nix @@ -2,18 +2,7 @@ pytest, case, kombu, billiard, pytz, anyjson, amqp, eventlet }: -let - - # Needed for celery - pytest_32 = pytest.overridePythonAttrs( oldAttrs: rec { - version = "3.2.5"; - src = oldAttrs.src.override { - inherit version; - sha256 = "6d5bd4f7113b444c55a3bbb5c738a3dd80d43563d063fc42dcb0aaefbdd78b81"; - }; - }); - -in buildPythonPackage rec { +buildPythonPackage rec { pname = "celery"; version = "4.2.1"; @@ -22,12 +11,24 @@ in buildPythonPackage rec { sha256 = "0y66rz7z8dfcgs3s0qxmdddlaq57bzbgxgfz896nbp14grkv9nkp"; }; - # Skip test_RedisBackend.test_timeouts_in_url_coerced - # See https://github.com/celery/celery/pull/4847 - patches = fetchpatch { - url = https://github.com/celery/celery/commit/b2668607c909c61becd151905b4525190c19ff4a.patch; - sha256 = "11w0z2ycyh8kccj4y69zb7bxppiipcwwigg6jn1q9yrcsvz170jq"; - }; + patches = [ + # Skip test_RedisBackend.test_timeouts_in_url_coerced + # See https://github.com/celery/celery/pull/4847 + (fetchpatch { + url = https://github.com/celery/celery/commit/b2668607c909c61becd151905b4525190c19ff4a.patch; + sha256 = "11w0z2ycyh8kccj4y69zb7bxppiipcwwigg6jn1q9yrcsvz170jq"; + }) + # Allow usage of a newer pytest version + # See https://github.com/celery/celery/pull/4912 + (fetchpatch { + url = https://github.com/celery/celery/commit/16f56fe6f84cac9f92affac3ad06a1f168a19798.patch; + sha256 = "0vz68rl32m34k51nhs898jcfdbj5m7cszzxx0w0j3j1fhn1wq594"; + }) + ]; + + postPatch = '' + substituteInPlace requirements/test.txt --replace ",<3.9" "" + ''; # make /etc/protocols accessible to fix socket.getprotobyname('tcp') in sandbox preCheck = stdenv.lib.optionalString stdenv.isLinux '' @@ -38,7 +39,7 @@ in buildPythonPackage rec { unset NIX_REDIRECTS LD_PRELOAD ''; - checkInputs = [ pytest_32 case ]; + checkInputs = [ pytest case ]; propagatedBuildInputs = [ kombu billiard pytz anyjson amqp eventlet ]; meta = with stdenv.lib; {