1{ lib
2, buildPythonPackage
3, fetchPypi
4, markuppy
5, odfpy
6, openpyxl
7, pandas
8, pytestCheckHook
9, pythonOlder
10, pyyaml
11, setuptools-scm
12, tabulate
13, unicodecsv
14, xlrd
15, xlwt
16}:
17
18buildPythonPackage rec {
19 pname = "tablib";
20 version = "3.5.0";
21 format = "pyproject";
22
23 disabled = pythonOlder "3.7";
24
25 src = fetchPypi {
26 inherit pname version;
27 hash = "sha256-9mYd/EXh1PUfqKYjn5yDSTgIWaW/qnMoBkXwRtbJbjM=";
28 };
29
30 postPatch = ''
31 substituteInPlace pytest.ini \
32 --replace " --cov=tablib --cov=tests --cov-report xml --cov-report term --cov-report html" ""
33 '';
34
35 nativeBuildInputs = [
36 setuptools-scm
37 ];
38
39 passthru.optional-dependencies = {
40 all = [
41 markuppy
42 odfpy
43 openpyxl
44 pandas
45 pyyaml
46 tabulate
47 xlrd
48 xlwt
49 ];
50 cli = [
51 tabulate
52 ];
53 html = [
54 markuppy
55 ];
56 ods = [
57 odfpy
58 ];
59 pandas = [
60 pandas
61 ];
62 xls = [
63 xlrd
64 xlwt
65 ];
66 xlsx = [
67 openpyxl
68 ];
69 yaml = [
70 pyyaml
71 ];
72 };
73
74 nativeCheckInputs = [
75 pandas
76 pytestCheckHook
77 unicodecsv
78 ];
79
80 disabledTestPaths = [
81 # test_tablib needs MarkupPy, which isn't packaged yet
82 "tests/test_tablib.py"
83 ];
84
85 pythonImportsCheck = [
86 "tablib"
87 ];
88
89 meta = with lib; {
90 description = "Format-agnostic tabular dataset library";
91 homepage = "https://tablib.readthedocs.io/";
92 changelog = "https://github.com/jazzband/tablib/raw/v${version}/HISTORY.md";
93 license = licenses.mit;
94 maintainers = with maintainers; [ ];
95 };
96}