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