summary refs log tree commit diff
path: root/pkgs/development/python-modules/mt-940
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2018-03-11 15:36:26 +0100
committerMoritz U <moritz@tarn-vedra.de>2018-03-11 15:36:26 +0100
commitb14bd1803554a1750e8a96a393f48690337e1bb4 (patch)
treeb70988102e1ba0cc45155145842330902aa1cb19 /pkgs/development/python-modules/mt-940
parent4443c5f740a9f5eae9a85ab29f2f8fa08933ce3b (diff)
downloadnixlib-b14bd1803554a1750e8a96a393f48690337e1bb4.tar
nixlib-b14bd1803554a1750e8a96a393f48690337e1bb4.tar.gz
nixlib-b14bd1803554a1750e8a96a393f48690337e1bb4.tar.bz2
nixlib-b14bd1803554a1750e8a96a393f48690337e1bb4.tar.lz
nixlib-b14bd1803554a1750e8a96a393f48690337e1bb4.tar.xz
nixlib-b14bd1803554a1750e8a96a393f48690337e1bb4.tar.zst
nixlib-b14bd1803554a1750e8a96a393f48690337e1bb4.zip
pythonPackages.mt-940: fix build (#36784)
- added missing `enum34` dependency
- enabled tests
- moved expression into its own file

See ticket #36453
See https://hydra.nixos.org/build/70677609/log

/cc @the-kenny
Diffstat (limited to 'pkgs/development/python-modules/mt-940')
-rw-r--r--pkgs/development/python-modules/mt-940/default.nix35
-rw-r--r--pkgs/development/python-modules/mt-940/no-coverage.patch26
2 files changed, 61 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/mt-940/default.nix b/pkgs/development/python-modules/mt-940/default.nix
new file mode 100644
index 000000000000..5e2ad1d5aa2a
--- /dev/null
+++ b/pkgs/development/python-modules/mt-940/default.nix
@@ -0,0 +1,35 @@
+{ buildPythonPackage, stdenv, pytestrunner, pyyaml, pytest, enum34
+, pytestpep8, pytestflakes,fetchFromGitHub, isPy3k, lib, glibcLocales
+}:
+
+buildPythonPackage rec {
+  version = "v4.10.0";
+  pname = "mt940";
+
+  src = fetchFromGitHub {
+    owner = "WoLpH";
+    repo = pname;
+    rev = version;
+    sha256 = "1dsf2di8rr0iw2vaz6dppalby3y7i8x2bl0qjqvaiqacjxxvwj65";
+  };
+
+  patches = [
+    ./no-coverage.patch
+  ];
+
+  propagatedBuildInputs = [ pyyaml pytestrunner ]
+    ++ lib.optional (!isPy3k) enum34;
+
+  LC_ALL="en_US.UTF-8";
+
+  checkInputs = [ pytestpep8 pytestflakes pytest glibcLocales ];
+  checkPhase = ''
+    py.test
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A library to parse MT940 files and returns smart Python collections for statistics and manipulation";
+    homepage = "http://pythonhosted.org/mt-940/";
+    license = licenses.bsd3;
+  };
+}
diff --git a/pkgs/development/python-modules/mt-940/no-coverage.patch b/pkgs/development/python-modules/mt-940/no-coverage.patch
new file mode 100644
index 000000000000..1617e6dd3947
--- /dev/null
+++ b/pkgs/development/python-modules/mt-940/no-coverage.patch
@@ -0,0 +1,26 @@
+diff --git a/pytest.ini b/pytest.ini
+index fef28f5..f366331 100644
+--- a/pytest.ini
++++ b/pytest.ini
+@@ -4,10 +4,6 @@ python_files =
+     tests/*.py
+ 
+ addopts =
+-    --cov mt940
+-    --cov-report term-missing
+-    --cov-report html
+-    --no-cov-on-fail
+     --doctest-modules
+     --pep8
+     --flakes
+diff --git a/tests/requirements.txt b/tests/requirements.txt
+index fc55572..e52cc28 100644
+--- a/tests/requirements.txt
++++ b/tests/requirements.txt
+@@ -3,6 +3,5 @@
+ -r ../docs/requirements.txt
+ pytest
+ pytest-cache
+-pytest-cover
+ pytest-flakes
+ pytest-pep8