public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] dev/mrueg:master commit in: dev-python/pyrfc3339/files/, dev-python/pyrfc3339/
@ 2015-07-13 18:56 Manuel Rüger
  0 siblings, 0 replies; only message in thread
From: Manuel Rüger @ 2015-07-13 18:56 UTC (permalink / raw
  To: gentoo-commits

commit:     6bcba40a67eba00210809eb83005728f17d5423f
Author:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 13 18:56:00 2015 +0000
Commit:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
CommitDate: Mon Jul 13 18:56:00 2015 +0000
URL:        https://gitweb.gentoo.org/dev/mrueg.git/commit/?id=6bcba40a

[dev-python/pyrfc3339] Add patch to fix tests with python3. Add python3 support.

Package-Manager: portage-2.2.20

 .../files/pyrfc3339-0.2-fixdoctests.patch          | 54 ++++++++++++++++++++++
 dev-python/pyrfc3339/pyrfc3339-0.2.ebuild          |  4 +-
 2 files changed, 57 insertions(+), 1 deletion(-)

diff --git a/dev-python/pyrfc3339/files/pyrfc3339-0.2-fixdoctests.patch b/dev-python/pyrfc3339/files/pyrfc3339-0.2-fixdoctests.patch
new file mode 100644
index 0000000..1ce4cb0
--- /dev/null
+++ b/dev-python/pyrfc3339/files/pyrfc3339-0.2-fixdoctests.patch
@@ -0,0 +1,54 @@
+From 085006c9ffc00d3fba3b91eb33111c791a592715 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Manuel=20R=C3=BCger?= <mrueg@rueg.eu>
+Date: Mon, 13 Jul 2015 20:49:51 +0200
+Subject: [PATCH] Fix doctests for python3
+
+---
+ pyrfc3339/generator.py | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/pyrfc3339/generator.py b/pyrfc3339/generator.py
+index 020d47b..62f88e0 100644
+--- a/pyrfc3339/generator.py
++++ b/pyrfc3339/generator.py
+@@ -9,7 +9,7 @@ def generate(dt, utc=True, accept_naive=False, microseconds=False):
+     :class:`datetime.datetime`.
+ 
+     >>> from datetime import datetime
+-    >>> generate(datetime(2009,01,01,12,59,59,0,pytz.utc))
++    >>> generate(datetime(2009,1,1,12,59,59,0,pytz.utc))
+     '2009-01-01T12:59:59Z'
+ 
+     The timestamp will use UTC unless `utc=False` is specified, in which case
+@@ -17,7 +17,7 @@ def generate(dt, utc=True, accept_naive=False, microseconds=False):
+     :attr:`tzinfo` parameter.
+ 
+     >>> eastern = pytz.timezone('US/Eastern')
+-    >>> dt = eastern.localize(datetime(2009,01,01,12,59,59))
++    >>> dt = eastern.localize(datetime(2009,1,1,12,59,59))
+     >>> generate(dt)
+     '2009-01-01T17:59:59Z'
+     >>> generate(dt, utc=False)
+@@ -25,19 +25,19 @@ def generate(dt, utc=True, accept_naive=False, microseconds=False):
+ 
+     Unless `accept_naive=True` is specified, the `datetime` must not be naive.
+ 
+-    >>> generate(datetime(2009,01,01,12,59,59,0))
++    >>> generate(datetime(2009,1,1,12,59,59,0))
+     Traceback (most recent call last):
+     ...
+     ValueError: naive datetime and accept_naive is False
+ 
+-    >>> generate(datetime(2009,01,01,12,59,59,0), accept_naive=True)
++    >>> generate(datetime(2009,1,1,12,59,59,0), accept_naive=True)
+     '2009-01-01T12:59:59Z'
+ 
+     If `accept_naive=True` is specified, the `datetime` is assumed to be UTC.
+     Attempting to generate a local timestamp from a naive datetime will result
+     in an error.
+ 
+-    >>> generate(datetime(2009,01,01,12,59,59,0), accept_naive=True, utc=False)
++    >>> generate(datetime(2009,1,1,12,59,59,0), accept_naive=True, utc=False)
+     Traceback (most recent call last):
+     ...
+     ValueError: cannot generate a local timestamp from a naive datetime

diff --git a/dev-python/pyrfc3339/pyrfc3339-0.2.ebuild b/dev-python/pyrfc3339/pyrfc3339-0.2.ebuild
index d43b092..f3c57d8 100644
--- a/dev-python/pyrfc3339/pyrfc3339-0.2.ebuild
+++ b/dev-python/pyrfc3339/pyrfc3339-0.2.ebuild
@@ -3,7 +3,7 @@
 # $Header: $
 
 EAPI=5
-PYTHON_COMPAT=(python2_7)
+PYTHON_COMPAT=(python{2_7,3_3,3_4})
 
 inherit distutils-r1
 MY_PN=pyRFC3339
@@ -25,6 +25,8 @@ DEPEND="test? ( ${RDEPEND}
 
 S=${WORKDIR}/${MY_P}
 
+PATCHES=("${FILESDIR}"/${P}-fixdoctests.patch)
+
 python_test() {
 	nosetests || die
 }


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-07-13 18:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-13 18:56 [gentoo-commits] dev/mrueg:master commit in: dev-python/pyrfc3339/files/, dev-python/pyrfc3339/ Manuel Rüger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox