diff --git a/pkgs/applications/office/paperless/default.nix b/pkgs/applications/office/paperless/default.nix index af2fd82ddb03..97088f360417 100644 --- a/pkgs/applications/office/paperless/default.nix +++ b/pkgs/applications/office/paperless/default.nix @@ -57,6 +57,12 @@ let cp -r --no-preserve=mode $src/src/* $src/LICENSE $srcDir ''; + postPatch = '' + # django-cors-headers 3.x requires a scheme for allowed hosts + substituteInPlace $out/share/paperless/paperless/settings.py \ + --replace "localhost:8080" "http://localhost:8080" + ''; + buildPhase = let # Paperless has explicit runtime checks that expect these binaries to be in PATH extraBin = lib.makeBinPath [ imagemagick7 ghostscript optipng tesseract unpaper ]; diff --git a/pkgs/applications/office/paperless/python-modules/django-crispy-forms.nix b/pkgs/applications/office/paperless/python-modules/django-crispy-forms.nix index c1e0f7da30f6..465da3862471 100644 --- a/pkgs/applications/office/paperless/python-modules/django-crispy-forms.nix +++ b/pkgs/applications/office/paperless/python-modules/django-crispy-forms.nix @@ -1,5 +1,5 @@ { lib, buildPythonPackage, fetchFromGitHub -, pytest, pytest-django, django }: +, pytest_4, pytest-django, django }: buildPythonPackage { pname = "django-crispy-forms"; @@ -19,7 +19,7 @@ buildPythonPackage { export sourceRoot=source- ''; - checkInputs = [ pytest pytest-django django ]; + checkInputs = [ pytest_4 pytest-django django ]; checkPhase = '' PYTHONPATH="$(pwd):$PYTHONPATH" \ diff --git a/pkgs/development/python-modules/pytest/2.nix b/pkgs/development/python-modules/pytest/4.nix similarity index 100% rename from pkgs/development/python-modules/pytest/2.nix rename to pkgs/development/python-modules/pytest/4.nix diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 96885a83ebb4..62901ef20520 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1991,15 +1991,17 @@ in { pyhepmc = callPackage ../development/python-modules/pyhepmc { }; - pytest = if isPy3k then - callPackage ../development/python-modules/pytest { - # hypothesis tests require pytest that causes dependency cycle - hypothesis = self.hypothesis.override { doCheck = false; }; - } - else callPackage ../development/python-modules/pytest/2.nix { - # hypothesis tests require pytest that causes dependency cycle - hypothesis = self.hypothesis.override { doCheck = false; }; - }; + pytest = if isPy3k then self.pytest_5 else self.pytest_4; + + pytest_5 = callPackage ../development/python-modules/pytest { + # hypothesis tests require pytest that causes dependency cycle + hypothesis = self.hypothesis.override { doCheck = false; }; + }; + + pytest_4 = callPackage ../development/python-modules/pytest/4.nix { + # hypothesis tests require pytest that causes dependency cycle + hypothesis = self.hypothesis.override { doCheck = false; }; + }; pytest-helpers-namespace = callPackage ../development/python-modules/pytest-helpers-namespace { };