about summary refs log tree commit diff
path: root/pkgs/development/python-modules/bibtexparser/default.nix
blob: 2c24578f45815fe48fcf831e1ff48f8a988404d5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ lib
, buildPythonPackage
, fetchFromGitHub
, future
, pyparsing
, pytestCheckHook
, pythonOlder
}:

buildPythonPackage rec {
  pname = "bibtexparser";
  version = "1.2.0";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "sciunto-org";
    repo = "python-${pname}";
    rev = "v${version}";
    hash = "sha256-M9fDI28Yq0uUHPx51wiuRPmRTLkjVqj7ixapbSftnJc=";
  };

  propagatedBuildInputs = [
    future
    pyparsing
  ];

  checkInputs = [
    pytestCheckHook
  ];

  postPatch = ''
    # https://github.com/sciunto-org/python-bibtexparser/pull/259
    substituteInPlace bibtexparser/tests/test_crossref_resolving.py \
      --replace "import unittest2 as unittest" "import unittest"
  '';

  pythonImportsCheck = [
    "bibtexparser"
  ];

  meta = with lib; {
    description = "Bibtex parser for Python";
    homepage = "https://github.com/sciunto-org/python-bibtexparser";
    license = with licenses; [ lgpl3Only /* or */ bsd3 ];
    maintainers = with maintainers; [ fridh ];
  };
}