From 43bbfae9e541fd9049a40cd4fe3ce7120dd6a95a Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Sun, 16 Nov 2014 15:32:46 +0100 Subject: [PATCH] Add python-taskw 0.8.6. --- ...emplate-for-taskwarrior-install-path.patch | 48 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 28 +++++++++++ 2 files changed, 76 insertions(+) create mode 100644 pkgs/development/python-modules/taskw/use-template-for-taskwarrior-install-path.patch diff --git a/pkgs/development/python-modules/taskw/use-template-for-taskwarrior-install-path.patch b/pkgs/development/python-modules/taskw/use-template-for-taskwarrior-install-path.patch new file mode 100644 index 000000000000..006d964d4016 --- /dev/null +++ b/pkgs/development/python-modules/taskw/use-template-for-taskwarrior-install-path.patch @@ -0,0 +1,48 @@ +commit 4de021d049a9b194da93d7e96ff12cc1cbabac83 +Author: Nicolas B. Pierron +Date: Sun Nov 16 15:19:38 2014 +0100 + + Use a template for taskwarrior install path. + +diff --git a/taskw/warrior.py b/taskw/warrior.py +index 21dde88..e0509f2 100644 +--- a/taskw/warrior.py ++++ b/taskw/warrior.py +@@ -451,17 +451,17 @@ class TaskWarriorShellout(TaskWarriorBase): + def _execute(self, *args): + """ Execute a given taskwarrior command with arguments + + Returns a 2-tuple of stdout and stderr (respectively). + + """ + command = ( + [ +- 'task', ++ '@@taskwarrior@@/bin/task', + 'rc:%s' % self.config_filename, + ] + + self.get_configuration_override_args() + + [six.text_type(arg) for arg in args] + ) + + # subprocess is expecting bytestrings only, so nuke unicode if present + for i in range(len(command)): +@@ -525,17 +525,17 @@ class TaskWarriorShellout(TaskWarriorBase): + except OSError: + # OSError is raised if subprocess.Popen fails to find + # the executable. + return False + + @classmethod + def get_version(cls): + taskwarrior_version = subprocess.Popen( +- ['task', '--version'], ++ ['@@taskwarrior@@/bin/task', '--version'], + stdout=subprocess.PIPE + ).communicate()[0] + return LooseVersion(taskwarrior_version.decode()) + + def sync(self, init=False): + if self.get_version() < LooseVersion('2.3'): + raise UnsupportedVersionException( + "'sync' requires version 2.3 of taskwarrior or later." diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c92303c63db7..f5c6ff0e81e3 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9535,6 +9535,34 @@ let }; }; + taskw = buildPythonPackage rec { + version = "0.8.6"; + name = "taskw-${version}"; + + src = pkgs.fetchurl { + url = "https://pypi.python.org/packages/source/t/taskw/${name}.tar.gz"; + # md5 = "9f3ce2eaff9a3986d04632547168894d"; # provided by pypi website. + sha256 = "341a165a1c2ef94fb1c2a49a785357377f04a0d55cabe9563179849497e47146"; + }; + + patches = [ ../development/python-modules/taskw/use-template-for-taskwarrior-install-path.patch ]; + postPatch = '' + substituteInPlace taskw/warrior.py \ + --replace '@@taskwarrior@@' '${pkgs.taskwarrior}' + ''; + + buildInputs = with self; [ nose pkgs.taskwarrior ]; + propagatedBuildInputs = with self; [ six dateutil pytz ]; + + meta = { + homepage = http://github.com/ralphbean/taskw; + description = "Python bindings for your taskwarrior database"; + license = licenses.gpl3Plus; + platforms = platforms.all; + maintainers = [ maintainers.pierron ]; + }; + }; + tempita = buildPythonPackage rec { version = "0.5.2"; name = "tempita-${version}";