diff --git a/pkgs/development/python-modules/whitenoise/default.nix b/pkgs/development/python-modules/whitenoise/default.nix index 3c63c727c0d7..5598b189afac 100644 --- a/pkgs/development/python-modules/whitenoise/default.nix +++ b/pkgs/development/python-modules/whitenoise/default.nix @@ -1,21 +1,51 @@ -{ lib, fetchPypi, buildPythonPackage, isPy27 }: +{ lib +, brotli +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +, pythonOlder +, requests +}: buildPythonPackage rec { pname = "whitenoise"; - version = "5.2.0"; - disabled = isPy27; + version = "5.3.0"; + disabled = pythonOlder "3.5"; - src = fetchPypi { - inherit pname version; - sha256 = "05ce0be39ad85740a78750c86a93485c40f08ad8c62a6006de0233765996e5c7"; + src = fetchFromGitHub { + owner = "evansd"; + repo = pname; + rev = "v${version}"; + sha256 = "17j1rml1hb43c7fs7kf4ygkpmnjppzgsbnyw3plq9w3yh9w5hkhg"; }; - # No tests - doCheck = false; + propagatedBuildInputs = [ + brotli + ]; + + checkInputs = [ + pytestCheckHook + requests + ]; + + disabledTestPaths = [ + # Don't run Django tests + "tests/test_django_whitenoise.py" + "tests/test_runserver_nostatic.py" + "tests/test_storage.py" + ]; + + disabledTests = [ + # Test fails with AssertionError + "test_modified" + ]; + + pythonImportsCheck = [ "whitenoise" ]; meta = with lib; { description = "Radically simplified static file serving for WSGI applications"; homepage = "http://whitenoise.evans.io/"; license = licenses.mit; + maintainers = with maintainers; [ ]; }; }