summary refs log tree commit diff
path: root/pkgs/development/python-modules/branca/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/branca/default.nix')
-rw-r--r--pkgs/development/python-modules/branca/default.nix61
1 files changed, 48 insertions, 13 deletions
diff --git a/pkgs/development/python-modules/branca/default.nix b/pkgs/development/python-modules/branca/default.nix
index c0e19fc4868..65b80267c1d 100644
--- a/pkgs/development/python-modules/branca/default.nix
+++ b/pkgs/development/python-modules/branca/default.nix
@@ -1,31 +1,66 @@
 { lib
 , buildPythonPackage
-, fetchPypi
-, pytest
+, fetchFromGitHub
 , jinja2
+, pytestCheckHook
+, pythonOlder
+, setuptools-scm
 , selenium
-, six
-, setuptools
 }:
 
 buildPythonPackage rec {
   pname = "branca";
   version = "0.6.0";
+  format = "setuptools";
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "sha256-VZSYVSFFBMdYO3G5oDqE3OLpaoQCdhO7U7QtBIRM4k4=";
+  disabled = pythonOlder "3.7";
+
+  src = fetchFromGitHub {
+    owner = "python-visualization";
+    repo = pname;
+    rev = "refs/tags/v${version}";
+    hash = "sha256-bcqr+vGKBga4rR4XFRWbjtw5xL+pWkIt+ihtKlKF6Y8=";
   };
 
-  nativeCheckInputs = [ pytest selenium ];
-  propagatedBuildInputs = [ jinja2 six setuptools ];
+  SETUPTOOLS_SCM_PRETEND_VERSION = version;
+
+  postPatch = ''
+    # We don't want flake8
+    rm setup.cfg
+  '';
+
+  nativeBuildInputs = [
+    setuptools-scm
+  ];
+
+  propagatedBuildInputs = [
+    jinja2
+  ];
+
+  nativeCheckInputs = [
+    pytestCheckHook
+    selenium
+  ];
+
+  pythonImportsCheck = [
+    "branca"
+  ];
+
+  disabledTestPaths = [
+    # Some tests require a browser
+    "tests/test_utilities.py"
+  ];
 
-  # Seems to require a browser
-  doCheck = false;
+  disabledTests = [
+    "test_rendering_utf8_iframe"
+    "test_rendering_figure_notebook"
+  ];
 
-  meta = {
+  meta = with lib; {
     description = "Generate complex HTML+JS pages with Python";
     homepage = "https://github.com/python-visualization/branca";
-    license = with lib.licenses; [ mit ];
+    changelog = "https://github.com/python-visualization/branca/blob/v${version}/CHANGES.txt";
+    license = with licenses; [ mit ];
+    maintainers = with lib.maintainers; [ ];
   };
 }