1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, fetchpatch
5, pythonOlder
6, pytestCheckHook
7, branca
8, jinja2
9, nbconvert
10, numpy
11, pandas
12, pillow
13, requests
14, selenium
15, setuptools-scm
16}:
17
18buildPythonPackage rec {
19 pname = "folium";
20 version = "0.12.1.post1";
21
22 disabled = pythonOlder "3.5";
23
24 src = fetchFromGitHub {
25 owner = "python-visualization";
26 repo = "folium";
27 rev = "v${version}";
28 sha256 = "sha256-4UseN/3ojZdDUopwZLpHZEBon1qDDvCWfdzxodi/BeA=";
29 };
30
31 patches = [
32 # Fix test failures with latest branca
33 (fetchpatch {
34 url = "https://github.com/python-visualization/folium/commit/b410ab21cc46ec6756c2f755e5e81dcdca029c53.patch";
35 hash = "sha256-SVN4wKEep+VnAKnkJTf59rhnzHnbk6dV9XL5ntv4bog=";
36 })
37 ];
38
39 SETUPTOOLS_SCM_PRETEND_VERSION = "v${version}";
40
41 nativeBuildInputs = [
42 setuptools-scm
43 ];
44
45 propagatedBuildInputs = [
46 branca
47 jinja2
48 numpy
49 requests
50 ];
51
52 checkInputs = [
53 nbconvert
54 pytestCheckHook
55 pandas
56 pillow
57 selenium
58 ];
59
60 disabledTests = [
61 # requires internet connection
62 "test_geojson"
63 "test_heat_map_with_weights"
64 "test_json_request"
65 "test_notebook"
66 ];
67
68 meta = {
69 description = "Make beautiful maps with Leaflet.js & Python";
70 homepage = "https://github.com/python-visualization/folium";
71 license = with lib.licenses; [ mit ];
72 maintainers = with lib.maintainers; [ fridh ];
73 };
74}