about summary refs log tree commit diff
path: root/pkgs/development/python-modules/openpyxl/default.nix
blob: 94252131d9a00cc325f1a485184359d491574586 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{ lib
, buildPythonPackage
, et-xmlfile
, fetchFromGitLab
, lxml
, pandas
, pillow
, pytestCheckHook
, pythonAtLeast
, pythonOlder
, setuptools
}:

buildPythonPackage rec {
  pname = "openpyxl";
  version = "3.1.2";
  pyproject = true;

  disabled = pythonOlder "3.7";

  src = fetchFromGitLab {
    domain = "foss.heptapod.net";
    owner = "openpyxl";
    repo = "openpyxl";
    rev = "refs/tags/${version}";
    hash = "sha256-SWRbjA83AOLrfe6on2CSb64pH5EWXkfyYcTqWJNBEP0=";
  };

  nativeBuildInputs = [
    setuptools
  ];

  propagatedBuildInputs = [
    et-xmlfile
  ];

  nativeCheckInputs = [
    lxml
    pandas
    pillow
    pytestCheckHook
  ];

  pytestFlagsArray = [
    "-W"
    "ignore::DeprecationWarning"
  ];
  disabledTests = [
    # Tests broken since lxml 2.12; https://foss.heptapod.net/openpyxl/openpyxl/-/issues/2116
    "test_read"
    "test_read_comments"
    "test_ignore_external_blip"
    "test_from_xml"
    "test_filenames"
    "test_exts"
    "test_from_complex"
    "test_merge_named_styles"
    "test_unprotected_cell"
    "test_none_values"
    "test_rgb_colors"
    "test_named_styles"
    "test_read_ole_link"
  ] ++ lib.optionals (pythonAtLeast "3.11") [
    "test_broken_sheet_ref"
    "test_name_invalid_index"
    "test_defined_names_print_area"
    "test_no_styles"
  ];

  pythonImportsCheck = [
    "openpyxl"
  ];

  meta = with lib; {
    description = "Python library to read/write Excel 2010 xlsx/xlsm files";
    homepage = "https://openpyxl.readthedocs.org";
    changelog = "https://foss.heptapod.net/openpyxl/openpyxl/-/blob/${version}/doc/changes.rst";
    license = licenses.mit;
    maintainers = with maintainers; [ lihop ];
  };
}