1{
2 lib,
3 buildPythonPackage,
4 branca,
5 fetchFromGitHub,
6 geodatasets,
7 geopandas,
8 jinja2,
9 nbconvert,
10 numpy,
11 pandas,
12 pillow,
13 pixelmatch,
14 pytestCheckHook,
15 pythonOlder,
16 requests,
17 selenium,
18 setuptools,
19 setuptools-scm,
20 xyzservices,
21}:
22
23buildPythonPackage rec {
24 pname = "folium";
25 version = "0.20.0";
26 pyproject = true;
27
28 disabled = pythonOlder "3.9";
29
30 src = fetchFromGitHub {
31 owner = "python-visualization";
32 repo = "folium";
33 tag = "v${version}";
34 hash = "sha256-yLF4TdrMVEtWvGXZGbwa3OxCkdXMsN4m45rPrGDHlCU=";
35 };
36
37 build-system = [
38 setuptools
39 setuptools-scm
40 ];
41
42 dependencies = [
43 branca
44 jinja2
45 numpy
46 requests
47 xyzservices
48 ];
49
50 nativeCheckInputs = [
51 geodatasets
52 geopandas
53 nbconvert
54 pandas
55 pillow
56 pixelmatch
57 pytestCheckHook
58 selenium
59 ];
60
61 disabledTests = [
62 # Tests require internet connection
63 "test_json_request"
64 # no selenium driver
65 "test__repr_png_is_bytes"
66 "test_valid_png_size"
67 "test_valid_png"
68 # pooch tries to write somewhere it can, and geodatasets does not give us an env var to customize this.
69 "test_timedynamic_geo_json"
70 ];
71
72 disabledTestPaths = [
73 # Selenium cannot find chrome driver, even with chromedriver package
74 "tests/snapshots/test_snapshots.py"
75 "tests/selenium"
76 ];
77
78 pythonImportsCheck = [ "folium" ];
79
80 meta = {
81 description = "Make beautiful maps with Leaflet.js & Python";
82 homepage = "https://github.com/python-visualization/folium";
83 changelog = "https://github.com/python-visualization/folium/releases/tag/${src.tag}";
84 license = with lib.licenses; [ mit ];
85 teams = [ lib.teams.geospatial ];
86 };
87}