1{
2 lib,
3 buildPythonPackage,
4 cryptography,
5 defusedxml,
6 fetchFromGitHub,
7 gql,
8 graphql-core,
9 marshmallow,
10 pydantic-extra-types,
11 pydantic,
12 pytest-cov-stub,
13 pytest-datafiles,
14 pytest-vcr,
15 pytestCheckHook,
16 python-box,
17 python-dateutil,
18 pythonOlder,
19 requests-pkcs12,
20 requests-toolbelt,
21 requests,
22 responses,
23 restfly,
24 semver,
25 setuptools,
26 typing-extensions,
27}:
28
29buildPythonPackage rec {
30 pname = "pytenable";
31 version = "1.8.4";
32 pyproject = true;
33
34 disabled = pythonOlder "3.10";
35
36 src = fetchFromGitHub {
37 owner = "tenable";
38 repo = "pyTenable";
39 tag = version;
40 hash = "sha256-Dt6jN+0Ktv3CO88RmbgKCU8v3Oa10MnKjyJaePxXsaI=";
41 };
42
43 pythonRelaxDeps = [
44 "cryptography"
45 "defusedxml"
46 ];
47
48 build-system = [ setuptools ];
49
50 dependencies = [
51 cryptography
52 defusedxml
53 gql
54 graphql-core
55 marshmallow
56 pydantic
57 pydantic-extra-types
58 python-box
59 python-dateutil
60 requests
61 requests-toolbelt
62 restfly
63 semver
64 typing-extensions
65 ];
66
67 nativeCheckInputs = [
68 pytest-cov-stub
69 pytest-datafiles
70 pytest-vcr
71 pytestCheckHook
72 requests-pkcs12
73 responses
74 ];
75
76 disabledTestPaths = [
77 # Disable tests that requires network access
78 "tests/io/"
79 ];
80
81 disabledTests = [
82 # Disable tests that requires a Docker container
83 "test_uploads_docker_push_name_typeerror"
84 "test_uploads_docker_push_tag_typeerror"
85 "test_uploads_docker_push_cs_name_typeerror"
86 "test_uploads_docker_push_cs_tag_typeerror"
87 # Test requires network access
88 "test_assets_list_vcr"
89 "test_events_list_vcr"
90 # https://github.com/tenable/pyTenable/issues/953
91 "test_construct_query_str"
92 "test_construct_query_stored_file"
93 "test_iterator_empty_page"
94 "test_iterator_max_page_term"
95 "test_iterator_pagination"
96 "test_iterator_total_term"
97 ];
98
99 pythonImportsCheck = [ "tenable" ];
100
101 meta = with lib; {
102 description = "Python library for the Tenable.io and TenableSC API";
103 homepage = "https://github.com/tenable/pyTenable";
104 changelog = "https://github.com/tenable/pyTenable/releases/tag/${src.tag}";
105 license = with licenses; [ mit ];
106 maintainers = with maintainers; [ fab ];
107 };
108}