1{
2 lib,
3 behave,
4 buildPythonPackage,
5 fetchPypi,
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.0";
18 pyproject = true;
19
20 disabled = pythonOlder "3.7";
21
22 src = fetchPypi {
23 inherit pname version;
24 hash = "sha256-WCm3IhQc8at5rt8MNNn+mSSyl2RYTA8hZOsrAtzfF8k=";
25 };
26
27 nativeBuildInputs = [ setuptools ];
28
29 propagatedBuildInputs = [
30 lxml
31 typing-extensions
32 ];
33
34 nativeCheckInputs = [
35 behave
36 mock
37 pyparsing
38 pytestCheckHook
39 ];
40
41 postCheck = ''
42 behave --format progress --stop --tags=-wip
43 '';
44
45 pythonImportsCheck = [ "docx" ];
46
47 disabledTests = [
48 # https://github.com/python-openxml/python-docx/issues/1302
49 "it_accepts_unicode_providing_there_is_no_encoding_declaration"
50 ];
51
52 pytestFlagsArray = [
53 "-W"
54 "ignore::DeprecationWarning"
55 ];
56
57 meta = with lib; {
58 description = "Create and update Microsoft Word .docx files";
59 homepage = "https://python-docx.readthedocs.io/";
60 changelog = "https://github.com/python-openxml/python-docx/blob/v${version}/HISTORY.rst";
61 license = licenses.mit;
62 maintainers = with maintainers; [ alexchapman ];
63 };
64}