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 rev = "refs/tags/${version}";
28 hash = "sha256-V4QVZu4PSOW9poT6YUWbgTjJpIJ8YUtGDAE4Ijgm5Ac=";
29 };
30
31 build-system = [ setuptools-scm ];
32
33 passthru.optional-dependencies = {
34 table = [
35 flatten-dict
36 tabulate
37 ];
38 markdown = [
39 tabulate
40 matplotlib
41 ];
42 };
43
44 nativeCheckInputs = [
45 funcy
46 pytestCheckHook
47 pytest-mock
48 pytest-test-utils
49 ] ++ passthru.optional-dependencies.table ++ passthru.optional-dependencies.markdown;
50
51 disabledTestPaths = lib.optionals stdenv.isDarwin [ "tests/test_vega.py" ];
52
53 pythonImportsCheck = [ "dvc_render" ];
54
55 meta = with lib; {
56 description = "Library for rendering DVC plots";
57 homepage = "https://github.com/iterative/dvc-render";
58 changelog = "https://github.com/iterative/dvc-render/releases/tag/${version}";
59 license = licenses.asl20;
60 maintainers = with maintainers; [ fab ];
61 };
62}