depot/third_party/nixpkgs/pkgs/development/python-modules/html-sanitizer/default.nix
Default email c7cb07f092 Project import generated by Copybara.
GitOrigin-RevId: 1536926ef5621b09bba54035ae2bb6d806d72ac8
2024-02-29 21:09:43 +01:00

59 lines
1.1 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, hatchling
, lxml
, beautifulsoup4
, pytestCheckHook
, pythonOlder
}:
buildPythonPackage rec {
pname = "html-sanitizer";
version = "2.3";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "matthiask";
repo = pname;
rev = "refs/tags/${version}";
hash = "sha256-lQ8E3hdHX0YR3HJUTz1pVBegLo4lhvyiylLVFMDY1+s=";
};
nativeBuildInputs = [
hatchling
];
propagatedBuildInputs = [
lxml
beautifulsoup4
];
nativeCheckInputs = [
pytestCheckHook
];
pytestFlagsArray = [
"html_sanitizer/tests.py"
];
disabledTests = [
# Tests are sensitive to output
"test_billion_laughs"
"test_10_broken_html"
];
pythonImportsCheck = [
"html_sanitizer"
];
meta = with lib; {
description = "Allowlist-based and very opinionated HTML sanitizer";
homepage = "https://github.com/matthiask/html-sanitizer";
changelog = "https://github.com/matthiask/html-sanitizer/blob/${version}/CHANGELOG.rst";
license = with licenses; [ bsd3 ];
maintainers = with maintainers; [ fab ];
};
}