Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
195 lines (176 loc) · 5.76 KB
/
Copy pathpyproject.toml
File metadata and controls
195 lines (176 loc) · 5.76 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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
[build-system]
requires = ["setuptools>=64", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "trigger"
version = "2.3.3"
description = "Network automation toolkit for managing network devices"
readme = "README.md"
license = "BSD-3-Clause"
authors = [{name = "Jathan McCollum", email = "jathan@gmail.com"}]
requires-python = ">=3.10,<3.12"
classifiers = [
"Development Status :: 6 - Mature",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Framework :: Twisted",
]
dependencies = [
"netaddr>=1.0.0,<2",
"cryptography>=41.0.0",
"Twisted[tls]>=22.10.0",
"crochet>=2.0.0",
"pyasn1>=0.4.8",
"pyparsing>=3.1.0",
"pytz>=2023.3",
"SimpleParse>=2.2.0",
"textfsm>=1.1.0",
"redis>=5.0.0",
"PTable>=0.9.2",
"peewee>=3.17.0",
"service-identity>=23.1.0",
"bcrypt>=4.0.0",
"packaging>=21.0",
]
[project.optional-dependencies]
dev = [
"pytest>=7.4.0",
"pytest-twisted>=1.14.0",
"ruff>=0.1.0",
"python-semantic-release>=9.0.0",
]
docs = [
"sphinx>=7.0",
"sphinx_rtd_theme>=2.0",
]
[project.scripts]
acl = "trigger.bin.acl:main"
acl_script = "trigger.bin.acl_script:main"
aclconv = "trigger.bin.aclconv:main"
check_access = "trigger.bin.check_access:main"
check_syntax = "trigger.bin.check_syntax:main"
fe = "trigger.bin.fe:main"
find_access = "trigger.bin.find_access:main"
gnng = "trigger.bin.gnng:main"
gong = "trigger.bin.gong:main"
load_acl = "trigger.bin.load_acl:main"
load_config = "trigger.bin.load_config:main"
netdev = "trigger.bin.netdev:main"
optimizer = "trigger.bin.optimizer:main"
run_cmds = "trigger.bin.run_cmds:main"
[tool.setuptools]
packages = ["trigger", "trigger.acl", "trigger.bin", "trigger.changemgmt",
"trigger.conf", "trigger.contrib", "trigger.netdevices",
"trigger.packages", "trigger.utils", "twisted.plugins"]
include-package-data = true
[tool.setuptools.package-data]
twisted = ["plugins/trigger_xmlrpc.py"]
# Automatically includes files tracked by git in source distributions
# This includes: CHANGELOG, *.md, conf/, docs/, examples/, tests/
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
addopts = "-v"
[tool.ruff]
line-length = 88
target-version = "py310"
exclude = ["trigger/packages", ".venv", "build", "dist"]
[tool.ruff.lint]
select = [
"B", # flake8-bugbear - bug prevention
"COM", # flake8-commas - trailing comma consistency
"D", # pydocstyle - docstring formatting
"E", # pycodestyle errors
"EM", # flake8-errmsg - exception message hygiene
"ERA", # eradicate - commented-out code removal
"F", # pyflakes
"FURB", # refurb - modern Python idioms
"I", # isort - import sorting
"PERF", # perflint - performance patterns
"PIE", # flake8-pie - unnecessary constructs
"PLR", # pylint-refactor
"PLW", # pylint-warnings
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"RET", # flake8-return
"RSE", # flake8-raise
"RUF", # ruff-specific rules
"S", # flake8-bandit - security
"SIM", # flake8-simplify
"UP", # pyupgrade - Python 3 modernization
"W", # pycodestyle warnings
]
extend-select = [
"D401", # non-imperative-mood (not in google convention, enabled explicitly)
]
ignore = [
# --- Formatter conflicts ---
"COM812", # trailing-comma-missing (handled by ruff formatter)
# --- Kept from v2.0.0 baseline ---
"E501", # line-too-long (handled by formatter)
"PLR0917", # too-many-positional-arguments (newly enforced in ruff 0.16;
# incompatible with Twisted-style long method signatures
# used throughout the codebase)
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
"ARG", # unused arguments (test fixtures)
"D", # docstrings not enforced in tests
"E402", # module-level imports not at top
"E722", # bare-except
"E731", # lambda assignments
"F821", # undefined names (test fixtures)
"PT009", # pytest-unittest-assertion (allow mixing in tests)
"PT027", # pytest-unittest-raises-assertion
"S", # security checks not relevant in tests
]
"tests/acceptance/**/*.py" = [
"D", # docstrings not enforced
"E402", # module-level imports not at top
"E722", # bare-except
"F821", # undefined names
"S", # security checks not relevant
]
"trigger/bin/**/*.py" = [
"S605", # start-process-with-a-shell (CLI tools)
"S606", # start-process-with-no-shell
"S607", # start-process-with-partial-path
]
"configs/**/*.py" = [
"ERA001", # commented-out code (serves as user documentation/examples)
"PTH", # pathlib (settings values are strings by design)
]
"docs/conf.py" = [
"D", # docstrings not enforced
"E402", # module-level imports not at top
"F401", # unused imports (used by Sphinx)
]
[tool.ruff.lint.isort]
known-first-party = ["trigger"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.semantic_release]
version_toml = ["pyproject.toml:project.version"]
branch = "main"
upload_to_pypi = true
upload_to_release = true
build_command = "pip install uv && uv build"
major_on_zero = false
tag_format = "v{version}"
[tool.semantic_release.commit_parser_options]
allowed_tags = ["feat", "fix", "perf", "refactor", "docs", "chore", "ci", "test", "build"]
major_tags = ["BREAKING CHANGE"]
minor_tags = ["feat"]
patch_tags = ["fix", "perf"]
[tool.semantic_release.changelog]
[tool.semantic_release.changelog.default_templates]
changelog_file = "CHANGELOG.md"
[tool.semantic_release.branches.main]
match = "main"
prerelease = false