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