summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/streamlit-folium/default.nix
blob: 4d6cfe5e42630c37749780cdda59cc181c27e70f (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
{
  lib,
  branca,
  buildPythonPackage,
  fetchFromGitHub,
  folium,
  jinja2,
  pytest-playwright,
  pytest-rerunfailures,
  pytestCheckHook,
  streamlit,
  uv-build,
  writableTmpDirAsHomeHook,
}:

buildPythonPackage (finalAttrs: {
  pname = "streamlit-folium";
  version = "0.26.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "randyzwitch";
    repo = "streamlit-folium";
    tag = "v${finalAttrs.version}";
    hash = "sha256-Q4drhYRh+iO/qg4AY2fDszGdUld2NS1CXTtCdOFl8wo=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail "uv_build>=0.8.4,<0.9" "uv_build"
  '';

  build-system = [ uv-build ];

  dependencies = [
    branca
    folium
    jinja2
    streamlit
  ];

  nativeCheckInputs = [
    pytest-playwright
    pytest-rerunfailures
    pytestCheckHook
    streamlit
    writableTmpDirAsHomeHook
  ];

  pythonImportsCheck = [ "streamlit_folium" ];

  preCheck = ''
    export PATH="$PATH:$out/bin";
  '';

  disabledTestPaths = [
    # Don't run tests that require chromium
    "tests/test_frontend.py"
  ];

  meta = {
    description = "Streamlit Component for rendering Folium maps";
    homepage = "https://github.com/randyzwitch/streamlit-folium";
    changelog = "https://github.com/randyzwitch/streamlit-folium/releases/tag/${finalAttrs.src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ fab ];
  };
})