2019-06-16 20:59:06 +01:00
|
|
|
{ lib, buildPythonPackage, fetchFromGitHub, xdg_utils
|
2019-04-11 11:55:08 +01:00
|
|
|
, requests, filetype, pyparsing, configparser, arxiv2bib
|
|
|
|
, pyyaml, chardet, beautifulsoup4, colorama, bibtexparser
|
2020-06-20 18:27:49 +01:00
|
|
|
, click, python-slugify, habanero, isbnlib, typing-extensions
|
2019-10-23 05:14:17 +01:00
|
|
|
, prompt_toolkit, pygments, stevedore, tqdm, lxml
|
2020-06-20 18:27:49 +01:00
|
|
|
, python-doi, isPy3k, pythonOlder, pytestcov
|
2019-04-11 11:55:08 +01:00
|
|
|
#, optional, dependencies
|
2019-10-23 05:14:17 +01:00
|
|
|
, whoosh, pytest
|
2019-04-23 03:49:34 +01:00
|
|
|
, stdenv
|
2018-02-09 12:16:36 +00:00
|
|
|
}:
|
|
|
|
|
2019-04-11 11:55:08 +01:00
|
|
|
buildPythonPackage rec {
|
2018-02-09 12:16:36 +00:00
|
|
|
pname = "papis";
|
2020-06-20 18:27:49 +01:00
|
|
|
version = "0.10";
|
2019-11-25 21:46:58 +00:00
|
|
|
disabled = !isPy3k;
|
2018-02-09 12:16:36 +00:00
|
|
|
|
|
|
|
# Missing tests on Pypi
|
|
|
|
src = fetchFromGitHub {
|
2018-02-21 11:10:38 +00:00
|
|
|
owner = "papis";
|
2018-02-09 12:16:36 +00:00
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-06-20 18:27:49 +01:00
|
|
|
sha256 = "0fmrvxs6ixfwjlp96b69db7fpvyqfy2n3c23kdz8yr0vhnp82l93";
|
2019-01-31 18:38:32 +00:00
|
|
|
};
|
2018-02-09 12:16:36 +00:00
|
|
|
|
2019-04-11 11:55:08 +01:00
|
|
|
propagatedBuildInputs = [
|
2019-02-27 12:58:43 +00:00
|
|
|
requests filetype pyparsing configparser arxiv2bib
|
|
|
|
pyyaml chardet beautifulsoup4 colorama bibtexparser
|
2020-06-20 18:27:49 +01:00
|
|
|
click python-slugify habanero isbnlib
|
|
|
|
prompt_toolkit pygments typing-extensions
|
2019-10-23 05:14:17 +01:00
|
|
|
stevedore tqdm lxml
|
|
|
|
python-doi
|
2019-01-31 18:38:32 +00:00
|
|
|
# optional dependencies
|
2019-10-23 05:14:17 +01:00
|
|
|
whoosh
|
2018-02-09 12:16:36 +00:00
|
|
|
];
|
|
|
|
|
2019-11-25 21:46:58 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "lxml<=4.3.5" "lxml~=4.3" \
|
2020-06-20 18:27:49 +01:00
|
|
|
--replace "isbnlib>=3.9.1,<3.10" "isbnlib~=3.9" \
|
2019-11-25 21:46:58 +00:00
|
|
|
--replace "python-slugify>=1.2.6,<4" "python-slugify"
|
|
|
|
'';
|
2019-10-23 05:14:17 +01:00
|
|
|
|
2019-11-25 21:46:58 +00:00
|
|
|
# pytest seems to hang with python3.8
|
|
|
|
doCheck = !stdenv.isDarwin && pythonOlder "3.8";
|
2019-04-23 03:49:34 +01:00
|
|
|
|
2019-04-11 11:55:08 +01:00
|
|
|
checkInputs = ([
|
2020-06-20 18:27:49 +01:00
|
|
|
pytest pytestcov
|
2019-01-31 18:38:32 +00:00
|
|
|
]) ++ [
|
|
|
|
xdg_utils
|
|
|
|
];
|
2018-02-21 11:10:38 +00:00
|
|
|
|
2019-02-27 12:58:43 +00:00
|
|
|
# most of the downloader tests and 4 other tests require a network connection
|
2019-05-01 22:10:35 +01:00
|
|
|
# test_export_yaml and test_citations check for the exact output produced by pyyaml 3.x and
|
|
|
|
# fail with 5.x
|
2019-01-31 18:38:32 +00:00
|
|
|
checkPhase = ''
|
2019-02-27 12:58:43 +00:00
|
|
|
HOME=$(mktemp -d) pytest papis tests --ignore tests/downloaders \
|
2019-10-23 05:14:17 +01:00
|
|
|
-k "not test_get_data and not test_doi_to_data and not test_general and not get_document_url \
|
2020-06-20 18:27:49 +01:00
|
|
|
and not test_validate_arxivid and not test_downloader_getter and not match"
|
2018-02-20 22:53:43 +00:00
|
|
|
'';
|
2018-02-09 12:16:36 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Powerful command-line document and bibliography manager";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://papis.readthedocs.io/en/latest/";
|
2018-02-09 12:16:36 +00:00
|
|
|
license = lib.licenses.gpl3;
|
2019-04-11 11:55:08 +01:00
|
|
|
maintainers = with lib.maintainers; [ nico202 teto ];
|
2018-02-09 12:16:36 +00:00
|
|
|
};
|
|
|
|
}
|