nixpkgs/pkgs/development/python-modules/papis/default.nix

67 lines
1.9 KiB
Nix
Raw Normal View History

{ lib, buildPythonPackage, fetchFromGitHub, xdg_utils
, requests, filetype, pyparsing, configparser, arxiv2bib
, pyyaml, chardet, beautifulsoup4, colorama, bibtexparser
, pylibgen, click, python-slugify, habanero, isbnlib
, prompt_toolkit, pygments, stevedore, tqdm, lxml
, python-doi, isPy3k, pythonOlder
#, optional, dependencies
, whoosh, pytest
, stdenv
2018-02-09 12:16:36 +00:00
}:
buildPythonPackage rec {
2018-02-09 12:16:36 +00:00
pname = "papis";
version = "0.9";
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}";
sha256 = "kzA8nlglbjHDPEB7HRAY2dza1Umn/OYUu+ydbA1OJ5Y=";
};
2018-02-09 12:16:36 +00:00
propagatedBuildInputs = [
2019-02-27 12:58:43 +00:00
requests filetype pyparsing configparser arxiv2bib
pyyaml chardet beautifulsoup4 colorama bibtexparser
pylibgen click python-slugify habanero isbnlib
prompt_toolkit pygments
stevedore tqdm lxml
python-doi
# optional dependencies
whoosh
2018-02-09 12:16:36 +00:00
];
postPatch = ''
substituteInPlace setup.py \
--replace "lxml<=4.3.5" "lxml~=4.3" \
--replace "python-slugify>=1.2.6,<4" "python-slugify"
'';
# pytest seems to hang with python3.8
doCheck = !stdenv.isDarwin && pythonOlder "3.8";
checkInputs = ([
pytest
]) ++ [
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
# test_export_yaml and test_citations check for the exact output produced by pyyaml 3.x and
# fail with 5.x
checkPhase = ''
2019-02-27 12:58:43 +00:00
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 \
and not test_validate_arxivid and not test_downloader_getter"
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";
2019-07-10 19:52:51 +00:00
homepage = https://papis.readthedocs.io/en/latest/;
2018-02-09 12:16:36 +00:00
license = lib.licenses.gpl3;
maintainers = with lib.maintainers; [ nico202 teto ];
2018-02-09 12:16:36 +00:00
};
}