@@ -1,4 +1,4 @@
1−{ stdenv, buildPythonPackage, fetchFromGitHub, pytest, nose, libarchive, glibcLocales
1+{ stdenv, buildPythonPackage, fetchFromGitHub, pytestCheckHook, nose, libarchive, glibcLocales, isPy27
22# unrar is non-free software
33, useUnrar ? false, unrar
44}:
@@ -6,17 +6,19 @@
66assert useUnrar -> unrar != null;
77assert !useUnrar -> libarchive != null;
88
9−buildPythonPackage {
9+buildPythonPackage rec {
1010 pname = "rarfile";
11− version = "3.0";
11+ version = "4.0";
12+ disabled = isPy27;
1213
1314 src = fetchFromGitHub {
1415 owner = "markokr";
1516 repo = "rarfile";
16− rev = "rarfile_3_0";
17− sha256 = "07yliz6p1bxzhipnrgz133gl8laic35gl4rqfay7f1vc384ch7sn";
17+ rev = "v${version}";
18+ sha256 = "0gpriqkvcb6bsccvq8b099xjv5fkjs0d7g4636d5jphy417jxk5m";
1819 };
19− buildInputs = [ pytest nose glibcLocales ];
20+
21+ checkInputs = [ pytestCheckHook nose glibcLocales ];
2022
2123 prePatch = ''
2224 substituteInPlace rarfile.py \
@@ -31,9 +33,7 @@ buildPythonPackage {
3133 # the tests only work with the standard unrar package
3234 doCheck = useUnrar;
3335 LC_ALL = "en_US.UTF-8";
34− checkPhase = ''
35− py.test test -k "not test_printdir"
36− '';
36+ pythonImportsCheck = [ "rarfile" ];
3737
3838 meta = with stdenv.lib; {
3939 description = "RAR archive reader for Python";