nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6
7 # build-system
8 setuptools,
9
10 # dependencies
11 click,
12 dogpile-cache,
13 jinja2,
14 lockfile,
15 pydantic,
16 python-dateutil,
17 requests,
18 taskw,
19
20 # optional-dependencies
21 # bts
22 debianbts,
23 # bugzilla
24 python-bugzilla,
25 # gmail
26 google-api-python-client,
27 google-auth-oauthlib,
28 # jira
29 jira,
30 # keyring
31 keyring,
32 # trac
33 offtrac,
34
35 # tests
36 docutils,
37 pytestCheckHook,
38 responses,
39 sphinx,
40 sphinx-click,
41 sphinx-inline-tabs,
42 taskwarrior3,
43 versionCheckHook,
44 writableTmpDirAsHomeHook,
45}:
46
47buildPythonPackage (finalAttrs: {
48 pname = "bugwarrior";
49 version = "2.1.0";
50 pyproject = true;
51
52 src = fetchFromGitHub {
53 owner = "GothenburgBitFactory";
54 repo = "bugwarrior";
55 tag = finalAttrs.version;
56 hash = "sha256-Px0yOIdXalIJdXMmjMnpl74aaUzaptS8Esy21NMZH98=";
57 };
58
59 build-system = [ setuptools ];
60
61 dependencies = [
62 click
63 dogpile-cache
64 jinja2
65 lockfile
66 pydantic
67 python-dateutil
68 requests
69 taskw
70 ]
71 ++ pydantic.optional-dependencies.email;
72
73 optional-dependencies = {
74 bts = [ debianbts ];
75 bugzilla = [ python-bugzilla ];
76 gmail = [
77 google-api-python-client
78 google-auth-oauthlib
79 ];
80 jira = [ jira ];
81 keyring = [ keyring ];
82 trac = [ offtrac ];
83 };
84
85 nativeCheckInputs = [
86 docutils
87 pytestCheckHook
88 responses
89 sphinx
90 sphinx-click
91 sphinx-inline-tabs
92 taskwarrior3
93 versionCheckHook
94 writableTmpDirAsHomeHook
95 ]
96 ++ lib.concatAttrValues finalAttrs.passthru.optional-dependencies;
97 disabledTestPaths = [
98 # Optional dependencies for these services aren't packaged.
99 "tests/test_kanboard.py"
100 "tests/test_phab.py"
101 "tests/test_todoist.py"
102 ];
103 disabledTests = [
104 # Requires ini2toml dependency, which isn't packaged.
105 "TestIni2Toml"
106 # Import services for which the optional dependencies aren't packaged.
107 "TestValidation"
108 "ExampleTest"
109 "TestServices"
110
111 # Remove test that depend on ruff to prevent it from having too many consumers
112 "test_ruff_check"
113 "test_ruff_format"
114 ]
115 ++ lib.optionals stdenv.hostPlatform.isDarwin [
116 # sphinx.errors.ExtensionError: Could not import extension config
117 # (exception: No module named 'ini2toml')
118 "test_docs_build_without_warning"
119 "test_manpage_build_without_warning"
120 ];
121
122 pythonImportsCheck = [ "bugwarrior" ];
123
124 meta = {
125 homepage = "https://github.com/GothenburgBitFactory/bugwarrior";
126 description = "Sync github, bitbucket, bugzilla, and trac issues with taskwarrior";
127 changelog = "https://github.com/GothenburgBitFactory/bugwarrior/blob/${finalAttrs.src.tag}/CHANGELOG.rst";
128 license = lib.licenses.gpl3Plus;
129 platforms = lib.platforms.all;
130 mainProgram = "bugwarrior";
131 maintainers = with lib.maintainers; [
132 pierron
133 ryneeverett
134 ];
135 };
136})