1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 setuptools-scm,
7 brotli,
8 inflate64,
9 multivolumefile,
10 psutil,
11 pybcj,
12 pycryptodomex,
13 pyppmd,
14 pyzstd,
15 texttable,
16 py-cpuinfo,
17 pytest-benchmark,
18 pytest-remotedata,
19 pytest-timeout,
20 pytestCheckHook,
21}:
22
23buildPythonPackage rec {
24 pname = "py7zr";
25 version = "0.22.0";
26 pyproject = true;
27
28 src = fetchFromGitHub {
29 owner = "miurahr";
30 repo = "py7zr";
31 tag = "v${version}";
32 hash = "sha256-YR2cuHZWwqrytidAMbNvRV1/N4UZG8AMMmzcTcG9FvY=";
33 };
34
35 postPatch =
36 # Replace inaccessible mirror (qt.mirrors.tds.net):
37 # upstream PR: https://github.com/miurahr/py7zr/pull/637
38 ''
39 substituteInPlace tests/test_concurrent.py \
40 --replace-fail 'http://qt.mirrors.tds.net/qt/' 'https://download.qt.io/'
41 '';
42
43 build-system = [
44 setuptools
45 setuptools-scm
46 ];
47
48 dependencies = [
49 brotli
50 inflate64
51 multivolumefile
52 psutil
53 pybcj
54 pycryptodomex
55 pyppmd
56 pyzstd
57 texttable
58 ];
59
60 nativeCheckInputs = [
61 py-cpuinfo
62 pytest-benchmark
63 pytest-remotedata
64 pytest-timeout
65 pytestCheckHook
66 ];
67
68 pythonImportsCheck = [
69 "py7zr"
70 ];
71
72 meta = {
73 description = "7zip in Python 3 with ZStandard, PPMd, LZMA2, LZMA1, Delta, BCJ, BZip2";
74 homepage = "https://github.com/miurahr/py7zr";
75 changelog = "https://github.com/miurahr/py7zr/blob/v${version}/docs/Changelog.rst#v${
76 builtins.replaceStrings [ "." ] [ "" ] version
77 }";
78 license = lib.licenses.gpl2Only;
79 maintainers = with lib.maintainers; [
80 pitkling
81 PopeRigby
82 ];
83 };
84}