1{ lib
2, fetchPypi
3, buildPythonPackage
4, setuptools-scm
5, typecode
6, patch
7, extractcode-libarchive
8, extractcode-7z
9, pytestCheckHook
10, pytest-xdist
11}:
12
13buildPythonPackage rec {
14 pname = "extractcode";
15 version = "30.0.0";
16
17 src = fetchPypi {
18 inherit pname version;
19 sha256 = "5a660d1b9e3bae4aa87828e6947dc3b31dc2fa6705acb28a514874602b40bc90";
20 };
21
22 dontConfigure = true;
23
24 nativeBuildInputs = [
25 setuptools-scm
26 ];
27
28 propagatedBuildInputs = [
29 typecode
30 patch
31 extractcode-libarchive
32 extractcode-7z
33 ];
34
35 checkInputs = [
36 pytestCheckHook
37 pytest-xdist
38 ];
39
40 # CLI test tests the cli which we can't do until after install
41 disabledTestPaths = [
42 "tests/test_extractcode_cli.py"
43 ];
44
45 # test_uncompress_* wants to use a binary to extract instead of the provided library
46 disabledTests = [
47 "test_uncompress_lz4_basic"
48 "test_extract_tarlz4_basic"
49 "test_extract_rar_with_trailing_data"
50 # tries to parse /boot/vmlinuz-*, which is not available in the nix sandbox
51 "test_can_extract_qcow2_vm_image_as_tarball"
52 "test_can_extract_qcow2_vm_image_not_as_tarball"
53 "test_can_listfs_from_qcow2_image"
54 ];
55
56 pythonImportsCheck = [
57 "extractcode"
58 ];
59
60 meta = with lib; {
61 description = "Universal archive extractor using z7zip, libarchve, other libraries and the Python standard library";
62 homepage = "https://github.com/nexB/extractcode";
63 license = licenses.asl20;
64 maintainers = teams.determinatesystems.members;
65 };
66}