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