Gentoo Archives: gentoo-commits

From: "Tiziano Müller" <dev-zero@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/dev-zero:master commit in: dev-python/taskw/files/, dev-python/taskw/
Date: Wed, 03 Dec 2014 12:54:38
Message-Id: 1417611264.02263c3bdc6c6fae9e267def03aa6c74759ad816.dev-zero@gentoo
1 commit: 02263c3bdc6c6fae9e267def03aa6c74759ad816
2 Author: Tiziano Müller <dev-zero <AT> gentoo <DOT> org>
3 AuthorDate: Wed Dec 3 12:54:24 2014 +0000
4 Commit: Tiziano Müller <dev-zero <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 3 12:54:24 2014 +0000
6 URL: http://sources.gentoo.org/gitweb/?p=dev/dev-zero.git;a=commit;h=02263c3b
7
8 initial commit, needed by bugwarrior
9
10 ---
11 dev-python/taskw/Manifest | 1 +
12 ...et-the-timezone-to-UTC-when-adding-a-task.patch | 44 ++++++++++++++++++++++
13 dev-python/taskw/taskw-0.8.6.ebuild | 30 +++++++++++++++
14 3 files changed, 75 insertions(+)
15
16 diff --git a/dev-python/taskw/Manifest b/dev-python/taskw/Manifest
17 new file mode 100644
18 index 0000000..e4e4787
19 --- /dev/null
20 +++ b/dev-python/taskw/Manifest
21 @@ -0,0 +1 @@
22 +DIST taskw-0.8.6.tar.gz 37293 SHA256 341a165a1c2ef94fb1c2a49a785357377f04a0d55cabe9563179849497e47146 SHA512 0969eb4b2c4fb664a8568b373081b822f889c887a51609987bb88a25c1febc8cca9f32210b7825751fe024cb57642d697af332803e83d8952c75034b7e80b91e WHIRLPOOL 540a77473aa8a2f05eebe0f6025c46e4fa550634933fa7f8a2dc72fe316ead6c747a36c90a0a0beffdcfd740560b8b5e545f42983b2a07f52ad785682aa2e723
23
24 diff --git a/dev-python/taskw/files/0.8.6-test-set-the-timezone-to-UTC-when-adding-a-task.patch b/dev-python/taskw/files/0.8.6-test-set-the-timezone-to-UTC-when-adding-a-task.patch
25 new file mode 100644
26 index 0000000..12ece25
27 --- /dev/null
28 +++ b/dev-python/taskw/files/0.8.6-test-set-the-timezone-to-UTC-when-adding-a-task.patch
29 @@ -0,0 +1,44 @@
30 +From 9323d6755cebcbde36c0d8fbe10847bce1329f9d Mon Sep 17 00:00:00 2001
31 +From: =?UTF-8?q?Tiziano=20M=C3=BCller?= <tm@××××××××.ch>
32 +Date: Tue, 2 Dec 2014 17:29:02 +0100
33 +Subject: [PATCH] test: set the timezone to UTC when adding a task
34 +
35 +This fixes issue #75 where the date set was interpreted in localtime but
36 +the date returned was in UTC, making the assertion fail.
37 +---
38 + taskw/test/test_datas.py | 5 +++--
39 + 1 file changed, 3 insertions(+), 2 deletions(-)
40 +
41 +diff --git a/taskw/test/test_datas.py b/taskw/test/test_datas.py
42 +index 22c276a..b2ede4c 100644
43 +--- a/taskw/test/test_datas.py
44 ++++ b/taskw/test/test_datas.py
45 +@@ -5,6 +5,7 @@ import sys
46 + import shutil
47 + import tempfile
48 + import datetime
49 ++import dateutil.tz
50 +
51 + from taskw import TaskWarriorDirect, TaskWarriorShellout
52 +
53 +@@ -183,7 +184,7 @@ class _BaseTestDB(object):
54 + "foobar",
55 + uuid="1234-1234",
56 + project="some_project",
57 +- entry=datetime.datetime(2011, 1, 1),
58 ++ entry=datetime.datetime(2011, 1, 1, tzinfo=dateutil.tz.tzutc()),
59 + )
60 + tasks = self.tw.load_tasks()
61 + eq_(len(tasks['pending']), 1)
62 +@@ -205,7 +206,7 @@ class _BaseTestDB(object):
63 + def test_add_with_uda_date(self):
64 + self.tw.task_add(
65 + "foobar",
66 +- somedate=datetime.datetime(2011, 1, 1),
67 ++ somedate=datetime.datetime(2011, 1, 1, tzinfo=dateutil.tz.tzutc()),
68 + )
69 + tasks = self.tw.load_tasks()
70 + eq_(len(tasks['pending']), 1)
71 +--
72 +2.1.3
73 +
74
75 diff --git a/dev-python/taskw/taskw-0.8.6.ebuild b/dev-python/taskw/taskw-0.8.6.ebuild
76 new file mode 100644
77 index 0000000..0c57e20
78 --- /dev/null
79 +++ b/dev-python/taskw/taskw-0.8.6.ebuild
80 @@ -0,0 +1,30 @@
81 +# Copyright 1999-2014 Gentoo Foundation
82 +# Distributed under the terms of the GNU General Public License v2
83 +# $Header: $
84 +
85 +EAPI=5
86 +PYTHON_COMPAT=( python{2_7,3_2,3_3} )
87 +
88 +inherit distutils-r1
89 +
90 +DESCRIPTION="Python bindings for your taskwarrior database"
91 +HOMEPAGE="https://github.com/ralphbean/taskw"
92 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
93 +
94 +LICENSE="GPL-3+"
95 +SLOT="0"
96 +KEYWORDS="~amd64"
97 +IUSE="test"
98 +
99 +RDEPEND="dev-python/six[${PYTHON_USEDEP}]
100 + dev-python/python-dateutil[${PYTHON_USEDEP}]
101 + dev-python/pytz[${PYTHON_USEDEP}]"
102 +DEPEND="${RDEPEND}
103 + test? ( dev-python/unittest2[${PYTHON_USEDEP}]
104 + dev-python/nose[${PYTHON_USEDEP}] )"
105 +
106 +PATCHES=( "${FILESDIR}/${PV}-test-set-the-timezone-to-UTC-when-adding-a-task.patch" )
107 +
108 +python_test() {
109 + nosetests || die
110 +}