at master 2.2 kB view raw
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 # optional dependencies 31 chardet, 32 citeproc-py, 33 jinja2, 34 markdownify, 35 whoosh, 36 37 # switch for optional dependencies 38 withOptDeps ? false, 39 40 # tests 41 docutils, 42 git, 43 pytestCheckHook, 44 pytest-cov-stub, 45 sphinx, 46 sphinx-click, 47}: 48buildPythonPackage rec { 49 pname = "papis"; 50 version = "0.14.1"; 51 pyproject = true; 52 53 src = fetchFromGitHub { 54 owner = "papis"; 55 repo = "papis"; 56 tag = "v${version}"; 57 hash = "sha256-V4YswLNYwfBYe/Td0PEeDG++ClZoF08yxXjUXuyppPI="; 58 }; 59 60 build-system = [ hatchling ]; 61 62 dependencies = [ 63 arxiv 64 beautifulsoup4 65 bibtexparser 66 click 67 colorama 68 dominate 69 filetype 70 habanero 71 isbnlib 72 lxml 73 platformdirs 74 prompt-toolkit 75 pygments 76 pyparsing 77 python-doi 78 python-slugify 79 pyyaml 80 requests 81 stevedore 82 ] 83 ++ lib.optionals withOptDeps optional-dependencies.complete; 84 85 optional-dependencies = { 86 complete = [ 87 chardet 88 citeproc-py 89 jinja2 90 markdownify 91 whoosh 92 ]; 93 }; 94 95 pythonImportsCheck = [ "papis" ]; 96 97 nativeCheckInputs = [ 98 docutils 99 git 100 pytestCheckHook 101 pytest-cov-stub 102 sphinx 103 sphinx-click 104 ]; 105 106 preCheck = '' 107 export HOME=$(mktemp -d); 108 ''; 109 110 enabledTestPaths = [ 111 "papis" 112 "tests" 113 ]; 114 115 disabledTestPaths = [ 116 # Require network access 117 "tests/downloaders" 118 "papis/downloaders/usenix.py" 119 ]; 120 121 disabledTests = [ 122 # Require network access 123 "test_yaml_unicode_dump" 124 ]; 125 126 meta = { 127 description = "Powerful command-line document and bibliography manager"; 128 mainProgram = "papis"; 129 homepage = "https://papis.readthedocs.io/"; 130 changelog = "https://github.com/papis/papis/blob/${src.tag}/CHANGELOG.md"; 131 license = lib.licenses.gpl3Only; 132 maintainers = with lib.maintainers; [ 133 nico202 134 teto 135 ]; 136 }; 137}