unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 1/2] gnu: Add python-paste.
@ 2016-02-23 20:02 Christopher Allan Webber
  2016-02-25  1:28 ` Leo Famulari
  0 siblings, 1 reply; 3+ messages in thread
From: Christopher Allan Webber @ 2016-02-23 20:02 UTC (permalink / raw)
  To: guix-devel

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

From 0391cae1cb41cbe573521aa1ebedf7b94f92c985 Mon Sep 17 00:00:00 2001
From: Christopher Allan Webber <cwebber@dustycloud.org>
Date: Tue, 23 Feb 2016 11:54:43 -0800
Subject: [PATCH 1/2] gnu: Add python-paste.

* gnu/packages/python.scm (python-paste, python2-paste): New variables.
* gnu/packages/patches/python-paste-remove-timing-test.patch: New file.
* gnu/packages/patches/python-paste-remove-website-test.patch: New file.
* gnu-system.am (dist_patch_DATA): Add them.
---
 gnu-system.am                                      |  2 +
 .../patches/python-paste-remove-timing-test.patch  | 16 ++++++++
 .../patches/python-paste-remove-website-test.patch | 21 ++++++++++
 gnu/packages/python.scm                            | 46 ++++++++++++++++++++++
 4 files changed, 85 insertions(+)
 create mode 100644 gnu/packages/patches/python-paste-remove-timing-test.patch
 create mode 100644 gnu/packages/patches/python-paste-remove-website-test.patch

diff --git a/gnu-system.am b/gnu-system.am
index a93b005..2c8551c 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -679,6 +679,8 @@ dist_patch_DATA =						\
   gnu/packages/patches/python-ipython-inputhook-ctype.patch	\
   gnu/packages/patches/python2-rdflib-drop-sparqlwrapper.patch	\
   gnu/packages/patches/python-configobj-setuptools.patch	\
+  gnu/packages/patches/python-paste-remove-website-test.patch	\
+  gnu/packages/patches/python-paste-remove-timing-test.patch	\
   gnu/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch \
   gnu/packages/patches/qemu-CVE-2015-8558.patch			\
   gnu/packages/patches/qemu-CVE-2015-8567.patch			\
diff --git a/gnu/packages/patches/python-paste-remove-timing-test.patch b/gnu/packages/patches/python-paste-remove-timing-test.patch
new file mode 100644
index 0000000..6ab8d1a
--- /dev/null
+++ b/gnu/packages/patches/python-paste-remove-timing-test.patch
@@ -0,0 +1,16 @@
+Remove this test to verify that things were modified since a certain time.
+
+That assumption doesn't hold up when your environment doesn't have access to a
+real clock and thinks it's living in 1970 :)
+
+--- a/tests/test_fileapp.py    2015-04-23 13:48:37.000000000 -0700
++++ b/tests/test_fileapp.py	2016-02-22 19:20:08.332802417 -0800
+@@ -223,8 +223,6 @@
+                   status=304)
+     res = app.get('/', headers={'If-None-Match': 'asdf'},
+                   status=200)
+-    res = app.get('/', headers={'If-Modified-Since': 'Sat, 1 Jan 2005 12:00:00 GMT'},
+-                  status=200)
+     res = app.get('/', headers={'If-Modified-Since': last_mod + '; length=100'},
+                   status=304)
+     res = app.get('/', headers={'If-Modified-Since': 'invalid date'},
diff --git a/gnu/packages/patches/python-paste-remove-website-test.patch b/gnu/packages/patches/python-paste-remove-website-test.patch
new file mode 100644
index 0000000..93417fb
--- /dev/null
+++ b/gnu/packages/patches/python-paste-remove-website-test.patch
@@ -0,0 +1,21 @@
+Remove the test to see if the Python Paste website is up.
+
+Obviously without network access there is no way for us to check this, and
+it's pretty strange to test a project's website when you really mean to test
+the project anyhow...
+
+--- a/tests/test_proxy.py	2016-02-22 19:13:04.040117767 -0800
++++ b/tests/test_proxy.py	2016-02-22 19:13:04.040117767 -0800
+@@ -1,12 +1,3 @@
+ from paste import proxy
+ from paste.fixture import TestApp
+
+-def test_paste_website():
+-    # Not the most robust test...
+-    # need to test things like POSTing to pages, and getting from pages
+-    # that don't set content-length.
+-    app = proxy.Proxy('http://pythonpaste.org')
+-    app = TestApp(app)
+-    res = app.get('/')
+-    assert 'documentation' in res
+-
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 55a62a9..9673037 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -7774,6 +7774,52 @@ file.")
 (define-public python2-pastedeploy
   (package-with-python2 python-pastedeploy))
 
+(define-public python-paste
+  (package
+    (name "python-paste")
+    (version "2.0.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "Paste" version))
+       (sha256
+        (base32
+         "16dsv9qi0r4qsrsb6dilpq2rx0fnglvh36flzywcdnm2jg43mb5d"))
+       (patches (list (search-patch
+                       "python-paste-remove-website-test.patch")
+                      (search-patch
+                       "python-paste-remove-timing-test.patch")))))
+    (build-system python-build-system)
+    (native-inputs
+     `(("python-nose" ,python-nose)))
+    (propagated-inputs
+     `(;; Uses pkg_resources provided by setuptools internally.
+       ("python-setuptools" ,python-setuptools)
+       ("python-six" ,python-six)))
+    (arguments
+     '(;; Tests don't pass on Python 3, but work fine on Python 2.
+       ;; (As of 2.0.2, Python 3 support in Paste is presently a bit broken,
+       ;; but is usable enough for the minimal amount it's used in MediaGoblin
+       ;; still... things should be better by the next Paste release.)
+       #:tests? #f))
+    (home-page "http://pythonpaste.org")
+    (synopsis
+     "Python web development tools, focusing on WSGI")
+    (description
+     "Paste provides a variety of web development tools and middleware which
+can be nested together to build web applications.  Paste's design closely
+follows ideas flowing from WSGI (Web Standard Gateway Interface).")
+    (license license:expat)))
+
+(define-public python2-paste
+  (package
+    (inherit (strip-python2-variant
+              (package-with-python2 python-paste)))
+    (arguments
+     ;; Tests are back for Python 2!
+     `(#:python ,python-2
+                #:tests? #t))))
+
 (define-public python-pyquery
   (package
     (name "python-pyquery")
-- 
2.6.3

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

end of thread, other threads:[~2016-02-25 19:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-23 20:02 [PATCH 1/2] gnu: Add python-paste Christopher Allan Webber
2016-02-25  1:28 ` Leo Famulari
2016-02-25 19:03   ` Christopher Allan Webber

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).