diff --git a/pkgs/development/python-modules/mezzanine/default.nix b/pkgs/development/python-modules/mezzanine/default.nix index c28ab57e67f8..e96d65184f84 100644 --- a/pkgs/development/python-modules/mezzanine/default.nix +++ b/pkgs/development/python-modules/mezzanine/default.nix @@ -6,18 +6,20 @@ chardet, django, django-contrib-comments, - fetchPypi, + fetchFromGitHub, filebrowser-safe, - future, grappelli-safe, isPyPy, - pep8, pillow, - pyflakes, + pytestCheckHook, + pytest-cov-stub, + pytest-django, pythonOlder, pytz, requests, requests-oauthlib, + requirements-parser, + setuptools, tzlocal, }: @@ -28,25 +30,27 @@ buildPythonPackage rec { disabled = pythonOlder "3.7" || isPyPy; - src = fetchPypi { - pname = "Mezzanine"; - inherit version; - hash = "sha256-RZ/9ltvZUz1eXxeaVqS9ZE69+a9XWt6fxMcss+yTVP4="; + src = fetchFromGitHub { + owner = "stephenmcd"; + repo = "mezzanine"; + tag = "v${version}"; + hash = "sha256-TdGWlquS4hsnxIM0bhbWR7C0X4wyUcqC+YrBDSShRhg="; }; - buildInputs = [ - pyflakes - pep8 + patches = [ + # drop git requirement from tests and fake stable branch + ./tests-no-git.patch ]; - propagatedBuildInputs = [ + build-system = [ setuptools ]; + + dependencies = [ beautifulsoup4 bleach chardet django django-contrib-comments filebrowser-safe - future grappelli-safe pillow pytz @@ -56,15 +60,12 @@ buildPythonPackage rec { ] ++ bleach.optional-dependencies.css; - # Tests Fail Due to Syntax Warning, Fixed for v3.1.11+ - doCheck = false; - - # sed calls will be unnecessary in v3.1.11+ - preConfigure = '' - sed -i 's/==/>=/' setup.py - ''; - - LC_ALL = "en_US.UTF-8"; + nativeCheckInputs = [ + pytest-django + pytest-cov-stub + pytestCheckHook + requirements-parser + ]; meta = with lib; { description = "Content management platform built using the Django framework"; diff --git a/pkgs/development/python-modules/mezzanine/tests-no-git.patch b/pkgs/development/python-modules/mezzanine/tests-no-git.patch new file mode 100644 index 000000000000..8d2292edf322 --- /dev/null +++ b/pkgs/development/python-modules/mezzanine/tests-no-git.patch @@ -0,0 +1,17 @@ +diff --git a/tests/test_core.py b/tests/test_core.py +index 40cd39fe..57abbec0 100644 +--- a/tests/test_core.py ++++ b/tests/test_core.py +@@ -47,11 +47,7 @@ from mezzanine.utils.sites import current_site_id, override_current_site_id + from mezzanine.utils.tests import TestCase + from mezzanine.utils.urls import admin_url + +-BRANCH_NAME = ( +- subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"]) +- .decode() +- .strip() +-) ++BRANCH_NAME = "stable" + VERSION_WARN = ( + "Unpinned or pre-release dependencies detected in Mezzanine's requirements: {}" + )