1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 marshmallow,
6 marshmallow-dataclass,
7 pytestCheckHook,
8 pythonOlder,
9 pythonRelaxDepsHook,
10 requests,
11 responses,
12 setuptools,
13 typing-extensions,
14 vcrpy,
15}:
16
17buildPythonPackage rec {
18 pname = "pygitguardian";
19 version = "1.14.0";
20 pyproject = true;
21
22 disabled = pythonOlder "3.7";
23
24 src = fetchFromGitHub {
25 owner = "GitGuardian";
26 repo = "py-gitguardian";
27 rev = "refs/tags/v${version}";
28 hash = "sha256-Uw65+YOnln+IOyT+RgqMEWt5cOZsaeS8Nu8U6ooivWA=";
29 };
30
31 pythonRelaxDeps = [ "marshmallow-dataclass" ];
32
33 nativeBuildInputs = [
34 pythonRelaxDepsHook
35 setuptools
36 ];
37
38 propagatedBuildInputs = [
39 marshmallow
40 marshmallow-dataclass
41 requests
42 typing-extensions
43 ];
44
45 nativeCheckInputs = [
46 pytestCheckHook
47 vcrpy
48 responses
49 ];
50
51 pythonImportsCheck = [ "pygitguardian" ];
52
53 disabledTests = [
54 # Tests require an API key
55 "test_bogus_rate_limit"
56 "test_compute_sca_files"
57 "test_content_scan_exceptions"
58 "test_content_scan"
59 "test_create_honeytoken"
60 "test_create_jwt"
61 "test_extra_headers"
62 "test_health_check"
63 "test_multi_content_exceptions"
64 "test_multi_content_scan"
65 "test_multiscan_parameters"
66 "test_quota_overview"
67 "test_rate_limit"
68 "test_sca_client_scan_diff"
69 "test_sca_scan_all_with_params"
70 "test_sca_scan_directory_invalid_tar"
71 "test_sca_scan_directory"
72 "test_versions_from_headers"
73 ];
74
75 meta = with lib; {
76 description = "Library to access the GitGuardian API";
77 homepage = "https://github.com/GitGuardian/py-gitguardian";
78 changelog = "https://github.com/GitGuardian/py-gitguardian/blob/v${version}/CHANGELOG.md";
79 license = licenses.mit;
80 maintainers = with maintainers; [ fab ];
81 };
82}