-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
361 lines (312 loc) · 8.08 KB
/
pyproject.toml
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.setuptools.package-data]
"edwh" = ["py.typed"]
[project]
name = "edwh"
dynamic = ["version"]
description = 'Education Warehouse maintenance tools'
readme = "README.md"
requires-python = ">=3.10"
license-expression = "MIT"
keywords = []
authors = [
{ name = "Remco Boerma", email = "[email protected]" },
{ name = "Robin van der Noord", email = "[email protected]" },
{ name = "Romy Schöller", email = "[email protected]" },
{ name = "Sven Keimpema", email = "[email protected]" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"anyio", # for async log reading
"click", # for interactive select box (e.g. in `ew setup`)
"diceware", # for generating random, safe passhprases
"fabric >= 3.1", # invoke but remote
"humanize", # for making raw sizes huam nreadable
"invoke >= 2.1", # base cli tool
"more_itertools", # improved 'flatten' function (among others)
"packaging", # parsing package versions (for plugin subcommand)
"plumbum", # running bash commands more nicely than with invoke
"python-dateutil", # improved date parsing
"pyyaml", # yaml parser (for docker-compose.yml)
"rapidfuzz", # levenshtein my beloved
"requests", # better than urllib no?
"ruff", # For `edwh fmt`, `edwh lint`
"tabulate", # for nice cli tables
"termcolor", # improved ansi colored print
"threadful>=0.5", # running things in different threads easily, with animations
"tomlkit", # for toml reading and writing
"tqdm", # nice progress bars
"typing-extensions", # using modern typing features in older python versions
"uv", # faster pip
"yayarl", # like yarl (Pathlib style URL builder) but with requests built in
]
[project.optional-dependencies]
dev = [
"hatch",
"python-semantic-release<8",
"types-requests",
"types-python-dateutil",
"types-redis",
"types-tabulate"
]
omgeving = [
# no extra dependencies anymore !
# don't remove me, because then pip install edwh[omgeving] might complain
]
plugins = [
'edwh-b2-plugin',
'edwh-bundler-plugin',
'edwh-demo-plugin',
'edwh-files-plugin',
'edwh-locust-plugin',
'edwh-multipass-plugin',
'edwh-pipcompile-plugin',
'edwh-restic-plugin',
'edwh-server-provisioning-plugin',
'edwh-sshfs-plugin',
'edwh-sshkey-plugin',
'edwh-uptime-plugin',
'edwh-whitelabel-plugin',
]
# plugins that are useful on a (production) server:
server-plugins = [
'edwh-b2-plugin',
'edwh-bundler-plugin',
'edwh-files-plugin',
'edwh-pipcompile-plugin',
'edwh-restic-plugin',
'edwh-uptime-plugin',
]
server-provisioning = [
"edwh-server-provisioning-plugin"
]
sshkey = [
"edwh-sshkey-plugin"
]
restic = [
'edwh-restic-plugin',
]
multipass = [
'edwh-multipass-plugin',
]
pip = [
'edwh-pipcompile-plugin',
]
pip-compile = [
'edwh-pipcompile-plugin',
]
bundler = [
"edwh-bundler-plugin"
]
bundle = [
"edwh-bundler-plugin"
]
b2 = [
"edwh-b2-plugin"
]
locust = [
"edwh-locust-plugin"
]
sshfs = [
"edwh-sshfs-plugin"
]
files = [
'edwh-files-plugin'
]
whitelabel = [
'edwh-whitelabel-plugin'
]
uptime = [
'edwh-uptime-plugin'
]
[project.scripts]
edwh = "edwh.cli:program.run"
ew = "edwh.cli:program.run"
[project.urls]
Documentation = "https://github.com/educationwarehouse/edwh#readme"
Issues = "https://github.com/educationwarehouse/edwh/issues"
Source = "https://github.com/educationwarehouse/edwh"
[tool.semantic_release]
branch = "main"
version_variable = "src/edwh/__about__.py:__version__"
change_log = "CHANGELOG.md"
upload_to_repository = false
upload_to_release = false
build_command = "hatch build"
[tool.hatch.version]
path = "src/edwh/__about__.py"
[tool.hatch.envs.semver]
dependencies = [
"python-semantic-release",
]
[tool.hatch.envs.semver.scripts]
semver = "semantic-release"
[tool.hatch.envs.default]
dependencies = [
"coverage[toml]>=6.5",
"pytest",
# 'python-semantic-release >= 8.0.0a5'
]
[tool.hatch.envs.default.scripts]
# semver
test-semver = [
'python --version',
'semantic-release --version',
]
# note: don't run `hatch run publish` right now,
# because semantic release v7 (stable) is not compatible with invoke 2 (which is required for python3.11+)
# and semantic release v8 (alpha) is not compatible with the tool.semantic_release config in this file!
publish = [
'semantic-release publish',
'hatch build -c',
'hatch publish',
]
# pytest/cov
test = "pytest {args:tests}"
test-cov = "coverage run -m pytest {args:tests}"
cov-report = [
"- coverage combine",
"coverage report",
]
cov = [
"test-cov",
"cov-report",
]
[[tool.hatch.envs.all.matrix]]
python = ["3.10", "3.11", "3.12"]
[tool.hatch.envs.lint]
detached = true
dependencies = [
"black>=23.1.0",
"mypy>=1.0.0",
"ruff>=0.0.243",
]
[tool.hatch.envs.lint.scripts]
typing = "mypy --install-types --non-interactive {args:src/edwh tests}"
style = [
"ruff {args:.}",
"black --check --diff {args:.}",
]
fmt = [
"black {args:.}",
"ruff --fix {args:.}",
"style",
]
all = [
"style",
"typing",
]
[tool.black]
target-version = ["py310"]
line-length = 120
skip-string-normalization = false
[tool.ruff]
target-version = "py310"
line-length = 120
[tool.ruff.lint]
select = [
"F", # pyflake error
"E", # pycodestyle error
"W", # pycodestyle warning
"Q", # quotes
"A", # builtins
# "C4", # comprehensions
# "RET", # return
"SIM", # simplify
"ARG", # unused arguments
# "COM", # comma's
"PTH", # use pathlib
"RUF", # ruff rules
"C90", # mccabe (complexity)
# "I", # isort
"N", # pep-8 naming
# "D", # pydocstyle
# "UP", # pyupgrade
"YTT", # flake8-2020 (version hardcoding)
# "ANN", # annotations - werkt niet goed samen met invoke
# "ASYNC", # async - gebruiken we hier niet
# "S", # bandit (security)
# "BLE", # blind except
# "FBT", # boolean trap
# "B", # bugbear
# "DTZ", # datetimes
# "T10", # debugger
# "DJ", # django
# "ISC", # implicit string concat (handig voor als je een , mist in een lijst bijv.)
"SIM", # simplify
]
ignore = [
# Allow non-abstract empty methods in abstract base classes
"B027",
# Allow boolean positional values in function calls, like `dict.get(... True)`
"FBT003",
# Ignore checks for possible passwords
"S105", "S106", "S107",
# Ignore complexity
"C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915",
]
unfixable = [
# Don't touch unused imports
"F401",
]
[tool.ruff.lint.isort]
known-first-party = ["edwh"]
[tool.isort]
profile = "black"
[tool.ruff.lint.per-file-ignores]
# Tests can use magic values, assertions, and relative imports
"tests/**/*" = ["PLR2004", "S101", "TID252"]
[tool.coverage.run]
source_pkgs = ["edwh", "tests"]
branch = true
parallel = true
omit = [
"src/edwh/__about__.py",
]
[tool.coverage.paths]
edwh = ["src/edwh", "*/edwh/src/edwh"]
tests = ["tests", "*/edwh/tests"]
[tool.coverage.report]
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
[tool.mypy]
strict = true
[[tool.mypy.overrides]]
module = "yaml"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "tasks"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "fabric"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "fabric.connection"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "fabric.main"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "ansi.color.fx"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "diceware"
ignore_missing_imports = true
[tool.su6]
directory = "src"
include = []
exclude = []
stop-after-first-failure = true