Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, buildPythonPackage
3, fetchPypi
4, odfpy
5, openpyxl
6, pandas
7, pytestCheckHook
8, pythonOlder
9, pyyaml
10, setuptools-scm
11, tabulate
12, unicodecsv
13, xlrd
14, xlwt
15}:
16
17buildPythonPackage rec {
18 pname = "tablib";
19 version = "3.3.0";
20 format = "setuptools";
21
22 disabled = pythonOlder "3.7";
23
24 src = fetchPypi {
25 inherit pname version;
26 hash = "sha256-EeAqb4HSVuBmaHfYOXly0QMCMHpUwE/XFX6S+vdAyxA=";
27 };
28
29 postPatch = ''
30 substituteInPlace pytest.ini \
31 --replace " --cov=tablib --cov=tests --cov-report xml --cov-report term --cov-report html" ""
32 '';
33
34 nativeBuildInputs = [
35 setuptools-scm
36 ];
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 = [
50 tabulate
51 ];
52 html = [
53 # markuppy
54 ];
55 ods = [
56 odfpy
57 ];
58 pandas = [
59 pandas
60 ];
61 xls = [
62 xlrd
63 xlwt
64 ];
65 xlsx = [
66 openpyxl
67 ];
68 yaml = [
69 pyyaml
70 ];
71 };
72
73 checkInputs = [
74 pandas
75 pytestCheckHook
76 unicodecsv
77 ];
78
79 disabledTestPaths = [
80 # test_tablib needs MarkupPy, which isn't packaged yet
81 "tests/test_tablib.py"
82 ];
83
84 pythonImportsCheck = [
85 "tablib"
86 ];
87
88 meta = with lib; {
89 description = "Format-agnostic tabular dataset library";
90 homepage = "https://tablib.readthedocs.io/";
91 changelog = "https://github.com/jazzband/tablib/raw/v${version}/HISTORY.md";
92 license = licenses.mit;
93 maintainers = with maintainers; [ ];
94 };
95}