1{
2 lib,
3 buildPythonPackage,
4 defusedxml,
5 fetchFromGitHub,
6 marshmallow,
7 pytest-datafiles,
8 pytest-vcr,
9 pytestCheckHook,
10 python-box,
11 python-dateutil,
12 pythonOlder,
13 requests,
14 requests-pkcs12,
15 responses,
16 restfly,
17 semver,
18 setuptools,
19 typing-extensions,
20}:
21
22buildPythonPackage rec {
23 pname = "pytenable";
24 version = "1.4.22";
25 pyproject = true;
26
27 disabled = pythonOlder "3.7";
28
29 src = fetchFromGitHub {
30 owner = "tenable";
31 repo = "pyTenable";
32 rev = "refs/tags/${version}";
33 hash = "sha256-acMafLlO0yGEnW+0XeBWUpDWvOPFAB4RK/XyAb2JbPw=";
34 };
35
36 build-system = [ setuptools ];
37
38 dependencies = [
39 defusedxml
40 marshmallow
41 python-box
42 python-dateutil
43 requests
44 restfly
45 semver
46 typing-extensions
47 ];
48
49 nativeCheckInputs = [
50 pytest-datafiles
51 pytest-vcr
52 pytestCheckHook
53 requests-pkcs12
54 responses
55 ];
56
57 disabledTestPaths = [
58 # Disable tests that requires network access
59 "tests/io/"
60 ];
61
62 disabledTests = [
63 # Disable tests that requires a Docker container
64 "test_uploads_docker_push_name_typeerror"
65 "test_uploads_docker_push_tag_typeerror"
66 "test_uploads_docker_push_cs_name_typeerror"
67 "test_uploads_docker_push_cs_tag_typeerror"
68 # Test requires network access
69 "test_assets_list_vcr"
70 "test_events_list_vcr"
71 ];
72
73 pythonImportsCheck = [ "tenable" ];
74
75 meta = with lib; {
76 description = "Python library for the Tenable.io and TenableSC API";
77 homepage = "https://github.com/tenable/pyTenable";
78 changelog = "https://github.com/tenable/pyTenable/releases/tag/${version}";
79 license = with licenses; [ mit ];
80 maintainers = with maintainers; [ fab ];
81 };
82}