lol

python3Packages.mezzanine: fix src, enable tests, refactor

+40 -22
+23 -22
pkgs/development/python-modules/mezzanine/default.nix
··· 6 6 chardet, 7 7 django, 8 8 django-contrib-comments, 9 - fetchPypi, 9 + fetchFromGitHub, 10 10 filebrowser-safe, 11 - future, 12 11 grappelli-safe, 13 12 isPyPy, 14 - pep8, 15 13 pillow, 16 - pyflakes, 14 + pytestCheckHook, 15 + pytest-cov-stub, 16 + pytest-django, 17 17 pythonOlder, 18 18 pytz, 19 19 requests, 20 20 requests-oauthlib, 21 + requirements-parser, 22 + setuptools, 21 23 tzlocal, 22 24 }: 23 25 ··· 28 30 29 31 disabled = pythonOlder "3.7" || isPyPy; 30 32 31 - src = fetchPypi { 32 - pname = "Mezzanine"; 33 - inherit version; 34 - hash = "sha256-RZ/9ltvZUz1eXxeaVqS9ZE69+a9XWt6fxMcss+yTVP4="; 33 + src = fetchFromGitHub { 34 + owner = "stephenmcd"; 35 + repo = "mezzanine"; 36 + tag = "v${version}"; 37 + hash = "sha256-TdGWlquS4hsnxIM0bhbWR7C0X4wyUcqC+YrBDSShRhg="; 35 38 }; 36 39 37 - buildInputs = [ 38 - pyflakes 39 - pep8 40 + patches = [ 41 + # drop git requirement from tests and fake stable branch 42 + ./tests-no-git.patch 40 43 ]; 41 44 42 - propagatedBuildInputs = [ 45 + build-system = [ setuptools ]; 46 + 47 + dependencies = [ 43 48 beautifulsoup4 44 49 bleach 45 50 chardet 46 51 django 47 52 django-contrib-comments 48 53 filebrowser-safe 49 - future 50 54 grappelli-safe 51 55 pillow 52 56 pytz ··· 56 60 ] 57 61 ++ bleach.optional-dependencies.css; 58 62 59 - # Tests Fail Due to Syntax Warning, Fixed for v3.1.11+ 60 - doCheck = false; 61 - 62 - # sed calls will be unnecessary in v3.1.11+ 63 - preConfigure = '' 64 - sed -i 's/==/>=/' setup.py 65 - ''; 66 - 67 - LC_ALL = "en_US.UTF-8"; 63 + nativeCheckInputs = [ 64 + pytest-django 65 + pytest-cov-stub 66 + pytestCheckHook 67 + requirements-parser 68 + ]; 68 69 69 70 meta = with lib; { 70 71 description = "Content management platform built using the Django framework";
+17
pkgs/development/python-modules/mezzanine/tests-no-git.patch
··· 1 + diff --git a/tests/test_core.py b/tests/test_core.py 2 + index 40cd39fe..57abbec0 100644 3 + --- a/tests/test_core.py 4 + +++ b/tests/test_core.py 5 + @@ -47,11 +47,7 @@ from mezzanine.utils.sites import current_site_id, override_current_site_id 6 + from mezzanine.utils.tests import TestCase 7 + from mezzanine.utils.urls import admin_url 8 + 9 + -BRANCH_NAME = ( 10 + - subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"]) 11 + - .decode() 12 + - .strip() 13 + -) 14 + +BRANCH_NAME = "stable" 15 + VERSION_WARN = ( 16 + "Unpinned or pre-release dependencies detected in Mezzanine's requirements: {}" 17 + )