1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pythonOlder,
6 setuptools,
7 pytestCheckHook,
8 vcrpy,
9 citeproc-py,
10 looseversion,
11 requests,
12}:
13
14buildPythonPackage rec {
15 pname = "duecredit";
16 version = "0.10.2";
17 pyproject = true;
18
19 disabled = pythonOlder "3.8";
20
21 src = fetchPypi {
22 inherit pname version;
23 hash = "sha256-/nOiDk+7LZcroB7fN97BsLoeZG7+XvTMrwxnJMoofUI=";
24 };
25
26 postPatch = ''
27 substituteInPlace tox.ini \
28 --replace-fail "--cov=duecredit" "" \
29 --replace-fail "--cov-config=tox.ini" ""
30 '';
31
32 nativeBuildInputs = [ setuptools ];
33 propagatedBuildInputs = [
34 citeproc-py
35 looseversion
36 requests
37 ];
38
39 nativeCheckInputs = [
40 pytestCheckHook
41 vcrpy
42 ];
43 disabledTests = [ "test_import_doi" ]; # tries to access network
44
45 preCheck = ''
46 export HOME=$(mktemp -d)
47 '';
48
49 pythonImportsCheck = [ "duecredit" ];
50
51 meta = {
52 homepage = "https://github.com/duecredit/duecredit";
53 description = "Simple framework to embed references in code";
54 mainProgram = "duecredit";
55 changelog = "https://github.com/duecredit/duecredit/releases/tag/${version}";
56 license = lib.licenses.bsd2;
57 maintainers = [ lib.maintainers.bcdarwin ];
58 };
59}