python3Packages.mezzanine: fix src, enable tests, refactor

Changed files
+40 -22
pkgs
development
python-modules
+23 -22
pkgs/development/python-modules/mezzanine/default.nix
···
chardet,
django,
django-contrib-comments,
-
fetchPypi,
filebrowser-safe,
-
future,
grappelli-safe,
isPyPy,
-
pep8,
pillow,
-
pyflakes,
pythonOlder,
pytz,
requests,
requests-oauthlib,
tzlocal,
}:
···
disabled = pythonOlder "3.7" || isPyPy;
-
src = fetchPypi {
-
pname = "Mezzanine";
-
inherit version;
-
hash = "sha256-RZ/9ltvZUz1eXxeaVqS9ZE69+a9XWt6fxMcss+yTVP4=";
};
-
buildInputs = [
-
pyflakes
-
pep8
];
-
propagatedBuildInputs = [
beautifulsoup4
bleach
chardet
django
django-contrib-comments
filebrowser-safe
-
future
grappelli-safe
pillow
pytz
···
]
++ 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";
meta = with lib; {
description = "Content management platform built using the Django framework";
···
chardet,
django,
django-contrib-comments,
+
fetchFromGitHub,
filebrowser-safe,
grappelli-safe,
isPyPy,
pillow,
+
pytestCheckHook,
+
pytest-cov-stub,
+
pytest-django,
pythonOlder,
pytz,
requests,
requests-oauthlib,
+
requirements-parser,
+
setuptools,
tzlocal,
}:
···
disabled = pythonOlder "3.7" || isPyPy;
+
src = fetchFromGitHub {
+
owner = "stephenmcd";
+
repo = "mezzanine";
+
tag = "v${version}";
+
hash = "sha256-TdGWlquS4hsnxIM0bhbWR7C0X4wyUcqC+YrBDSShRhg=";
};
+
patches = [
+
# drop git requirement from tests and fake stable branch
+
./tests-no-git.patch
];
+
build-system = [ setuptools ];
+
+
dependencies = [
beautifulsoup4
bleach
chardet
django
django-contrib-comments
filebrowser-safe
grappelli-safe
pillow
pytz
···
]
++ bleach.optional-dependencies.css;
+
nativeCheckInputs = [
+
pytest-django
+
pytest-cov-stub
+
pytestCheckHook
+
requirements-parser
+
];
meta = with lib; {
description = "Content management platform built using the Django framework";
+17
pkgs/development/python-modules/mezzanine/tests-no-git.patch
···
···
+
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: {}"
+
)