unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Add python-patsy.
@ 2015-10-12 15:42 Ricardo Wurmus
  2015-10-22  8:49 ` Ricardo Wurmus
  2015-10-22 21:13 ` dthompson2
  0 siblings, 2 replies; 3+ messages in thread
From: Ricardo Wurmus @ 2015-10-12 15:42 UTC (permalink / raw)
  To: guix-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-gnu-Add-python-patsy.patch --]
[-- Type: text/x-patch, Size: 3644 bytes --]

From de399638e69e108f894db1851d0ebfb685d3842a Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Date: Mon, 12 Oct 2015 17:41:58 +0200
Subject: [PATCH] gnu: Add python-patsy.

* gnu/packages/statistics.scm (python-patsy, python2-patsy): New
  variables.
---
 gnu/packages/statistics.scm | 58 ++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 57 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
index f854a44..1492094 100644
--- a/gnu/packages/statistics.scm
+++ b/gnu/packages/statistics.scm
@@ -24,6 +24,7 @@
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system r)
+  #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages gcc)
@@ -35,11 +36,14 @@
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages texlive)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages base)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages zip)
+  #:use-module (srfi srfi-1))
 
 (define-public r
   (package
@@ -933,3 +937,55 @@ times.")
 large data (e.g. 100GB in RAM), fast ordered joins, fast add/modify/delete of
 columns by group, column listing and fast file reading.")
     (license license:gpl2+)))
+
+(define-public python-patsy
+  (package
+    (name "python-patsy")
+    (version "0.4.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://pypi.python.org/packages/source/"
+                                  "p/patsy/patsy-" version ".zip"))
+              (sha256
+               (base32
+                "1kbs996xc2haxalmhd19rr1wh5fa4gbbxf81czkf5w4kam7h7wz4"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check (lambda _ (zero? (system* "nosetests" "-v"))))
+         (add-after 'unpack 'prevent-generation-of-egg-archive
+          (lambda _
+            (substitute* "setup.py"
+              (("from setuptools import setup")
+               "from distutils.core import setup"))
+            #t)))))
+    (propagated-inputs
+     `(("python-numpy" ,python-numpy)
+       ("python-scipy" ,python-scipy)
+       ("python-six" ,python-six)))
+    (native-inputs
+     `(("python-nose" ,python-nose)
+       ("unzip" ,unzip)))
+    (home-page "https://github.com/pydata/patsy")
+    (synopsis "Describe statistical models and build design matrices")
+    (description
+     "Patsy is a Python package for describing statistical models and for
+building design matrices.")
+    ;; The majority of the code is distributed under BSD-2.  The module
+    ;; patsy.compat contains code derived from the Python standard library,
+    ;; and is covered by the PSFL.
+    (license (list license:bsd-2 license:psfl))))
+
+(define-public python2-patsy
+  (let ((patsy (package-with-python2 python-patsy)))
+    (package (inherit patsy)
+      (native-inputs
+       `(("python2-setuptools" ,python2-setuptools)
+         ,@(package-native-inputs patsy)))
+      (propagated-inputs
+       `(("python2-numpy" ,python2-numpy)
+         ("python2-scipy" ,python2-scipy)
+         ,@(alist-delete "python-numpy"
+                         (alist-delete "python-scipy"
+                                       (package-propagated-inputs patsy))))))))
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Add python-patsy.
  2015-10-12 15:42 [PATCH] Add python-patsy Ricardo Wurmus
@ 2015-10-22  8:49 ` Ricardo Wurmus
  2015-10-22 21:13 ` dthompson2
  1 sibling, 0 replies; 3+ messages in thread
From: Ricardo Wurmus @ 2015-10-22  8:49 UTC (permalink / raw)
  To: guix-devel

Hi Guix,

if there are no objections to this patch I’d like to push it as other
reviewed patches (e.g. statsmodels) depend on it.

~~ Ricardo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Add python-patsy.
  2015-10-12 15:42 [PATCH] Add python-patsy Ricardo Wurmus
  2015-10-22  8:49 ` Ricardo Wurmus
@ 2015-10-22 21:13 ` dthompson2
  1 sibling, 0 replies; 3+ messages in thread
From: dthompson2 @ 2015-10-22 21:13 UTC (permalink / raw)
  To: Ricardo Wurmus, guix-devel

Looks fine to me!

- Dave

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-10-22 21:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-12 15:42 [PATCH] Add python-patsy Ricardo Wurmus
2015-10-22  8:49 ` Ricardo Wurmus
2015-10-22 21:13 ` dthompson2

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).