From 9bc1ce476ca794f05604c3984ced89ffe6c9a525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 7 Feb 2022 03:16:44 +0100 Subject: [PATCH] python39Packages.folium: fix version number, run tests, cleanups Fetching from GitHub is required to have the tests. --- .../python-modules/folium/default.nix | 61 +++++++++++++------ 1 file changed, 42 insertions(+), 19 deletions(-) diff --git a/pkgs/development/python-modules/folium/default.nix b/pkgs/development/python-modules/folium/default.nix index ff8c097d6ff3..48b98a8e1018 100644 --- a/pkgs/development/python-modules/folium/default.nix +++ b/pkgs/development/python-modules/folium/default.nix @@ -1,37 +1,60 @@ { lib , buildPythonPackage -, fetchPypi +, fetchFromGitHub , pythonOlder -, pytest -, numpy -, nbconvert -, pandas -, mock -, jinja2 +, pytestCheckHook , branca +, jinja2 +, nbconvert +, numpy +, pandas +, pillow , requests +, selenium +, setuptools-scm }: buildPythonPackage rec { pname = "folium"; version = "0.12.1.post1"; - src = fetchPypi { - inherit pname version; - sha256 = "e91e57d8298f3ccf4cce3c5e065bea6eb17033e3c5432b8a22214009c266b2ab"; - }; - disabled = pythonOlder "3.5"; - checkInputs = [ pytest nbconvert pandas mock ]; - propagatedBuildInputs = [ jinja2 branca requests numpy ]; + src = fetchFromGitHub { + owner = "python-visualization"; + repo = "folium"; + rev = "v${version}"; + sha256 = "sha256-4UseN/3ojZdDUopwZLpHZEBon1qDDvCWfdzxodi/BeA="; + }; - # No tests in archive - doCheck = false; + SETUPTOOLS_SCM_PRETEND_VERSION = "v${version}"; - checkPhase = '' - py.test - ''; + nativeBuildInputs = [ + setuptools-scm + ]; + + propagatedBuildInputs = [ + branca + jinja2 + numpy + requests + ]; + + checkInputs = [ + nbconvert + pytestCheckHook + pandas + pillow + selenium + ]; + + disabledTests = [ + # requires internet connection + "test_geojson" + "test_heat_map_with_weights" + "test_json_request" + "test_notebook" + ]; meta = { description = "Make beautiful maps with Leaflet.js & Python";