nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

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 ··· 30 28 31 29 disabled = pythonOlder "3.7" || isPyPy; 32 30 33 - src = fetchPypi { 34 - pname = "Mezzanine"; 35 - inherit version; 36 - hash = "sha256-RZ/9ltvZUz1eXxeaVqS9ZE69+a9XWt6fxMcss+yTVP4="; 31 + src = fetchFromGitHub { 32 + owner = "stephenmcd"; 33 + repo = "mezzanine"; 34 + tag = "v${version}"; 35 + hash = "sha256-TdGWlquS4hsnxIM0bhbWR7C0X4wyUcqC+YrBDSShRhg="; 37 36 }; 38 37 39 - buildInputs = [ 40 - pyflakes 41 - pep8 38 + patches = [ 39 + # drop git requirement from tests and fake stable branch 40 + ./tests-no-git.patch 42 41 ]; 43 42 44 - propagatedBuildInputs = [ 43 + build-system = [ setuptools ]; 44 + 45 + dependencies = [ 45 46 beautifulsoup4 46 47 bleach 47 48 chardet 48 49 django 49 50 django-contrib-comments 50 51 filebrowser-safe 51 - future 52 52 grappelli-safe 53 53 pillow 54 54 pytz ··· 60 56 ] 61 57 ++ bleach.optional-dependencies.css; 62 58 63 - # Tests Fail Due to Syntax Warning, Fixed for v3.1.11+ 64 - doCheck = false; 65 - 66 - # sed calls will be unnecessary in v3.1.11+ 67 - preConfigure = '' 68 - sed -i 's/==/>=/' setup.py 69 - ''; 70 - 71 - LC_ALL = "en_US.UTF-8"; 59 + nativeCheckInputs = [ 60 + pytest-django 61 + pytest-cov-stub 62 + pytestCheckHook 63 + requirements-parser 64 + ]; 72 65 73 66 meta = with lib; { 74 67 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 + )