From fbb60556f8d831b00966129cda31fba032cfc2df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 8 Aug 2018 01:18:27 +0200 Subject: [PATCH] python.pkgs.tidylib: 0.2.4 -> 0.3.2 fixes #44581 --- .../python-modules/pytidylib/default.nix | 34 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 32 +---------------- 2 files changed, 35 insertions(+), 31 deletions(-) create mode 100644 pkgs/development/python-modules/pytidylib/default.nix diff --git a/pkgs/development/python-modules/pytidylib/default.nix b/pkgs/development/python-modules/pytidylib/default.nix new file mode 100644 index 000000000000..4ece6fb41343 --- /dev/null +++ b/pkgs/development/python-modules/pytidylib/default.nix @@ -0,0 +1,34 @@ +{ stdenv, buildPythonPackage, fetchPypi, python, html-tidy }: + +buildPythonPackage rec { + pname = "pytidylib"; + version = "0.3.2"; + + src = fetchPypi { + inherit pname version; + sha256 = "22b1c8d75970d8064ff999c2369e98af1d0685417eda4c829a5c9f56764b0af3"; + }; + + postPatch = '' + # Patch path to library + substituteInPlace tidylib/tidy.py \ + --replace "load_library(name)" \ + "load_library('${html-tidy}/lib/libtidy${stdenv.hostPlatform.extensions.sharedLibrary}')" + + # Test fails + substituteInPlace tests/test_docs.py \ + --replace " def test_large_document(self):" \ + $' @unittest.skip("")\n def test_large_document(self):' + ''; + + checkPhase = '' + ${python.interpreter} -m unittest discover + ''; + + meta = with stdenv.lib; { + description = "Python wrapper for HTML Tidy (tidylib) on Python 2 and 3"; + homepage = https://countergram.github.io/pytidylib/; + license = licenses.mit; + maintainers = with maintainers; [ layus ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 82e7f4be192a..1355d58e0e7a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -12624,37 +12624,7 @@ in { thespian = callPackage ../development/python-modules/thespian { }; - tidylib = buildPythonPackage rec { - version = "0.2.4"; - name = "pytidylib-${version}"; - - propagatedBuildInputs = [ pkgs.html-tidy ]; - - src = pkgs.fetchurl { - url = "mirror://pypi/p/pytidylib/pytidylib-${version}.tar.gz"; - sha256 = "0af07bd8ebd256af70ca925ada9337faf16d85b3072624f975136a5134150ab6"; - }; - - # Judging from SyntaxError in tests - disabled = isPy3k; - - checkPhase = '' - ${python.interpreter} -m unittest discover - ''; - - # Bunch of tests fail - # https://github.com/countergram/pytidylib/issues/13 - doCheck = false; - - patchPhase = '' - sed -i 's#load_library(name)#load_library("${pkgs.html-tidy}/lib/libtidy.so")#' tidylib/__init__.py - ''; - - meta = { - homepage = " http://countergram.com/open-source/pytidylib/"; - maintainers = with maintainers; [ layus ]; - }; - }; + tidylib = callPackage ../development/python-modules/pytidylib { }; tilestache = self.buildPythonPackage rec { name = "tilestache-${version}";