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

122 lines
1.9 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, 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
2018-02-09 12:16:36 +00:00
}:
buildPythonPackage rec {
2018-02-09 12:16:36 +00:00
pname = "papis";
2020-11-04 01:37:30 +00:00
version = "0.11.1";
format = "setuptools";
disabled = pythonOlder "3.7";
2018-02-09 12:16:36 +00:00
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}";
hash = "sha256-hlokGoXBhxkAMbqohztZEWlPBSSAUIAGuHtrF7iXcy0=";
};
2018-02-09 12:16:36 +00:00
propagatedBuildInputs = [
arxiv2bib
beautifulsoup4
bibtexparser
chardet
click
colorama
configparser
filetype
habanero
isbnlib
lxml
prompt-toolkit
pygments
pyparsing
python-doi
python-slugify
pyyaml
requests
stevedore
tqdm
typing-extensions
whoosh
2018-02-09 12:16:36 +00:00
];
postPatch = ''
substituteInPlace setup.py \
--replace "isbnlib>=3.9.1,<3.10" "isbnlib>=3.9"
substituteInPlace setup.cfg \
--replace "--cov=papis" ""
'';
# Tests are failing on Python > 3.9
doCheck = !stdenv.isDarwin && !(pythonAtLeast "3.10");
checkInputs = ([
pytestCheckHook
]) ++ [
2021-02-01 08:05:09 +00:00
xdg-utils
];
2018-02-21 11:10:38 +00:00
preCheck = ''
export HOME=$(mktemp -d);
2018-02-20 22:53:43 +00:00
'';
2018-02-09 12:16:36 +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; {
2018-02-09 12:16:36 +00:00
description = "Powerful command-line document and bibliography manager";
homepage = "https://papis.readthedocs.io/";
license = licenses.gpl3Only;
maintainers = with maintainers; [ nico202 teto ];
2018-02-09 12:16:36 +00:00
};
}