2021-02-05 17:12:51 +00:00
|
|
|
{ lib, buildPythonPackage, fetchFromGitHub, xdg-utils
|
2020-04-24 23:36:52 +00:00
|
|
|
, requests, filetype, pyparsing, configparser, arxiv2bib
|
|
|
|
, pyyaml, chardet, beautifulsoup4, colorama, bibtexparser
|
2020-06-15 15:56:04 +00:00
|
|
|
, click, python-slugify, habanero, isbnlib, typing-extensions
|
2020-04-24 23:36:52 +00:00
|
|
|
, prompt_toolkit, pygments, stevedore, tqdm, lxml
|
2021-07-24 12:14:16 +00:00
|
|
|
, python-doi, isPy3k, pytest-cov
|
2020-04-24 23:36:52 +00:00
|
|
|
#, optional, dependencies
|
|
|
|
, whoosh, pytest
|
|
|
|
, stdenv
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "papis";
|
2020-11-06 00:33:48 +00:00
|
|
|
version = "0.11.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
disabled = !isPy3k;
|
|
|
|
|
|
|
|
# Missing tests on Pypi
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "papis";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-11-06 00:33:48 +00:00
|
|
|
sha256 = "0bbkjyw1fsvvp0380l404h2lys8ib4xqga5s6401k1y1hld28nl6";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
requests filetype pyparsing configparser arxiv2bib
|
|
|
|
pyyaml chardet beautifulsoup4 colorama bibtexparser
|
2020-06-15 15:56:04 +00:00
|
|
|
click python-slugify habanero isbnlib
|
|
|
|
prompt_toolkit pygments typing-extensions
|
2020-04-24 23:36:52 +00:00
|
|
|
stevedore tqdm lxml
|
|
|
|
python-doi
|
|
|
|
# optional dependencies
|
|
|
|
whoosh
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "lxml<=4.3.5" "lxml~=4.3" \
|
2020-06-15 15:56:04 +00:00
|
|
|
--replace "isbnlib>=3.9.1,<3.10" "isbnlib~=3.9" \
|
2020-04-24 23:36:52 +00:00
|
|
|
--replace "python-slugify>=1.2.6,<4" "python-slugify"
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
doCheck = !stdenv.isDarwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
checkInputs = ([
|
2021-07-24 12:14:16 +00:00
|
|
|
pytest pytest-cov
|
2020-04-24 23:36:52 +00:00
|
|
|
]) ++ [
|
2021-02-05 17:12:51 +00:00
|
|
|
xdg-utils
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# most of the downloader tests and 4 other tests require a network connection
|
|
|
|
# test_export_yaml and test_citations check for the exact output produced by pyyaml 3.x and
|
|
|
|
# fail with 5.x
|
|
|
|
checkPhase = ''
|
|
|
|
HOME=$(mktemp -d) pytest papis tests --ignore tests/downloaders \
|
|
|
|
-k "not test_get_data and not test_doi_to_data and not test_general and not get_document_url \
|
2020-06-15 15:56:04 +00:00
|
|
|
and not test_validate_arxivid and not test_downloader_getter and not match"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Powerful command-line document and bibliography manager";
|
|
|
|
homepage = "https://papis.readthedocs.io/en/latest/";
|
|
|
|
license = lib.licenses.gpl3;
|
|
|
|
maintainers = with lib.maintainers; [ nico202 teto ];
|
|
|
|
};
|
|
|
|
}
|