Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / pyunpack / default.nix
blobb6dff5a97d03c14da70b482301790cebd0626bab
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , pytestCheckHook
5 , easyprocess
6 , entrypoint2
7 , patool
8 }:
10 buildPythonPackage rec {
11   pname = "pyunpack";
12   version = "0.3";
13   format = "setuptools";
15   src = fetchFromGitHub {
16     owner = "ponty";
17     repo = "pyunpack";
18     rev = "refs/tags/${version}";
19     hash = "sha256-1MAdiX6+u35f6S8a0ZcIIebZE8bbxTy+0TnMohJ7J6s=";
20   };
22   postPatch = ''
23     substituteInPlace pyunpack/__init__.py \
24       --replace \
25        '_exepath("patool")' \
26        '"${patool}/bin/.patool-wrapped"'
27   '';
29   propagatedBuildInputs = [
30     easyprocess
31     entrypoint2
32   ];
34   nativeCheckInputs = [ pytestCheckHook ];
36   pytestFlagsArray = [ "-x" ];
38   pythonImportsCheck = [ "pyunpack" ];
40   disabledTestPaths = [
41     # unfree
42     "tests/test_rar.py"
44     # We get "patool: error: unrecognized arguments: --password 123"
45     # The currently packaged version of patool does not support this flag.
46     # https://github.com/wummel/patool/issues/114
47     # FIXME: Re-enable these once patool is updated
48     "tests/test_rarpw.py"
49     "tests/test_zippw.py"
50   ];
52   meta = with lib; {
53     description = "Unpack archive files in python";
54     homepage = "https://github.com/ponty/pyunpack";
55     license = licenses.bsd2;
56     maintainers = with maintainers; [ pbsds ];
57   };