1{ lib
2, buildPythonPackage
3, fetchPypi
4, fetchpatch
5, six
6, webencodings
7, mock
8, pytest-expect
9, pytestCheckHook
10}:
11
12buildPythonPackage rec {
13 pname = "html5lib";
14 version = "1.1";
15
16 src = fetchPypi {
17 inherit pname version;
18 sha256 = "b2e5b40261e20f354d198eae92afc10d750afb487ed5e50f9c4eaf07c184146f";
19 };
20
21 patches = [
22 # Fix compatibility with pytest 6.
23 # Will be included in the next release after 1.1.
24 (fetchpatch {
25 url = "https://github.com/html5lib/html5lib-python/commit/2c19b9899ab3a3e8bd0ca35e5d78544334204169.patch";
26 sha256 = "sha256-VGCeB6o2QO/skeCZs8XLPfgEYVOSRL8cCpG7ajbZWEs=";
27 })
28 ];
29
30 propagatedBuildInputs = [
31 six
32 webencodings
33 ];
34
35 # latest release not compatible with pytest 6
36 doCheck = false;
37 checkInputs = [
38 mock
39 pytest-expect
40 pytestCheckHook
41 ];
42
43 meta = {
44 homepage = "https://github.com/html5lib/html5lib-python";
45 downloadPage = "https://github.com/html5lib/html5lib-python/releases";
46 description = "HTML parser based on WHAT-WG HTML5 specification";
47 longDescription = ''
48 html5lib is a pure-python library for parsing HTML. It is designed to
49 conform to the WHATWG HTML specification, as is implemented by all
50 major web browsers.
51 '';
52 license = lib.licenses.mit;
53 maintainers = with lib.maintainers; [ domenkozar prikhi ];
54 };
55}