1{
2 lib,
3 behave,
4 buildPythonPackage,
5 fetchFromGitHub,
6 lxml,
7 mock,
8 pyparsing,
9 pytestCheckHook,
10 pythonOlder,
11 setuptools,
12 typing-extensions,
13}:
14
15buildPythonPackage rec {
16 pname = "python-docx";
17 version = "1.1.2";
18 pyproject = true;
19
20 disabled = pythonOlder "3.7";
21
22 src = fetchFromGitHub {
23 owner = "python-openxml";
24 repo = "python-docx";
25 tag = "v${version}";
26 hash = "sha256-isxMtq5j5J02GcHMzOJdJw+ZokLoxA6fG1xsN21Irbc=";
27 };
28
29 build-system = [ setuptools ];
30
31 dependencies = [
32 lxml
33 typing-extensions
34 ];
35
36 nativeCheckInputs = [
37 behave
38 mock
39 pyparsing
40 pytestCheckHook
41 ];
42
43 postCheck = ''
44 behave --format progress --stop --tags=-wip
45 '';
46
47 pythonImportsCheck = [ "docx" ];
48
49 disabledTests = [
50 # https://github.com/python-openxml/python-docx/issues/1302
51 "it_accepts_unicode_providing_there_is_no_encoding_declaration"
52 ];
53
54 pytestFlags = [
55 "-Wignore::DeprecationWarning"
56 ];
57
58 meta = with lib; {
59 description = "Create and update Microsoft Word .docx files";
60 homepage = "https://python-docx.readthedocs.io/";
61 changelog = "https://github.com/python-openxml/python-docx/blob/v${version}/HISTORY.rst";
62 license = licenses.mit;
63 maintainers = with maintainers; [ alexchapman ];
64 };
65}