From da2f7c0ee625ddc2abf540ecc8a9eb675a873daf Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Fri, 26 Oct 2018 11:48:11 -0400 Subject: [PATCH] pythonPackages.pyutil: refactor move to python-modules --- .../python-modules/pyutil/default.nix | 50 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 38 +------------- 2 files changed, 51 insertions(+), 37 deletions(-) create mode 100644 pkgs/development/python-modules/pyutil/default.nix diff --git a/pkgs/development/python-modules/pyutil/default.nix b/pkgs/development/python-modules/pyutil/default.nix new file mode 100644 index 00000000000..8f875acac1b --- /dev/null +++ b/pkgs/development/python-modules/pyutil/default.nix @@ -0,0 +1,50 @@ +{ stdenv +, buildPythonPackage +, fetchPypi +, setuptoolsDarcs +, setuptoolsTrial +, simplejson +, zbase32 +, argparse +, twisted +, isPyPy +}: + +buildPythonPackage rec { + pname = "pyutil"; + version = "2.0.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "1fsg9yz5mi2sb0h6c1vvcqchx56i89nbvdb5gfgv1ia3b2w5ra8c"; + }; + + buildInputs = [ setuptoolsDarcs setuptoolsTrial ] ++ (if doCheck then [ simplejson ] else []); + propagatedBuildInputs = [ zbase32 argparse twisted ]; + + # Tests fail because they try to write new code into the twisted + # package, apparently some kind of plugin. + doCheck = false; + + prePatch = stdenv.lib.optionalString isPyPy '' + grep -rl 'utf-8-with-signature-unix' ./ | xargs sed -i -e "s|utf-8-with-signature-unix|utf-8|g" + ''; + + meta = with stdenv.lib; { + description = "Pyutil, a collection of mature utilities for Python programmers"; + + longDescription = '' + These are a few data structures, classes and functions which + we've needed over many years of Python programming and which + seem to be of general use to other Python programmers. Many of + the modules that have existed in pyutil over the years have + subsequently been obsoleted by new features added to the + Python language or its standard library, thus showing that + we're not alone in wanting tools like these. + ''; + + homepage = http://allmydata.org/trac/pyutil; + license = licenses.gpl2Plus; + }; + +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5bd345c71a6..739b933fe4e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3510,43 +3510,7 @@ in { pytzdata = callPackage ../development/python-modules/pytzdata { }; - pyutil = buildPythonPackage (rec { - name = "pyutil-2.0.0"; - - src = pkgs.fetchurl { - url = "mirror://pypi/p/pyutil/${name}.tar.gz"; - sha256 = "1fsg9yz5mi2sb0h6c1vvcqchx56i89nbvdb5gfgv1ia3b2w5ra8c"; - }; - - buildInputs = with self; [ setuptoolsDarcs setuptoolsTrial ] ++ (if doCheck then [ simplejson ] else []); - propagatedBuildInputs = with self; [ zbase32 argparse twisted ]; - # Tests fail because they try to write new code into the twisted - # package, apparently some kind of plugin. - doCheck = false; - - prePatch = optionalString isPyPy '' - grep -rl 'utf-8-with-signature-unix' ./ | xargs sed -i -e "s|utf-8-with-signature-unix|utf-8|g" - ''; - - meta = { - description = "Pyutil, a collection of mature utilities for Python programmers"; - - longDescription = '' - These are a few data structures, classes and functions which - we've needed over many years of Python programming and which - seem to be of general use to other Python programmers. Many of - the modules that have existed in pyutil over the years have - subsequently been obsoleted by new features added to the - Python language or its standard library, thus showing that - we're not alone in wanting tools like these. - ''; - - homepage = http://allmydata.org/trac/pyutil; - - license = licenses.gpl2Plus; - }; - }); - + pyutil = callPackage ../development/python-modules/pyutil { }; pywebkitgtk = buildPythonPackage rec { name = "pywebkitgtk-${version}";