2018-12-19 10:23:40 +01:00
|
|
|
{ buildPythonPackage, stdenv, pyyaml, pytest, enum34
|
2019-02-16 09:02:30 +01:00
|
|
|
, pytestpep8, pytest-flakes, fetchFromGitHub, isPy3k, lib, glibcLocales
|
2018-03-11 15:36:26 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2019-03-19 22:26:10 +01:00
|
|
|
version = "4.13.2";
|
2018-12-19 10:23:40 +01:00
|
|
|
pname = "mt-940";
|
2018-03-11 15:36:26 +01:00
|
|
|
|
2019-01-11 12:50:16 +01:00
|
|
|
# No tests in PyPI tarball
|
2019-03-19 22:26:10 +01:00
|
|
|
# See https://github.com/WoLpH/mt940/pull/72
|
2018-03-11 15:36:26 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "WoLpH";
|
2018-12-19 10:23:40 +01:00
|
|
|
repo = "mt940";
|
2018-05-28 14:59:57 +02:00
|
|
|
rev = "v${version}";
|
2019-03-19 22:26:10 +01:00
|
|
|
sha256 = "1lvw3qyv7qhjabcvg55br8x4pnc7hv8xzzaf6wnr8cfjg0q7dzzg";
|
2018-03-11 15:36:26 +01:00
|
|
|
};
|
|
|
|
|
2018-12-19 10:23:40 +01:00
|
|
|
postPatch = ''
|
|
|
|
# No coverage report
|
|
|
|
sed -i "/--\(no-\)\?cov/d" pytest.ini
|
|
|
|
'';
|
2018-03-11 15:36:26 +01:00
|
|
|
|
2018-12-19 10:23:40 +01:00
|
|
|
propagatedBuildInputs = lib.optional (!isPy3k) enum34;
|
2018-03-11 15:36:26 +01:00
|
|
|
|
2019-03-19 22:26:10 +01:00
|
|
|
checkInputs = [ pyyaml pytestpep8 pytest-flakes pytest ];
|
2018-12-19 10:23:40 +01:00
|
|
|
|
2018-03-11 15:36:26 +01:00
|
|
|
checkPhase = ''
|
2019-01-11 12:50:16 +01:00
|
|
|
py.test
|
2018-03-11 15:36:26 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A library to parse MT940 files and returns smart Python collections for statistics and manipulation";
|
2018-12-19 10:23:40 +01:00
|
|
|
inherit (src.meta) homepage;
|
2018-03-11 15:36:26 +01:00
|
|
|
license = licenses.bsd3;
|
|
|
|
};
|
|
|
|
}
|