1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytestCheckHook,
6 lxml,
7 lxml-html-clean,
8}:
9
10buildPythonPackage rec {
11 pname = "justext";
12 version = "3.0.1";
13 format = "setuptools";
14
15 src = fetchFromGitHub {
16 owner = "miso-belica";
17 repo = "jusText";
18 rev = "refs/tags/v${version}";
19 hash = "sha256-9i7hzCK/ijh8xw9l2ZbVhVj5IBf0WD/49/R1tSWgqrQ=";
20 };
21
22 propagatedBuildInputs = [
23 lxml
24 lxml-html-clean
25 ];
26
27 nativeCheckInputs = [ pytestCheckHook ];
28
29 # patch out coverage report
30 postPatch = ''
31 substituteInPlace setup.cfg \
32 --replace-fail " --cov=justext --cov-report=term-missing --no-cov-on-fail" ""
33 '';
34
35 pythonImportsCheck = [ "justext" ];
36
37 meta = with lib; {
38 description = "Heuristic based boilerplate removal tool";
39 homepage = "https://github.com/miso-belica/jusText";
40 changelog = "https://github.com/miso-belica/jusText/blob/v${version}/CHANGELOG.rst";
41 license = licenses.bsd2;
42 maintainers = with maintainers; [ jokatzke ];
43 };
44}