1{ lib
2, buildPythonPackage
3, fetchPypi
4, pythonAtLeast
5, fetchpatch
6, chardet
7, attrs
8, commoncode
9, pytestCheckHook
10}:
11buildPythonPackage rec {
12 pname = "debian-inspector";
13 version = "0.9.10";
14
15 src = fetchPypi {
16 pname = "debian_inspector";
17 inherit version;
18 sha256 = "fd29a02b925a4de0d7bb00c29bb05f19715a304bc10ef7b9ad06a93893dc3a8c";
19 };
20
21 patches = lib.optionals (pythonAtLeast "3.9") [
22 # https://github.com/nexB/debian-inspector/pull/15
23 # fixes tests on Python 3.9
24 (fetchpatch {
25 name = "drop-encoding-argument.patch";
26 url = "https://github.com/nexB/debian-inspector/commit/ff991cdb788671ca9b81f1602b70a439248fd1aa.patch";
27 sha256 = "bm3k7vb9+Rm6+YicQEeDOOUVut8xpDaNavG+t2oLZkI=";
28 })
29 ];
30
31 dontConfigure = true;
32
33 propagatedBuildInputs = [
34 chardet
35 attrs
36 commoncode
37 ];
38
39 checkInputs = [
40 pytestCheckHook
41 ];
42
43 pythonImportsCheck = [
44 "debian_inspector"
45 ];
46
47 meta = with lib; {
48 description = "Utilities to parse Debian package, copyright and control files";
49 homepage = "https://github.com/nexB/debian-inspector";
50 license = with licenses; [ asl20 bsd3 mit ];
51 maintainers = teams.determinatesystems.members;
52 };
53}