git.iko.soy/typeable/nixpkgs
on master help sign in
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

commitb14bd1803554a1750e8a96a393f48690337e1bb4 authorMaximilian Bosch <maximilian@mbosch.me> dateSun 11 Mar 2018, 15:36 (9 years ago) parent4443c5f
3 files changed+62−18
pkgs/development/python-modules/mt-940/default.nix+35 pkgs/development/python-modules/mt-940/no-coverage.patch+26 pkgs/top-level/python-packages.nix+1−18
pkgs/development/python-modules/mt-940/default.nixnew file+35
@@ -0,0 +1,35 @@
1+{ buildPythonPackage, stdenv, pytestrunner, pyyaml, pytest, enum34
2+, pytestpep8, pytestflakes,fetchFromGitHub, isPy3k, lib, glibcLocales
3+}:
4+
5+buildPythonPackage rec {
6+ version = "v4.10.0";
7+ pname = "mt940";
8+
9+ src = fetchFromGitHub {
10+ owner = "WoLpH";
11+ repo = pname;
12+ rev = version;
13+ sha256 = "1dsf2di8rr0iw2vaz6dppalby3y7i8x2bl0qjqvaiqacjxxvwj65";
14+ };
15+
16+ patches = [
17+ ./no-coverage.patch
18+ ];
19+
20+ propagatedBuildInputs = [ pyyaml pytestrunner ]
21+ ++ lib.optional (!isPy3k) enum34;
22+
23+ LC_ALL="en_US.UTF-8";
24+
25+ checkInputs = [ pytestpep8 pytestflakes pytest glibcLocales ];
26+ checkPhase = ''
27+ py.test
28+ '';
29+
30+ meta = with stdenv.lib; {
31+ description = "A library to parse MT940 files and returns smart Python collections for statistics and manipulation";
32+ homepage = "http://pythonhosted.org/mt-940/";
33+ license = licenses.bsd3;
34+ };
35+}
pkgs/development/python-modules/mt-940/no-coverage.patchnew file+26
@@ -0,0 +1,26 @@
1+diff --git a/pytest.ini b/pytest.ini
2+index fef28f5..f366331 100644
3+--- a/pytest.ini
4++++ b/pytest.ini
5+@@ -4,10 +4,6 @@ python_files =
6+ tests/*.py
7+
8+ addopts =
9+- --cov mt940
10+- --cov-report term-missing
11+- --cov-report html
12+- --no-cov-on-fail
13+ --doctest-modules
14+ --pep8
15+ --flakes
16+diff --git a/tests/requirements.txt b/tests/requirements.txt
17+index fc55572..e52cc28 100644
18+--- a/tests/requirements.txt
19++++ b/tests/requirements.txt
20+@@ -3,6 +3,5 @@
21+ -r ../docs/requirements.txt
22+ pytest
23+ pytest-cache
24+-pytest-cover
25+ pytest-flakes
26+ pytest-pep8
pkgs/top-level/python-packages.nix+1−18
@@ -5446,24 +5446,7 @@ in {
54465446 };
54475447 };
54485448
5449− mt-940 = buildPythonPackage rec {
5450− version = "4.10.0";
5451− name = "mt-940-${version}";
5452−
5453− src = pkgs.fetchurl {
5454− url = "mirror://pypi/m/mt-940/mt-940-${version}.tar.gz";
5455− sha256 = "1gyqf1k2r2ml45x08bk69ws865yrpcph514mn4xvjz779mlgh67j";
5456− };
5457−
5458− buildInputs = with self; [ pytestrunner pyyaml pytest ];
5459− doCheck = false; # Can't find data files
5460−
5461− meta = {
5462− description = "A library to parse MT940 files and returns smart Python collections for statistics and manipulation";
5463− homepage = "http://pythonhosted.org/mt-940/";
5464− license = licenses.bsd3;
5465− };
5466− };
5449+ mt-940 = callPackage ../development/python-modules/mt-940 { };
54675450
54685451 mwlib = let
54695452 pyparsing = buildPythonPackage rec {