1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 cobble,
7 funk,
8 pytestCheckHook,
9 spur,
10 tempman,
11 gitUpdater,
12}:
13
14buildPythonPackage rec {
15 pname = "mammoth";
16 version = "1.11.0";
17 pyproject = true;
18
19 src = fetchFromGitHub {
20 owner = "mwilliamson";
21 repo = "python-mammoth";
22 tag = version;
23 hash = "sha256-x1wSudTD/C1uHnudaCCrhi9fyQInCej+Kd7CyBI2sus=";
24 };
25
26 postPatch = ''
27 substituteInPlace setup.py \
28 --replace-fail 'read("README")' '""'
29 '';
30
31 build-system = [ setuptools ];
32
33 dependencies = [ cobble ];
34
35 pythonImportsCheck = [ "mammoth" ];
36
37 nativeCheckInputs = [
38 funk
39 pytestCheckHook
40 spur
41 tempman
42 ];
43
44 preCheck = ''
45 export PATH=$out/bin:$PATH
46 '';
47
48 passthru.updateScripts = gitUpdater { };
49
50 meta = {
51 description = "Convert Word documents (.docx files) to HTML";
52 homepage = "https://github.com/mwilliamson/python-mammoth";
53 changelog = "https://github.com/mwilliamson/python-mammoth/blob/${src.tag}/NEWS";
54 license = lib.licenses.bsd2;
55 maintainers = with lib.maintainers; [ ];
56 };
57}