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