1{
2 lib,
3 buildPythonPackage,
4 et-xmlfile,
5 fetchFromGitLab,
6 lxml,
7 pandas,
8 pillow,
9 pytest7CheckHook,
10 pythonAtLeast,
11 pythonOlder,
12 setuptools,
13}:
14
15buildPythonPackage rec {
16 pname = "openpyxl";
17 version = "3.1.2";
18 pyproject = true;
19
20 disabled = pythonOlder "3.7";
21
22 src = fetchFromGitLab {
23 domain = "foss.heptapod.net";
24 owner = "openpyxl";
25 repo = "openpyxl";
26 rev = "refs/tags/${version}";
27 hash = "sha256-SWRbjA83AOLrfe6on2CSb64pH5EWXkfyYcTqWJNBEP0=";
28 };
29
30 nativeBuildInputs = [ setuptools ];
31
32 propagatedBuildInputs = [ et-xmlfile ];
33
34 nativeCheckInputs = [
35 lxml
36 pandas
37 pillow
38 pytest7CheckHook
39 ];
40
41 pytestFlagsArray = [
42 "-W"
43 "ignore::DeprecationWarning"
44 ];
45 disabledTests =
46 [
47 # Tests broken since lxml 2.12; https://foss.heptapod.net/openpyxl/openpyxl/-/issues/2116
48 "test_read"
49 "test_read_comments"
50 "test_ignore_external_blip"
51 "test_from_xml"
52 "test_filenames"
53 "test_exts"
54 "test_from_complex"
55 "test_merge_named_styles"
56 "test_unprotected_cell"
57 "test_none_values"
58 "test_rgb_colors"
59 "test_named_styles"
60 "test_read_ole_link"
61 ]
62 ++ lib.optionals (pythonAtLeast "3.11") [
63 "test_broken_sheet_ref"
64 "test_name_invalid_index"
65 "test_defined_names_print_area"
66 "test_no_styles"
67 ];
68
69 pythonImportsCheck = [ "openpyxl" ];
70
71 meta = with lib; {
72 description = "Python library to read/write Excel 2010 xlsx/xlsm files";
73 homepage = "https://openpyxl.readthedocs.org";
74 changelog = "https://foss.heptapod.net/openpyxl/openpyxl/-/blob/${version}/doc/changes.rst";
75 license = licenses.mit;
76 maintainers = with maintainers; [ lihop ];
77 };
78}