-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathpyproject.toml
More file actions
158 lines (139 loc) · 4.49 KB
/
Copy pathpyproject.toml
File metadata and controls
158 lines (139 loc) · 4.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "netmiko"
version = "4.7.0"
description = "Multi-vendor library to simplify legacy CLI connections to network devices"
authors = [{ name = "Kirk Byers", email = "ktbyers@twb-tech.com" }]
license = { text = "MIT" }
readme = "README.md"
requires-python = ">=3.10,<4.0"
classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"paramiko>=3.5.0,<5.0",
"scp>=0.13.6",
"pyyaml>=6.0.2",
"textfsm>=1.1.3",
"ntc-templates>=3.1.0",
"pyserial>=3.3",
"rich>=13.8",
]
[project.optional-dependencies]
bulk-encrypt = ["ruamel.yaml>=0.17"]
[project.urls]
repository = "https://github.com/ktbyers/netmiko"
[project.scripts]
"netmiko-grep" = "netmiko.cli_tools.netmiko_grep:main_ep"
"netmiko-show" = "netmiko.cli_tools.netmiko_show:main_ep"
"netmiko-cfg" = "netmiko.cli_tools.netmiko_cfg:main_ep"
"netmiko-encrypt" = "netmiko.cli_tools.netmiko_encrypt:main_ep"
"netmiko-bulk-encrypt" = "netmiko.cli_tools.netmiko_bulk_encrypt:main_ep"
[dependency-groups]
dev = [
"ruff==0.15.5",
"mypy==1.19.1",
"mypy-extensions==1.0.0",
"pytest>=9.0.3",
"pytest-cov>=4.0",
"bandit>=1.9.4",
"pip-audit>=2.10.0",
"twine==6.2.0",
"docutils==0.22.4",
# genie (parsers group) requires exactly pysnmp 6.1.4 (latest 6.1.x, disallows >=6.2)
# pysnmp 7.x is excluded as it is a completely different async library incompatible with Netmiko
"pysnmp>=6.1.4,<7",
"pdoc3==0.11.6",
"types-paramiko==4.0.0.20250822",
"types-PyYAML==6.0.12.20250915",
"ruamel.yaml>=0.17",
]
parsers = [
# pyats 26.4 did not distribute cp311 linux x86_64 wheels
"pyats>=26.2,!=26.4,!=26.4.*",
"genie>=26.2,!=26.4,!=26.4.*",
"ttp>=0.9.5",
]
[tool.uv]
managed = true
package = true
# genie-libs-sdk (optional parsers group) hard-pins pyasn1==0.6.0, which has
# multiple DoS vulnerabilities (PYSEC-2026-3455/3456/3457, CVE-2026-30922)
# fixed in 0.6.4. 0.6.x is patch-compatible, so we override genie's exact pin.
override-dependencies = ["pyasn1>=0.6.4"]
[tool.hatch.build.targets.wheel]
packages = ["netmiko"]
[tool.ruff]
line-length = 100
# Specify your floor Python version (i.e. minimum version Netmiko supports)
target-version = "py310"
# Files or directories to exclude from linting and formatting
exclude = [
".git",
".venv",
"__pycache__",
"build",
"dist",
"netmiko/_telnetlib",
]
[tool.ruff.lint]
# Enable these rule sets for a modern, clean codebase
# E/W = pycodestyle, F = Pyflakes, I = isort, UP = pyupgrade, B = bugbear
# select = ["E", "F", "W", "I", "UP", "B"]
# If you want to be extra strict about line length in the linter:
# extend-select = ["E501"]
[tool.ruff.format]
# Matches Black's style but honors the 100 char limit
quote-style = "double"
indent-style = "space"
# Optional: Formats code snippets inside docstrings!
docstring-code-format = true
docstring-code-line-length = 80
[tool.mypy]
python_version = "3.13"
exclude = "telnetlib.py"
check_untyped_defs = true
disallow_any_generics = true
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_decorators = true
ignore_errors = false
ignore_missing_imports = true
strict_optional = true
warn_unused_configs = true
warn_unused_ignores = true
warn_return_any = true
warn_redundant_casts = true
# Module-specific overrides
[[tool.mypy.overrides]]
module = "netmiko.base_connection"
warn_unused_ignores = false
[[tool.mypy.overrides]]
module = [
"netmiko.cli_tools.netmiko_grep",
"netmiko.cli_tools.netmiko_cfg",
"netmiko.cli_tools.netmiko_show",
"netmiko.cli_tools.helpers",
"netmiko.cli_tools.outputters",
"netmiko.cli_tools.argument_handling",
"netmiko.cli_tools.netmiko_encrypt",
"netmiko.cli_tools.netmiko_bulk_encrypt",
"netmiko._telnetlib.telnetlib"
]
ignore_errors = true
[tool.bandit]
# B101: assert_used - legitimate type-narrowing asserts throughout the codebase
# B105/B107: hardcoded_password - these are regex prompt-matching patterns, not real credentials
# B108: hardcoded_tmp_directory - /var/tmp is a standard network device filesystem path
# B110: try_except_pass - intentional in network device disconnect/cleanup code
skips = ["B101", "B105", "B107", "B108", "B110"]
[tool.pytest.ini_options]
addopts = "-rs"
testpaths = ["tests"]