1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 hatchling,
8
9 # dependencies
10 arxiv,
11 beautifulsoup4,
12 bibtexparser,
13 click,
14 colorama,
15 dominate,
16 filetype,
17 habanero,
18 isbnlib,
19 lxml,
20 platformdirs,
21 prompt-toolkit,
22 pygments,
23 pyparsing,
24 python-doi,
25 python-slugify,
26 pyyaml,
27 requests,
28 stevedore,
29
30 # tests
31 docutils,
32 git,
33 pytestCheckHook,
34 sphinx,
35 sphinx-click,
36}:
37buildPythonPackage rec {
38 pname = "papis";
39 version = "0.14.1";
40 pyproject = true;
41
42 src = fetchFromGitHub {
43 owner = "papis";
44 repo = "papis";
45 tag = "v${version}";
46 hash = "sha256-V4YswLNYwfBYe/Td0PEeDG++ClZoF08yxXjUXuyppPI=";
47 };
48
49 build-system = [ hatchling ];
50
51 dependencies = [
52 arxiv
53 beautifulsoup4
54 bibtexparser
55 click
56 colorama
57 dominate
58 filetype
59 habanero
60 isbnlib
61 lxml
62 platformdirs
63 prompt-toolkit
64 pygments
65 pyparsing
66 python-doi
67 python-slugify
68 pyyaml
69 requests
70 stevedore
71 ];
72
73 postPatch = ''
74 substituteInPlace pyproject.toml \
75 --replace-fail "--cov=papis" ""
76 '';
77
78 pythonImportsCheck = [ "papis" ];
79
80 nativeCheckInputs = [
81 docutils
82 git
83 pytestCheckHook
84 sphinx
85 sphinx-click
86 ];
87
88 preCheck = ''
89 export HOME=$(mktemp -d);
90 '';
91
92 pytestFlagsArray = [
93 "papis"
94 "tests"
95 ];
96
97 disabledTestPaths = [
98 # Require network access
99 "tests/downloaders"
100 "papis/downloaders/usenix.py"
101 ];
102
103 disabledTests = [
104 # Require network access
105 "test_yaml_unicode_dump"
106 ];
107
108 meta = {
109 description = "Powerful command-line document and bibliography manager";
110 mainProgram = "papis";
111 homepage = "https://papis.readthedocs.io/";
112 changelog = "https://github.com/papis/papis/blob/${src.tag}/CHANGELOG.md";
113 license = lib.licenses.gpl3Only;
114 maintainers = with lib.maintainers; [
115 nico202
116 teto
117 ];
118 };
119}