Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
strategy:
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"

steps:
- uses: actions/checkout@v4
Expand Down
24 changes: 24 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
pkg_folder := "tenable"


[parallel]
test-parallel: (test-py "3.14") (test-py "3.12") (test-py "3.13") (test-py "3.14")

test: (test-py "3.11") (test-py "3.12") (test-py "3.13") (test-py "3.14")

docs:
sphinx-build -M clean docs docs/_build
sphinx-build -M html docs docs/_build

test-py version: (lint version) (unit-tests version) #audit

lint version:
uv run --python {{version}} --isolated --group dev mypy {{pkg_folder}}
uv run --python {{version}} --isolated --group dev ty check {{pkg_folder}}
uv run --python {{version}} --isolated --group dev ruff check {{pkg_folder}}

unit-tests version:
uv run --python {{version}} --isolated --group dev pytest -q --cov-fail-under 80

audit:
uv audit --no-group test --no-group dev --no-group docs
68 changes: 68 additions & 0 deletions codebook.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
words = [
"acls",
"autoclass",
"autoexception",
"badgatewayerror",
"badrequesterror",
"boxify",
"bymonthday",
"byweekday",
"cidr",
"conv",
"devportal",
"expectationfailederror",
"forbiddenerror",
"fulltext",
"gatewaytimeouterror",
"httpbin",
"invalidmethoderror",
"ips",
"ipv",
"lce",
"lengthrequirederror",
"lobj",
"maptable",
"mdm",
"methodnotimplimentederror",
"misdirectrequesterror",
"netbios",
"networkauthrequirederror",
"nolongerexistserror",
"notacceptableerror",
"notextendederror",
"notfounderror",
"opsys",
"otype",
"pathing",
"payloadtoolargeerror",
"pprint",
"preconditionfailederror",
"preconditionrequirederror",
"proxyauthenticationerror",
"rangenotsatisfiableerror",
"recasted",
"requestconflicterror",
"requestheaderfieldstoolargeerror",
"requesttimeouterror",
"restfly",
"rkeys",
"rrules",
"rval",
"servererror",
"serviceunavailableerror",
"softcheck",
"softchecks",
"teapotresponseerror",
"timedelta",
"tio",
"tooearlyerror",
"toomanyrequests",
"unauthorizederror",
"unavailableforlegalreasonserror",
"unexpectedvalue",
"unsupportedmediatypeerror",
"upgraderequirederror",
"uritoolongerror",
"urlparse",
"utcnow",
]
5 changes: 3 additions & 2 deletions examples/io/agent_export_csv_writer/agentexport.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env python
from tenable.io import TenableIO
from csv import DictWriter
import click, logging
import click
import logging

# Function to format agent groups into a single string
def agent_groups(groups):
Expand Down Expand Up @@ -56,7 +57,7 @@ def cli(output, access_key, secret_key, health, debug):

else:
# Log that all agents are being exported since 'health' is None or empty
logging.info(f'Exporting all agents')
logging.info('Exporting all agents')

# Define the fields/columns for the CSV
fields = [
Expand Down
4 changes: 3 additions & 1 deletion examples/io/asset_export_csv_writer/csvexport.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env python
from tenable.io import TenableIO
from csv import DictWriter
import collections, click, logging
import collections
import click
import logging


def flatten(d, parent_key='', sep='.'):
Expand Down
4 changes: 3 additions & 1 deletion examples/io/download_scans/download_scans.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env python
from tenable.io import TenableIO
import os, click, arrow
import os
import click
import arrow

@click.command()
@click.option('--tio-access-key', 'access_key', envvar='TIO_ACCESS_KEY',
Expand Down
4 changes: 3 additions & 1 deletion examples/io/vuln_export_csv_writer/csvexport.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env python
from tenable.io import TenableIO
from csv import DictWriter
import collections, click, logging
import collections
import click
import logging


def flatten(d, parent_key='', sep='.'):
Expand Down
3 changes: 2 additions & 1 deletion examples/io/workbench_csv_download/csvdownload.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
'''
import argparse, os
import argparse
import os
from tenable.io import TenableIO

def filterset(s):
Expand Down
3 changes: 2 additions & 1 deletion examples/reports/scan_speeds/speed_report.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python
from tenable.reports import NessusReportv2
import click, re
import click
import re

@click.command()
@click.argument('report', type=click.File('r'))
Expand Down
20 changes: 10 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"


[project]
requires-python = ">=3.10"
requires-python = ">=3.11"
dynamic = ["version"]
readme = "README.rst"
name = "pyTenable"
Expand All @@ -26,6 +26,8 @@ keywords = [
"tenable container security",
"tenable.ot",
"tenable ot security",
"tenable one",
"tenable cloud",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
Expand All @@ -41,20 +43,20 @@ classifiers = [

]
dependencies = [
"requests>=2.26",
"requests>=2.33",
"python-dateutil>=2.6",
"semver>=2.10.0",
"restfly>=1.5.1",
"marshmallow>=3.8",
"python-box>=4.0",
"defusedxml>=0.5.0",
"urllib3>=1.26.18",
"urllib3>=1.26.20",
"typing-extensions>=4.0.1",
"requests-toolbelt>=1.0.0",
"gql>=4.0.0",
"graphql-core>=3.2.6",
"pydantic>=2.5.3",
"pydantic-extra-types>=2.3.0",
"arrow>=1.4.0",
]


Expand Down Expand Up @@ -116,7 +118,7 @@ docstring-code-line-length = "dynamic"


[tool.pytest.ini_options]
addopts = "--cov-report term-missing --cov=tenable"
addopts = "--cov-report term-missing:skip-covered --cov=tenable"
testpaths = ['tests']
filterwarnings = [
"ignore::DeprecationWarning:tenable.*",
Expand All @@ -135,15 +137,13 @@ dev = [
"pytest-cov>=4.1.0",
"pytest-datafiles>=3.0.0",
"pytest-vcr>=1.0.2",
"pytest>=7.4.4,<9",
"pytest>=8,<9",
"responses>=0.23.3",
"ruff>=0.6.4",
# URLLib3 version 2.x doesn't play well with the version of pytest-vcr that supports
# Python 3.9 and lower. This can be removed once 3.9 goes EOS or when we stop using
# VCR for the test suite.
"urllib3==1.26.20",
"rich>=13.8.1",
"urllib3>=1.26.18,<2", # Required until VCR is no longer needed.
"ptpython>=3.0.29",
"typer>=0.20.0",
"mypy>=1.18.2",
"rust-just>=1.51.0",
]
2 changes: 1 addition & 1 deletion tenable/apa/findings/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from copy import copy
from typing import Dict, Optional, Union

from restfly import APIIterator
from tenable.base._restfly_v1 import APIIterator

from tenable.apa.findings.schema import FindingsPageSchema, AttackTechniquesSearchResponseSchema
from tenable.base.endpoint import APIEndpoint
Expand Down
2 changes: 1 addition & 1 deletion tenable/apa/vectors/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from copy import copy
from typing import Dict, Optional, Union

from restfly import APIIterator
from tenable.base._restfly_v1 import APIIterator

from tenable.apa.vectors.schema import VectorsPageSchema
from tenable.base.endpoint import APIEndpoint
Expand Down
2 changes: 1 addition & 1 deletion tenable/asm/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from copy import copy
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple

from restfly.iterator import APIIterator
from tenable.base._restfly_v1 import APIIterator

from tenable.base.endpoint import APIEndpoint

Expand Down
Loading
Loading