From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:45558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h50YH-0006fj-U4 for guix-patches@gnu.org; Sat, 16 Mar 2019 00:04:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h50YF-0005iy-LP for guix-patches@gnu.org; Sat, 16 Mar 2019 00:04:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60416) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h50YF-0005iU-8U for guix-patches@gnu.org; Sat, 16 Mar 2019 00:04:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h50YE-00075d-UZ for guix-patches@gnu.org; Sat, 16 Mar 2019 00:04:02 -0400 Subject: [bug#34882] [PATCH] Update to Pandas, enable Excel writer support Resent-Message-ID: Received: from eggs.gnu.org ([209.51.188.92]:45376) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h50Xf-0006Hj-9x for guix-patches@gnu.org; Sat, 16 Mar 2019 00:03:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h50JM-0005wF-KF for guix-patches@gnu.org; Fri, 15 Mar 2019 23:48:44 -0400 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]:34876) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h50JJ-0005rC-3z for guix-patches@gnu.org; Fri, 15 Mar 2019 23:48:39 -0400 Received: by mail-qk1-x72a.google.com with SMTP id z13so6768003qki.2 for ; Fri, 15 Mar 2019 20:48:31 -0700 (PDT) Received: from kwak ([216.154.27.64]) by smtp.gmail.com with ESMTPSA id t49sm2637996qte.86.2019.03.15.20.48.28 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Mar 2019 20:48:29 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 15 Mar 2019 23:48:27 -0400 Message-ID: <87k1gzqy2c.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 34882@debbugs.gnu.org --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-gnu-Add-python-et-xmlfile.patch Content-Transfer-Encoding: quoted-printable >From 4903d5a179a0a441910217653285226981905c4e Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Fri, 11 Jan 2019 11:25:54 -0500 Subject: [PATCH 1/5] gnu: Add python-et-xmlfile. * gnu/packages/python.scm (python-et-xmlfile): New variable. --- gnu/packages/python-xyz.scm | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index fa2701bc1c..6c2f01e3cc 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -54,7 +54,7 @@ ;;; Copyright =C2=A9 2018 Nicolas Goaziou ;;; Copyright =C2=A9 2018 Oleg Pykhalov ;;; Copyright =C2=A9 2018 Cl=C3=A9ment Lassieur -;;; Copyright =C2=A9 2018 Maxim Cournoyer +;;; Copyright =C2=A9 2018, 2019 Maxim Cournoyer ;;; Copyright =C2=A9 2018 Luther Thompson ;;; Copyright =C2=A9 2018 Vagrant Cascadian ;;; Copyright =C2=A9 2019 Brett Gilio @@ -832,6 +832,39 @@ messages in color.") (define-public python2-coloredlogs (package-with-python2 python-coloredlogs)) =20 +(define-public python-et-xmlfile + (package + (name "python-et-xmlfile") + (version "1.0.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri "et_xmlfile" version)) + (sha256 + (base32 + "0nrkhcb6jdrlb6pwkvd4rycw34y3s931hjf409ij9xkjsli9fkb1")))) + (build-system python-build-system) + (arguments + `(#:phases (modify-phases %standard-phases + (replace 'check + (lambda _ + (invoke "pytest")))))) + (native-inputs + `(("python-pytest" ,python-pytest) + ("python-lxml" ,python-lxml))) + (home-page + "https://bitbucket.org/openpyxl/et_xmlfile") + (synopsis + "Low memory implementation of @code{lxml.xmlfile}") + (description + "This Python library is based upon the @code{xmlfile} module +from @code{lxml}. It aims to provide a low memory, compatible implementat= ion +of @code{xmlfile}.") + (license license:expat))) + +(define-public python2-et-xmlfile + (package-with-python2 python-et-xmlfile)) + (define-public python-eventlet (package (name "python-eventlet") --=20 2.20.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-gnu-Add-python-jdcal.patch >From 992f103c131897a1c0f310490cab46dd23e9c625 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Fri, 11 Jan 2019 11:26:28 -0500 Subject: [PATCH 2/5] gnu: Add python-jdcal. * gnu/packages/python.scm (python-jdcal): New variable. --- gnu/packages/python-xyz.scm | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 6c2f01e3cc..f9595ae2cb 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -1791,6 +1791,36 @@ version numbers.") (define-public python2-vcversioner (package-with-python2 python-vcversioner)) +(define-public python-jdcal + (package + (name "python-jdcal") + (version "1.4") + (source + (origin + (method url-fetch) + (uri (pypi-uri "jdcal" version)) + (sha256 + (base32 + "1ja6j2xq97bsl6rv09mhdx7n0xnrsfx0mj5xqza0mxghqmkm02pa")))) + (build-system python-build-system) + (arguments + `(#:phases (modify-phases %standard-phases + (replace 'check + (lambda _ + (invoke "pytest")))))) + (native-inputs + `(("python-pytest" ,python-pytest))) + (home-page "https://github.com/phn/jdcal") + (synopsis + "Functions to convert between Julian dates Gregorian dates") + (description + "This Python library provides functions for converting between Julian +dates and Gregorian dates.") + (license license:bsd-2))) + +(define-public python2-jdcal + (package-with-python2 python-jdcal)) + (define-public python-jsonschema (package (name "python-jsonschema") -- 2.20.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0003-gnu-Add-python-openpyxl.patch >From 4b72713af3e8de61bae8d7a76895a9b2f32f09c9 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Fri, 11 Jan 2019 11:27:10 -0500 Subject: [PATCH 3/5] gnu: Add python-openpyxl. * gnu/packages/python.scm (python-openpyxl): New variable. --- gnu/packages/python-xyz.scm | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index f9595ae2cb..427d6818e2 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -142,6 +142,7 @@ #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) + #:use-module (guix hg-download) #:use-module (guix utils) #:use-module (guix build-system gnu) #:use-module (guix build-system cmake) @@ -865,6 +866,43 @@ of @code{xmlfile}.") (define-public python2-et-xmlfile (package-with-python2 python-et-xmlfile)) +(define-public python-openpyxl + (package + (name "python-openpyxl") + (version "2.6.0") + (source + (origin + (method hg-fetch) + (uri (hg-reference + (url "https://bitbucket.org/openpyxl/openpyxl") + (changeset version))) + (file-name (string-append name "-" version "-checkout")) + (sha256 + (base32 + "1x47ngn7ybaqdbvg90c8h2x0j6yfdfj25gjfinp2w5rf62gsany7")))) + (build-system python-build-system) + (arguments + `(#:phases (modify-phases %standard-phases + (replace 'check + (lambda _ + (invoke "pytest")))))) + (native-inputs + `(("python-lxml" ,python-lxml) + ;; For the test suite. + ("python-pillow" ,python-pillow) + ("python-pytest" ,python-pytest))) + (propagated-inputs + `(("python-et-xmlfile" ,python-et-xmlfile) + ("python-jdcal" ,python-jdcal))) + (home-page "https://openpyxl.readthedocs.io") + (synopsis + "Python library to read/write Excel 2010 XLSX/XLSM files") + (description + "This Python library allows reading and writing to the Excel XLSX, XLSM, +XLTX and XLTM file formats that are defined by the Office Open XML (OOXML) +standard.") + (license license:expat))) + (define-public python-eventlet (package (name "python-eventlet") -- 2.20.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0004-gnu-python-pandas-Enable-Excel-file-format-support.patch >From d13e1c487fc63f5ec878a492c048b947b6cb11e7 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Fri, 11 Jan 2019 13:24:43 -0500 Subject: [PATCH 4/5] gnu: python-pandas: Enable Excel file format support. * gnu/packages/python.scm (python-pandas)[phases]{check}: Re-instate the tests from the test_excel.py module. * gnu/packages/python.scm (python-pandas)[propagated-inputs]: Add python-openpyxl and python-xlrd. --- gnu/packages/python-xyz.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 427d6818e2..321c881f4d 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -1046,7 +1046,6 @@ human-friendly syntax.") '("pandas/tests/io/conftest.py" "pandas/tests/io/json/test_compression.py" "pandas/tests/io/parser/test_network.py" - "pandas/tests/io/test_excel.py" "pandas/tests/io/test_parquet.py")) (invoke "pytest" "-vv" "pandas" "--skip-slow" "--skip-network" "-k" @@ -1054,8 +1053,10 @@ human-friendly syntax.") "not test_read_s3_jsonl")))))))) (propagated-inputs `(("python-numpy" ,python-numpy) + ("python-openpyxl" ,python-openpyxl) ("python-pytz" ,python-pytz) - ("python-dateutil" ,python-dateutil))) + ("python-dateutil" ,python-dateutil) + ("python-xlrd" ,python-xlrd))) (native-inputs `(("python-cython" ,python-cython) ("python-beautifulsoup4" ,python-beautifulsoup4) -- 2.20.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0005-gnu-python-pandas-Update-to-0.24.2.patch >From ad1f0efe4a5c3d28ee9d7e2e5da275721af9e172 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sat, 9 Feb 2019 00:25:51 -0500 Subject: [PATCH 5/5] gnu: python-pandas: Update to 0.24.2. * gnu/packages/python-xyz.scm (python-pandas): Update to 0.24.2. [phases]{patch-which}: Add phase. [inputs]: Add WHICH. --- gnu/packages/python-xyz.scm | 65 ++++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 27 deletions(-) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 321c881f4d..bbf1403758 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -1014,56 +1014,67 @@ human-friendly syntax.") (define-public python-pandas (package (name "python-pandas") - (version "0.23.4") + (version "0.24.2") (source (origin (method url-fetch) (uri (pypi-uri "pandas" version)) (sha256 - (base32 "1x54pd7hr3y7qahx6b5bf2wzj54xvl8r3s1h4pl254pnmi3wl92v")))) + (base32 "18imlm8xbhcbwy4wa957a1fkamrcb0z988z006jpfda3ki09z4ag")))) (build-system python-build-system) (arguments `(#:modules ((guix build utils) (guix build python-build-system) (ice-9 ftw) (srfi srfi-26)) - #:phases (modify-phases %standard-phases - (replace 'check - (lambda _ - (let ((build-directory - (string-append - (getcwd) "/build/" - (car (scandir "build" - (cut string-prefix? "lib." <>)))))) - ;; Disable the "strict data files" option which causes - ;; the build to error out if required data files are not - ;; available (as is the case with PyPI archives). - (substitute* "setup.cfg" - (("addopts = --strict-data-files") "addopts = ")) - (with-directory-excursion build-directory - ;; Delete tests that require "moto" which is not yet in Guix. - (for-each delete-file - '("pandas/tests/io/conftest.py" - "pandas/tests/io/json/test_compression.py" - "pandas/tests/io/parser/test_network.py" - "pandas/tests/io/test_parquet.py")) - (invoke "pytest" "-vv" "pandas" "--skip-slow" - "--skip-network" "-k" - ;; XXX: Due to the deleted tests above. - "not test_read_s3_jsonl")))))))) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-which + (lambda* (#:key inputs #:allow-other-keys) + (let ((which (assoc-ref inputs "which"))) + (substitute* "pandas/io/clipboard/__init__.py" + (("^CHECK_CMD = .*") + (string-append "CHECK_CMD = \"" which "\"\n")))) + #t)) + (replace 'check + (lambda _ + (let ((build-directory + (string-append + (getcwd) "/build/" + (car (scandir "build" + (cut string-prefix? "lib." <>)))))) + ;; Disable the "strict data files" option which causes + ;; the build to error out if required data files are not + ;; available (as is the case with PyPI archives). + (substitute* "setup.cfg" + (("addopts = --strict-data-files") "addopts = ")) + (with-directory-excursion build-directory + ;; Delete tests that require "moto" which is not yet in Guix. + (for-each delete-file + '("pandas/tests/io/conftest.py" + "pandas/tests/io/json/test_compression.py" + "pandas/tests/io/parser/test_network.py" + "pandas/tests/io/test_parquet.py")) + (invoke "pytest" "-vv" "pandas" "--skip-slow" + "--skip-network" "-k" + ;; XXX: Due to the deleted tests above. + "not test_read_s3_jsonl")))))))) (propagated-inputs `(("python-numpy" ,python-numpy) ("python-openpyxl" ,python-openpyxl) ("python-pytz" ,python-pytz) ("python-dateutil" ,python-dateutil) ("python-xlrd" ,python-xlrd))) + (inputs + `(("which" ,which))) (native-inputs `(("python-cython" ,python-cython) ("python-beautifulsoup4" ,python-beautifulsoup4) ("python-lxml" ,python-lxml) ("python-html5lib" ,python-html5lib) ("python-nose" ,python-nose) - ("python-pytest" ,python-pytest))) + ("python-pytest" ,python-pytest) + ("python-pytest-mock" ,python-pytest-mock))) (home-page "https://pandas.pydata.org") (synopsis "Data structures for data analysis, time series, and statistics") (description -- 2.20.1 --=-=-=--