1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 flatten-dict,
7 funcy,
8 matplotlib,
9 tabulate,
10 pytestCheckHook,
11 pytest-mock,
12 pytest-test-utils,
13 pythonOlder,
14 setuptools-scm,
15}:
16
17buildPythonPackage rec {
18 pname = "dvc-render";
19 version = "1.0.2";
20 pyproject = true;
21
22 disabled = pythonOlder "3.8";
23
24 src = fetchFromGitHub {
25 owner = "iterative";
26 repo = "dvc-render";
27 tag = version;
28 hash = "sha256-V4QVZu4PSOW9poT6YUWbgTjJpIJ8YUtGDAE4Ijgm5Ac=";
29 };
30
31 build-system = [ setuptools-scm ];
32
33 optional-dependencies = {
34 table = [
35 flatten-dict
36 tabulate
37 ];
38 markdown = [
39 tabulate
40 matplotlib
41 ];
42 };
43
44 nativeCheckInputs =
45 [
46 funcy
47 pytestCheckHook
48 pytest-mock
49 pytest-test-utils
50 ]
51 ++ optional-dependencies.table
52 ++ optional-dependencies.markdown;
53
54 disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ "tests/test_vega.py" ];
55
56 pythonImportsCheck = [ "dvc_render" ];
57
58 meta = with lib; {
59 description = "Library for rendering DVC plots";
60 homepage = "https://github.com/iterative/dvc-render";
61 changelog = "https://github.com/iterative/dvc-render/releases/tag/${version}";
62 license = licenses.asl20;
63 maintainers = with maintainers; [ fab ];
64 };
65}