1{ lib
2, buildPythonPackage
3, fetchPypi
4, chardet
5, hatchling
6, html5lib
7, lxml
8, pytestCheckHook
9, pythonOlder
10, soupsieve
11, sphinxHook
12}:
13
14buildPythonPackage rec {
15 pname = "beautifulsoup4";
16 version = "4.12.2";
17 format = "pyproject";
18
19 outputs = ["out" "doc"];
20
21 disabled = pythonOlder "3.6";
22
23 src = fetchPypi {
24 inherit pname version;
25 hash = "sha256-SSu8adyjXRLarHHE2xv/8Mh2wA70ov+sziJtRjjrcto=";
26 };
27
28 nativeBuildInputs = [
29 hatchling
30 sphinxHook
31 ];
32
33 propagatedBuildInputs = [
34 chardet
35 soupsieve
36 ];
37
38 passthru.optional-dependencies = {
39 html5lib = [
40 html5lib
41 ];
42 lxml = [
43 lxml
44 ];
45 };
46
47 nativeCheckInputs = [
48 pytestCheckHook
49 ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
50
51 pythonImportsCheck = [
52 "bs4"
53 ];
54
55 meta = with lib; {
56 changelog = "https://git.launchpad.net/beautifulsoup/tree/CHANGELOG?h=${version}";
57 description = "HTML and XML parser";
58 homepage = "http://crummy.com/software/BeautifulSoup/bs4/";
59 license = licenses.mit;
60 maintainers = with maintainers; [ domenkozar ];
61 };
62}