summary refs log tree commit diff
path: root/pkgs/development/python-modules/mt-940/default.nix
blob: 5c323068dddb003626cd608f90dab8e18e07006f (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
{ buildPythonPackage, stdenv, pyyaml, pytest, enum34
, pytestpep8, pytestflakes, fetchFromGitHub, isPy3k, lib, glibcLocales
}:

buildPythonPackage rec {
  version = "4.12.2";
  pname = "mt-940";

  src = fetchFromGitHub {
    owner = "WoLpH";
    repo = "mt940";
    rev = "v${version}";
    sha256 = "0l7q8v00dhpbc9mh6baaaqc55kf44rszygx28dq3pwp5b5x33nir";
  };

  postPatch = ''
    # No coverage report
    sed -i "/--\(no-\)\?cov/d" pytest.ini
  '';

  propagatedBuildInputs = lib.optional (!isPy3k) enum34;

  LC_ALL="en_US.UTF-8";

  checkInputs = [ pyyaml pytestpep8 pytestflakes pytest glibcLocales ];

  # See https://github.com/WoLpH/mt940/issues/64 for the disabled test
  checkPhase = ''
    py.test -k "not mt940.models.FixedOffset"
  '';

  meta = with stdenv.lib; {
    description = "A library to parse MT940 files and returns smart Python collections for statistics and manipulation";
    inherit (src.meta) homepage;
    license = licenses.bsd3;
  };
}