From 0646b9f7c39776a3ec8e4f3f6c60bd6e735d5b88 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Sat, 23 Nov 2019 07:30:00 +0000 Subject: [PATCH] python: openpyxl: support Python 2 This fixes pandas for Python 2 since it depends on openpyxl. --- .../development/python-modules/openpyxl/2.nix | 38 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 5 ++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/python-modules/openpyxl/2.nix diff --git a/pkgs/development/python-modules/openpyxl/2.nix b/pkgs/development/python-modules/openpyxl/2.nix new file mode 100644 index 00000000000..d58192c0666 --- /dev/null +++ b/pkgs/development/python-modules/openpyxl/2.nix @@ -0,0 +1,38 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pytest +, jdcal +, et_xmlfile +, lxml +}: + +buildPythonPackage rec { + pname = "openpyxl"; + version = "2.6.4"; + + src = fetchPypi { + inherit pname version; + sha256 = "1d53801678e18d7fe38c116f1ad0c2383a654670c4c8806105b611c92d92f2e3"; + }; + + checkInputs = [ pytest ]; + propagatedBuildInputs = [ jdcal et_xmlfile lxml ]; + + postPatch = '' + # LICENSE.rst is missing, and setup.cfg currently doesn't contain anything useful anyway + # This should likely be removed in the next update + rm setup.cfg + ''; + + # Tests are not included in archive. + # https://bitbucket.org/openpyxl/openpyxl/issues/610 + doCheck = false; + + meta = { + description = "A Python library to read/write Excel 2007 xlsx/xlsm files"; + homepage = https://openpyxl.readthedocs.org; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ lihop sjourdois ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 99b00004e10..be26781312a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4198,7 +4198,10 @@ in { offtrac = callPackage ../development/python-modules/offtrac { }; - openpyxl = callPackage ../development/python-modules/openpyxl { }; + openpyxl = if isPy3k then + callPackage ../development/python-modules/openpyxl { } + else + callPackage ../development/python-modules/openpyxl/2.nix { }; opentimestamps = callPackage ../development/python-modules/opentimestamps { };