forked from kandji-inc/kst
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
224 lines (204 loc) · 7.6 KB
/
pyproject.toml
File metadata and controls
224 lines (204 loc) · 7.6 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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
[project]
name = "kst"
dynamic = ["version"]
description = "Kandji Sync Toolkit, a utility for local management of Kandji resources."
dependencies = [
"click<8.2.0",
"platformdirs>=4.3.6",
"pydantic>=2.9.2",
"requests>=2.32.3",
"ruamel-yaml>=0.18.6",
"typer>=0.15.1",
]
requires-python = ">=3.12"
readme = "README.md"
license = "MIT"
license-files = ["LICENSE"]
keywords = ["kandji", "kandji-sync-toolkit"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: Unix",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Version Control :: Git",
"Topic :: System :: Systems Administration",
]
[project.urls]
Homepage = "https://github.com/kandji-inc/kst"
Repository = "https://github.com/kandji-inc/kst.git"
"Bug Tracker" = "https://github.com/kandji-inc/kst/issues"
[project.scripts]
kst = "kst:app"
[dependency-groups]
dev = [
"beautysh>=6.2.1",
"codespell[toml]>=2.3.0",
"detect-secrets>=1.5.0",
"poethepoet>=0.29.0",
"pre-commit>=4.0.1",
"pytest-cov>=5.0.0",
"pytest>=8.3.3",
"python-dotenv>=1.0.1",
"ruff>=0.6.9",
"shellcheck-py>=0.10.0.1",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.uv]
python-preference = "only-managed"
[tool.hatch.version]
path = "src/kst/__about__.py"
[tool.ruff]
lint.select = ["ALL"]
# Rules can be ignored, see: https://beta.ruff.rs/docs/rules/
lint.extend-ignore = [
"A002", # "Argument `object` is shadowing a python builtin"
"A003", # [builtin-attribute-shadowing](https://beta.ruff.rs/docs/rules/builtin-attribute-shadowing/)
"ANN", # [flake8-annotations](https://pypi.org/project/flake8-annotations/)
"B", # [flake8-bugbear](https://pypi.org/project/flake8-bugbear/)
"BLE001", # "Do not catch blind exception"
"C901", # "is too complex"
"COM812", # "Trailing comma missing". If black is happy, I'm happy.
"D", # [pydocstyle](https://pypi.org/project/pydocstyle/)
"DTZ005", # "The use of `datetime.datetime.now()` without `tz` argument is not allowed".
"E203", # "Whitespace before ':'".
"E266", # "Too many leading '#' for block comment".
"E501", # "Line too long". If black is happy, I'm happy.
"EM101", # "Exception must not use a string literal, assign to variable first"
"EM102", # "Exception must not use an f-string literal, assign to variable first"
"F811", # "Redefinition of unused `step_impl` from line"
"FBT", # [flake8-boolean-trap](https://pypi.org/project/flake8-boolean-trap/)
"FIX", # [flake8-fixme](https://github.com/tommilligan/flake8-fixme)
"G003", # "Logging statement uses `+`"
"G004", # "Logging statement uses f-string"
"INP001", # "File is part of an implicit namespace package. Add an `__init__.py`"
"ISC", # [flake8-implicit-str-concat](https://pypi.org/project/flake8-implicit-str-concat/)
"N806", # "Variable in function should be lowercase"
"N999", # "Invalid module name:"
"PERF", # [perflint](https://pypi.org/project/perflint/)
"PGH004", # "Use specific rule codes when using `noqa`"
"PLR", # [pylint-refactor](https://pypi.org/project/pylint/)
"PLW0120", # "`else` clause on loop without a `break` statement;"
"PTH", # [flake8-use-pathlib](https://pypi.org/project/flake8-use-pathlib/)
"RET", # [flake8-return](https://pypi.org/project/flake8-return/)
"RUF010", # [explicit-f-string-type-conversion](https://beta.ruff.rs/docs/rules/explicit-f-string-type-conversion/)
"RUF012", # [mutable-class-default](https://beta.ruff.rs/docs/rules/mutable-class-default/)
"S", # [flake8-bandit](https://pypi.org/project/flake8-bandit/)
"SIM", # [flake8-simplify](https://pypi.org/project/flake8-simplify/)
"SLF001", # "Private member accessed"
"T201", # "`print` found"
"TD", # [flake8-todos](https://pypi.org/project/flake8-todos/)
"TRY", # [tryceratops](https://pypi.org/project/tryceratops/1.1.0/)
]
line-length = 120
[tool.ruff.lint.extend-per-file-ignores]
"tests/**" = [
"ARG001", # mocking requires parameters which may not be used
"F401" # importing fixtures into conftest is not detected as use
]
[tool.codespell]
ignore-regex = "'def.*|except.*|.*error.*|function.*'"
ignore-words-list = "doubleClick,doubleclick"
skip = ".git,*.strings"
quiet-level = 10
[tool.pytest.ini_options]
markers = [
"allow_http: allow external HTTP requests",
"profile_count: set the number of profiles to create for some tests",
"script_count: set the number of scripts to create for some tests"
]
addopts = [
"--import-mode=importlib",
]
[tool.poe]
shell_interpreter = "zsh"
[tool.poe.tasks.help]
cmd = "uv run poe --help"
help = "show the options and available tasks"
[tool.poe.tasks.setup]
control.expr = "clean"
args = { clean = { type = "boolean" } }
switch = [
{ case = "True", sequence = [
"uv run pre-commit uninstall",
"uv run pre-commit clean",
"rm -rf .venv",
"uv venv",
"uv run pre-commit install --install-hooks",
], default_item_type = "cmd" },
{ sequence = [
"uv venv",
"uv run pre-commit install --install-hooks",
], default_item_type = "cmd" },
]
help = "setup dev environment"
[tool.poe.tasks.clean]
default_item_type = "cmd"
sequence = [
"git stash push -u",
"git clean -dffx -e .venv -e .vscode -e .idea -e .env",
]
help = "Cleanup auto-generated untracked files"
[tool.poe.tasks.export]
cmd = "uv export --no-dev -o requirements.txt -q"
help = "update venv and requirements.txt file"
[tool.poe.tasks.lint]
control.expr = "all"
switch = [
{ case = "True", sequence = [
"uv run pre-commit run ruff --all-files",
"uv run pre-commit run shellcheck --all-files",
"uv run pre-commit run codespell --all-files",
"uv run pre-commit run detect-secrets --all-files",
], default_item_type = "cmd", ignore_fail = true },
{ sequence = [
"uv run pre-commit run ruff",
"uv run pre-commit run shellcheck",
"uv run pre-commit run codespell",
"uv run pre-commit run detect-secrets",
], default_item_type = "cmd", ignore_fail = true },
]
args = { all = { type = "boolean" } }
help = "lint python and shell scripts"
[tool.poe.tasks.format]
control.expr = "all"
args = { all = { type = "boolean" } }
switch = [
{ case = "True", sequence = [
"uv run pre-commit run ruff-format --all-files",
"uv run pre-commit run beautysh --all-files",
"uv run pre-commit run pretty-format-json --all-files",
], default_item_type = "cmd", ignore_fail = true },
{ sequence = [
"uv run pre-commit run ruff-format",
"uv run pre-commit run beautysh",
"uv run pre-commit run pretty-format-json",
], default_item_type = "cmd", ignore_fail = true },
]
help = "format python and shell scripts"
[tool.poe.tasks.test]
cmd = "uv run pytest --quiet --showlocals"
help = "run pytest tests"
[tool.poe.tasks.all]
control.expr = "all"
args = { all = { type = "boolean" } }
help = "run all lint, fmt, and test"
switch = [
{ case = "True", sequence = [
"lint --all",
"format --all",
"test",
], ignore_fail = true },
{ sequence = [
"lint",
"format",
"test",
], ignore_fail = true },
]