diff --git a/pkgs/development/python-modules/pyexcel-xls/default.nix b/pkgs/development/python-modules/pyexcel-xls/default.nix index 5ff87b2390eb..2da479c3d0b4 100644 --- a/pkgs/development/python-modules/pyexcel-xls/default.nix +++ b/pkgs/development/python-modules/pyexcel-xls/default.nix @@ -1,13 +1,14 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, + fetchpatch2, pyexcel-io, xlrd, xlwt, - nose, pyexcel, - mock, + pytestCheckHook, + pytest-cov, }: buildPythonPackage rec { @@ -15,11 +16,23 @@ buildPythonPackage rec { version = "0.7.0"; format = "setuptools"; - src = fetchPypi { - inherit pname version; - sha256 = "5ec606ef8667aafbb0c3fbd8242a7c23bf175ee7c10b08f70799b84fb2db84cb"; + src = fetchFromGitHub { + owner = "pyexcel"; + repo = "pyexcel-xls"; + rev = "v${version}"; + hash = "sha256-wxsx/LfeBxi+NnHxfxk3svzsBcdwOiLQ1660eoHfmLg="; }; + patches = [ + # https://github.com/pyexcel/pyexcel-xls/pull/54 + (fetchpatch2 { + name = "nose-to-pytest.patch"; + url = "https://github.com/pyexcel/pyexcel-xls/compare/d8953c8ff7dc9a4a3465f2cfc182acafa49f6ea2...9f0d48035114f73077dd0f109395af32b4d9d48b.patch"; + hash = "sha256-2kVdN+kEYaJjXGzv9eudfKjRweMG0grTd5wnZXIDzUU="; + excludes = [ ".github/*" ]; + }) + ]; + propagatedBuildInputs = [ pyexcel-io xlrd @@ -27,17 +40,15 @@ buildPythonPackage rec { ]; nativeCheckInputs = [ - nose + pytestCheckHook pyexcel - mock + pytest-cov ]; postPatch = '' substituteInPlace setup.py --replace "xlrd<2" "xlrd<3" ''; - checkPhase = "nosetests --exclude test_issue_151"; - meta = { description = "Wrapper library to read, manipulate and write data in xls using xlrd and xlwt"; homepage = "http://docs.pyexcel.org/";