1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchPypi,
6 unittestCheckHook,
7 html-tidy,
8}:
9
10buildPythonPackage rec {
11 pname = "pytidylib";
12 version = "0.3.2";
13 format = "setuptools";
14
15 src = fetchPypi {
16 inherit pname version;
17 sha256 = "22b1c8d75970d8064ff999c2369e98af1d0685417eda4c829a5c9f56764b0af3";
18 };
19
20 postPatch = ''
21 # Patch path to library
22 substituteInPlace tidylib/tidy.py \
23 --replace "load_library(name)" \
24 "load_library('${html-tidy}/lib/libtidy${stdenv.hostPlatform.extensions.sharedLibrary}')"
25
26 # Test fails
27 substituteInPlace tests/test_docs.py \
28 --replace " def test_large_document(self):" \
29 $' @unittest.skip("")\n def test_large_document(self):'
30 '';
31
32 nativeCheckInputs = [ unittestCheckHook ];
33
34 meta = with lib; {
35 description = "Python wrapper for HTML Tidy (tidylib) on Python 2 and 3";
36 homepage = "https://countergram.github.io/pytidylib/";
37 license = licenses.mit;
38 maintainers = with maintainers; [ layus ];
39 };
40}