From d21946d1cb53bc04e524480d8697bf1e58e483d6 Mon Sep 17 00:00:00 2001 From: "qwen.ai[bot]" Date: Wed, 12 Aug 2026 13:58:56 +0000 Subject: [PATCH] chore: update pyproject.toml with Python 3.10 support, linting, testing, and security tool configurations --- pyproject.toml | 110 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 109 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2358d0d..6b64bb1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,9 +4,24 @@ version = "0.1.0" description = "Cross-platform CLI for deep network diagnostics: ISP/VPN/ASN identity, latency, path and bandwidth" readme = "README.md" license = "PolyForm-Noncommercial-1.0.0" -requires-python = ">=3.14" +requires-python = ">=3.10" authors = [{ name = "netsleuth contributors" }] keywords = ["network", "diagnostics", "traceroute", "bgp", "vpn", "speedtest"] +classifiers = [ + "Development Status :: 4 - Beta", + "Environment :: Console", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "License :: Other/Proprietary License", + "Operating System :: MacOS", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: System :: Networking", + "Topic :: System :: Networking :: Monitoring", +] dependencies = [ "typer>=0.12", "rich>=13.7", @@ -22,6 +37,27 @@ dependencies = [ [project.optional-dependencies] tcptrace = ["scapy>=2.5"] ndt7 = ["websockets>=12"] +dev = [ + "pytest>=8", + "pytest-asyncio>=0.23", + "pytest-httpx>=0.30", + "pytest-cov>=4.1", + "ruff>=0.3", + "black>=24.2", + "mypy>=1.8", + "bandit>=1.7", + "pre-commit>=3.6", + "hypothesis>=6.99", +] +docs = [ + "sphinx>=7.2", + "sphinx-rtd-theme>=2.0", + "sphinx-autodoc-typehints>=2.0", +] +security = [ + "bandit>=1.7", + "pip-audit>=2.7", +] [project.scripts] netsleuth = "netsleuth.cli:main" @@ -31,6 +67,13 @@ dev = [ "pytest>=8", "pytest-asyncio>=0.23", "pytest-httpx>=0.30", + "pytest-cov>=4.1", + "ruff>=0.3", + "black>=24.2", + "mypy>=1.8", + "bandit>=1.7", + "pre-commit>=3.6", + "hypothesis>=6.99", ] [build-system] @@ -40,7 +83,72 @@ build-backend = "hatchling.build" [tool.hatch.build.targets.wheel] packages = ["src/netsleuth"] +[tool.ruff] +target-version = "py310" +line-length = 100 +select = [ + "E", # pycodestyle errors + "W", # pycodestyle warnings + "F", # pyflakes + "I", # isort + "B", # flake8-bugbear + "C4", # flake8-comprehensions + "UP", # pyupgrade + "ARG", # flake8-unused-arguments + "SIM", # flake8-simplify +] +ignore = [ + "E501", # line too long (handled by black) + "B008", # do not perform function calls in argument defaults + "B904", # raise without from inside except +] + +[tool.ruff.per-file-ignores] +"__init__.py" = ["F401"] # unused imports in __init__ +"tests/*" = ["ARG", "S101"] # unused args in tests, assert allowed + +[tool.black] +line-length = 100 +target-version = ['py310', 'py311', 'py312'] +include = '\.pyi?$' + +[tool.mypy] +python_version = "3.10" +warn_return_any = true +warn_unused_configs = true +disallow_untyped_defs = false +disallow_incomplete_defs = false +check_untyped_defs = true +no_implicit_optional = true +warn_redundant_casts = true +warn_unused_ignores = true +strict_equality = true + +[[tool.mypy.overrides]] +module = "tests.*" +disallow_untyped_defs = false + [tool.pytest.ini_options] testpaths = ["tests"] asyncio_mode = "auto" filterwarnings = ["error::DeprecationWarning:netsleuth.*"] +addopts = "-v --tb=short" +markers = [ + "slow: marks tests as slow (deselect with '-m \"not slow\"')", + "integration: marks tests as integration tests", +] + +[tool.coverage.run] +source = ["src/netsleuth"] +branch = true + +[tool.coverage.report] +exclude_lines = [ + "pragma: no cover", + "if TYPE_CHECKING:", + "raise NotImplementedError", +] + +[tool.bandit] +targets = ["src/netsleuth"] +skips = ["B101", "B311"]