2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
hatchling,
|
|
|
|
lxml,
|
2024-07-27 06:49:29 +00:00
|
|
|
lxml-html-clean,
|
2024-06-05 15:53:02 +00:00
|
|
|
beautifulsoup4,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
2021-06-28 23:13:55 +00:00
|
|
|
}:
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "html-sanitizer";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "2.4.4";
|
2024-04-21 15:54:59 +00:00
|
|
|
pyproject = true;
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "matthiask";
|
2024-04-21 15:54:59 +00:00
|
|
|
repo = "html-sanitizer";
|
2023-07-15 17:15:38 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-6OWFLsuefeDzQ1uHnLmboKDgrbY/xJCwqsSQlDaJlRs=";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ hatchling ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
lxml
|
2024-07-27 06:49:29 +00:00
|
|
|
lxml-html-clean
|
2021-06-28 23:13:55 +00:00
|
|
|
beautifulsoup4
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestFlagsArray = [ "html_sanitizer/tests.py" ];
|
2022-01-26 04:04:25 +00:00
|
|
|
|
|
|
|
disabledTests = [
|
2022-04-27 09:35:20 +00:00
|
|
|
# Tests are sensitive to output
|
2022-01-26 04:04:25 +00:00
|
|
|
"test_billion_laughs"
|
2022-04-27 09:35:20 +00:00
|
|
|
"test_10_broken_html"
|
2022-01-26 04:04:25 +00:00
|
|
|
];
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "html_sanitizer" ];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2021-06-28 23:13:55 +00:00
|
|
|
description = "Allowlist-based and very opinionated HTML sanitizer";
|
2020-07-18 16:06:22 +00:00
|
|
|
homepage = "https://github.com/matthiask/html-sanitizer";
|
2023-07-15 17:15:38 +00:00
|
|
|
changelog = "https://github.com/matthiask/html-sanitizer/blob/${version}/CHANGELOG.rst";
|
2021-06-28 23:13:55 +00:00
|
|
|
license = with licenses; [ bsd3 ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
}
|