2022-02-10 20:34:41 +00:00
|
|
|
{ lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, stdenv
|
2022-02-10 20:34:41 +00:00
|
|
|
, arxiv2bib
|
|
|
|
, beautifulsoup4
|
|
|
|
, bibtexparser
|
|
|
|
, buildPythonPackage
|
|
|
|
, chardet
|
|
|
|
, click
|
|
|
|
, colorama
|
|
|
|
, configparser
|
|
|
|
, fetchFromGitHub
|
|
|
|
, filetype
|
|
|
|
, habanero
|
|
|
|
, isbnlib
|
|
|
|
, lxml
|
|
|
|
, prompt-toolkit
|
|
|
|
, pygments
|
|
|
|
, pyparsing
|
|
|
|
, pytestCheckHook
|
|
|
|
, python-doi
|
|
|
|
, python-slugify
|
|
|
|
, pythonAtLeast
|
|
|
|
, pythonOlder
|
|
|
|
, pyyaml
|
|
|
|
, requests
|
|
|
|
, stevedore
|
|
|
|
, tqdm
|
|
|
|
, typing-extensions
|
|
|
|
, whoosh
|
|
|
|
, xdg-utils
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "papis";
|
2020-11-06 00:33:48 +00:00
|
|
|
version = "0.11.1";
|
2022-02-10 20:34:41 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "papis";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-02-10 20:34:41 +00:00
|
|
|
hash = "sha256-hlokGoXBhxkAMbqohztZEWlPBSSAUIAGuHtrF7iXcy0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2022-02-10 20:34:41 +00:00
|
|
|
arxiv2bib
|
|
|
|
beautifulsoup4
|
|
|
|
bibtexparser
|
|
|
|
chardet
|
|
|
|
click
|
|
|
|
colorama
|
|
|
|
configparser
|
|
|
|
filetype
|
|
|
|
habanero
|
|
|
|
isbnlib
|
|
|
|
lxml
|
|
|
|
prompt-toolkit
|
|
|
|
pygments
|
|
|
|
pyparsing
|
2020-04-24 23:36:52 +00:00
|
|
|
python-doi
|
2022-02-10 20:34:41 +00:00
|
|
|
python-slugify
|
|
|
|
pyyaml
|
|
|
|
requests
|
|
|
|
stevedore
|
|
|
|
tqdm
|
|
|
|
typing-extensions
|
2020-04-24 23:36:52 +00:00
|
|
|
whoosh
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
2022-02-10 20:34:41 +00:00
|
|
|
--replace "isbnlib>=3.9.1,<3.10" "isbnlib>=3.9"
|
|
|
|
substituteInPlace setup.cfg \
|
|
|
|
--replace "--cov=papis" ""
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
# Tests are failing on Python > 3.9
|
|
|
|
doCheck = !stdenv.isDarwin && !(pythonAtLeast "3.10");
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
checkInputs = ([
|
2022-02-10 20:34:41 +00:00
|
|
|
pytestCheckHook
|
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
|
|
|
];
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d);
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"papis tests"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
"tests/downloaders"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
"get_document_url"
|
|
|
|
"match"
|
|
|
|
"test_doi_to_data"
|
|
|
|
"test_downloader_getter"
|
|
|
|
"test_general"
|
|
|
|
"test_get_data"
|
|
|
|
"test_validate_arxivid"
|
|
|
|
"test_yaml"
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"papis"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Powerful command-line document and bibliography manager";
|
2022-02-10 20:34:41 +00:00
|
|
|
homepage = "https://papis.readthedocs.io/";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ nico202 teto ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|