blob: 3e6ce1384ba7fb2626e4c9727ee4e9957d0e57b7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
pytestCheckHook,
easyprocess,
entrypoint2,
patool,
cabextract,
}:
buildPythonPackage rec {
pname = "pyunpack";
version = "0.3";
pyproject = true;
src = fetchFromGitHub {
owner = "ponty";
repo = "pyunpack";
tag = version;
hash = "sha256-1MAdiX6+u35f6S8a0ZcIIebZE8bbxTy+0TnMohJ7J6s=";
};
postPatch = ''
substituteInPlace pyunpack/__init__.py \
--replace-fail \
'_exepath("patool")' \
'"${lib.getBin patool}/bin/.patool-wrapped"'
'';
nativeBuildInputs = [ setuptools ];
dependencies = [
easyprocess
entrypoint2
];
nativeCheckInputs = [
pytestCheckHook
cabextract
];
pytestFlags = [ "-x" ];
pythonImportsCheck = [ "pyunpack" ];
disabledTests = [
# pinning test of `--help` sensitive to python version
"test_help"
];
disabledTestPaths = [
# unfree
"tests/test_rar.py"
# We get "patool: error: unrecognized arguments: --password 123"
# The currently packaged version of patool does not support this flag.
# https://github.com/wummel/patool/issues/114
# FIXME: Re-enable these once patool is updated
"tests/test_rarpw.py"
"tests/test_zippw.py"
];
meta = {
description = "Unpack archive files in python";
homepage = "https://github.com/ponty/pyunpack";
license = lib.licenses.bsd2;
maintainers = with lib.maintainers; [ pbsds ];
};
}
|