summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/folium/default.nix
blob: cb14e2af225cfca53ac8f3bb36f69fbb79972f7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
  lib,
  buildPythonPackage,
  branca,
  fetchFromGitHub,
  geodatasets,
  geopandas,
  jinja2,
  nbconvert,
  numpy,
  pandas,
  pillow,
  pixelmatch,
  pytestCheckHook,
  requests,
  selenium,
  setuptools,
  setuptools-scm,
  xyzservices,
}:

buildPythonPackage rec {
  pname = "folium";
  version = "0.20.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "python-visualization";
    repo = "folium";
    tag = "v${version}";
    hash = "sha256-yLF4TdrMVEtWvGXZGbwa3OxCkdXMsN4m45rPrGDHlCU=";
  };

  build-system = [
    setuptools
    setuptools-scm
  ];

  dependencies = [
    branca
    jinja2
    numpy
    requests
    xyzservices
  ];

  nativeCheckInputs = [
    geodatasets
    geopandas
    nbconvert
    pandas
    pillow
    pixelmatch
    pytestCheckHook
    selenium
  ];

  disabledTests = [
    # Tests require internet connection
    "test_json_request"
    # no selenium driver
    "test__repr_png_is_bytes"
    "test_valid_png_size"
    "test_valid_png"
    # pooch tries to write somewhere it can, and geodatasets does not give us an env var to customize this.
    "test_timedynamic_geo_json"
  ];

  disabledTestPaths = [
    # Selenium cannot find chrome driver, even with chromedriver package
    "tests/snapshots/test_snapshots.py"
    "tests/selenium"
  ];

  pythonImportsCheck = [ "folium" ];

  meta = {
    description = "Make beautiful maps with Leaflet.js & Python";
    homepage = "https://github.com/python-visualization/folium";
    changelog = "https://github.com/python-visualization/folium/releases/tag/${src.tag}";
    license = with lib.licenses; [ mit ];
    teams = [ lib.teams.geospatial ];
  };
}