Yueh-Shun Li 76e2a397c2 treewide: pytestFlagsArray -> pytestFlags and join flag and option argument
This treewide change targets Python packages
that specifies pytest flags with pytestFlagsArray,
and whose flags cannot be consructed by other pytestCheckHook-honoured arguments.

Use the __structuredAttrs-agnostic argument pytestFlags
instead of the deprecated pytestFlagsArray.

For flags with option arguments,
join each flag and their option argument into a single command-line argument
following POSIX Utility Argument Syntax[1]
for easier overriding (remove/replace).

Examples:

* [ "-W" "ignore:message:WarningClass" ] ->
  [ "-Wignore:message:WarningClass" ]

* [ "--reruns" "3" ] ->
  [ "--reruns=3" ]

[1]: https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html
2025-06-16 01:02:16 +08:00

79 lines
1.7 KiB
Nix

{
lib,
buildPythonPackage,
et-xmlfile,
fetchFromGitLab,
lxml,
pandas,
pillow,
pytest7CheckHook,
pythonAtLeast,
pythonOlder,
setuptools,
}:
buildPythonPackage rec {
pname = "openpyxl";
version = "3.1.5";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitLab {
domain = "foss.heptapod.net";
owner = "openpyxl";
repo = "openpyxl";
rev = "refs/tags/${version}";
hash = "sha256-vp+TIWcHCAWlDaBcmC7w/kV7DZTZpa6463NusaJmqKo=";
};
build-system = [ setuptools ];
dependencies = [ et-xmlfile ];
nativeCheckInputs = [
lxml
pandas
pillow
pytest7CheckHook
];
pytestFlags = [
"-Wignore::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 ];
};
}