forked from hypersdk/hyper2kvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
355 lines (315 loc) · 8.3 KB
/
pyproject.toml
File metadata and controls
355 lines (315 loc) · 8.3 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
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
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "hyper2kvm"
version = "0.2.1"
description = "Production-Grade Hypervisor to KVM/QEMU Migration Toolkit"
readme = "README.md"
authors = [
{name = "Susant Sahani", email = "ssahani@gmail.com"}
]
maintainers = [
{name = "Susant Sahani", email = "ssahani@gmail.com"}
]
license = {text = "LGPL-3.0-or-later"}
keywords = [
"kvm",
"qemu",
"virtualization",
"vm-migration",
"hypervisor",
"vmware",
"vsphere",
"azure",
"hyper-v",
"libvirt",
"cloud-migration",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: System Administrators",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: System :: Systems Administration",
"Topic :: System :: Installation/Setup",
"Topic :: Utilities",
"Environment :: Console",
]
requires-python = ">=3.10"
dependencies = [
# Core dependencies (required for basic functionality)
"click>=8.0.0",
"pyyaml>=5.4.0",
"argcomplete>=2.0.0",
]
[project.optional-dependencies]
# UI enhancements (recommended but not required)
ui = [
"rich>=10.0.0",
]
# VMware vSphere support
vsphere = [
"pyvmomi>=7.0.0",
"requests>=2.25.0",
]
# Azure support
azure = [
"azure-identity>=1.10.0",
"azure-mgmt-compute>=29.0.0",
"azure-mgmt-network>=22.0.0",
"azure-mgmt-resource>=22.0.0",
"azure-storage-blob>=12.14.0",
"requests>=2.25.0",
]
# Enhanced validation (optional for RHEL 10 compatibility)
# Provides type-safe configuration validation with better error messages
validation = [
"pydantic>=2.5.0",
"pydantic-settings>=2.1.0",
]
# Advanced retry logic (optional for RHEL 10 compatibility)
# Provides advanced retry features, falls back to stdlib if not available
retry = [
"tenacity>=8.2.0",
]
# Daemon mode (file watching)
# Enables automatic migration processing from watched directories
daemon = [
"watchdog>=3.0.0",
]
# Interactive TUI (Terminal User Interface)
# Real-time monitoring dashboard with live metrics
tui = [
"textual>=0.47.0",
]
# Async operations (parallel migrations)
# Enables async VMware operations for 3-5x faster batch migrations
async = [
"httpx>=0.24.0",
"httpx[http2]>=0.24.0",
]
# All enhancements (validation + retry + daemon + tui + async)
enhanced = [
"pydantic>=2.5.0",
"pydantic-settings>=2.1.0",
"tenacity>=8.2.0",
"watchdog>=3.0.0",
"textual>=0.47.0",
"httpx>=0.24.0",
"httpx[http2]>=0.24.0",
]
# Full installation with all optional dependencies
full = [
"rich>=10.0.0",
"pyvmomi>=7.0.0",
"requests>=2.25.0",
"azure-identity>=1.10.0",
"azure-mgmt-compute>=29.0.0",
"azure-mgmt-network>=22.0.0",
"azure-mgmt-resource>=22.0.0",
"azure-storage-blob>=12.14.0",
"pydantic>=2.5.0",
"pydantic-settings>=2.1.0",
"tenacity>=8.2.0",
"watchdog>=3.0.0",
"textual>=0.47.0",
"httpx>=0.24.0",
"httpx[http2]>=0.24.0",
]
# Development tools
dev = [
"pytest>=7.0.0",
"pytest-cov>=3.0.0",
"pytest-asyncio>=0.21.0",
"black>=22.0.0",
"flake8>=4.0.0",
"mypy>=0.950",
"autoflake>=1.4",
"argcomplete>=2.0.0",
]
[project.urls]
Homepage = "https://github.com/ssahani/hyper2kvm"
Documentation = "https://github.com/ssahani/hyper2kvm/tree/main/docs"
Repository = "https://github.com/ssahani/hyper2kvm"
"Bug Tracker" = "https://github.com/ssahani/hyper2kvm/issues"
Changelog = "https://github.com/ssahani/hyper2kvm/releases"
[project.scripts]
# Primary CLI command (kubectl-style naming)
h2kvmctl = "hyper2kvm.__main__:main"
# Backwards-compatible alias (legacy name)
hyper2kvm = "hyper2kvm.__main__:main"
# TUI dashboard
hyper2kvm-tui = "hyper2kvm.tui.main_app:run_hyper2kvm_tui"
h2kvmctl-tui = "hyper2kvm.tui.main_app:run_hyper2kvm_tui"
[tool.setuptools]
include-package-data = true
[tool.setuptools.packages.find]
where = ["."]
include = ["hyper2kvm*"]
exclude = ["tests*", "docs*", "examples*"]
[tool.setuptools.package-data]
hyper2kvm = ["*.yaml", "*.json", "*.conf"]
[tool.black]
line-length = 120
target-version = ['py310', 'py311', 'py312']
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = "--verbose --cov=hyper2kvm --cov-report=html --cov-report=term"
[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false
# Hatch configuration
[tool.hatch.envs.default]
dependencies = [
"pytest>=7.4.0",
"pytest-cov>=4.1.0",
"pytest-xdist>=3.3.0",
"pytest-mock>=3.11.0",
"ruff>=0.1.0",
"mypy>=1.5.0",
"bandit>=1.7.5",
"safety>=2.3.0",
]
[tool.hatch.envs.default.scripts]
# Testing
test = "pytest tests/unit/ -v --tb=short"
test-unit = "pytest tests/unit/ -v"
test-integration = "pytest tests/integration/ -v --tb=short"
test-all = "pytest tests/ -v"
test-cov = "pytest tests/unit/ --cov=hyper2kvm --cov-report=html --cov-report=term-missing"
test-cov-all = "pytest tests/ --cov=hyper2kvm --cov-report=html --cov-report=term-missing"
# Code quality
lint = [
"ruff check hyper2kvm/",
"mypy hyper2kvm/ --ignore-missing-imports",
]
fmt = [
"ruff format hyper2kvm/",
"ruff check --fix hyper2kvm/",
]
fmt-check = "ruff format --check hyper2kvm/"
# Security
security = [
"bandit -r hyper2kvm/ -ll",
"safety check --json",
]
security-audit = "bandit -r hyper2kvm/ -ll -f json -o security-report.json"
# All checks (CI pipeline)
check = [
"test",
"lint",
"security",
]
ci = [
"test-cov",
"lint",
"security",
]
# Development environment with all optional dependencies
[tool.hatch.envs.dev]
template = "default"
dependencies = [
"pytest>=7.4.0",
"pytest-cov>=4.1.0",
"pytest-xdist>=3.3.0",
"pytest-mock>=3.11.0",
"ruff>=0.1.0",
"mypy>=1.5.0",
"bandit>=1.7.5",
"safety>=2.3.0",
"sphinx>=7.0.0",
"sphinx-rtd-theme>=1.3.0",
"myst-parser>=2.0.0",
]
[tool.hatch.envs.dev.scripts]
docs-build = "cd man && make html"
docs-serve = "python -m http.server -d man/build/html 8000"
# Matrix testing across Python versions
[tool.hatch.envs.test]
template = "default"
[[tool.hatch.envs.test.matrix]]
python = ["3.10", "3.11", "3.12"]
[tool.hatch.envs.test.scripts]
run = "pytest tests/unit/ -v --tb=short"
cov = "pytest tests/unit/ --cov=hyper2kvm --cov-report=term-missing"
# Ruff configuration
[tool.ruff]
line-length = 120
target-version = "py310"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
]
ignore = [
"E501", # line too long (handled by formatter)
"B008", # do not perform function calls in argument defaults
"C901", # too complex
]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
# Semantic Release configuration
[tool.semantic_release]
version_variables = [
"hyper2kvm/__init__.py:__version__",
"pyproject.toml:version",
]
version_toml = ["pyproject.toml:project.version"]
branch = "main"
upload_to_repository = true
upload_to_release = true
build_command = "pip install hatch && hatch build"
commit_message = "chore(release): {version}\n\n[skip ci]"
[tool.semantic_release.commit_parser_options]
allowed_tags = [
"build",
"chore",
"ci",
"docs",
"feat",
"fix",
"perf",
"style",
"refactor",
"test",
]
minor_tags = ["feat"]
patch_tags = ["fix", "perf"]
[tool.semantic_release.changelog]
template_dir = "templates"
changelog_file = "CHANGELOG.md"
exclude_commit_patterns = []
[tool.semantic_release.changelog.environment]
block_start_string = "{%"
block_end_string = "%}"
variable_start_string = "{{"
variable_end_string = "}}"
comment_start_string = "{#"
comment_end_string = "#}"
trim_blocks = false
lstrip_blocks = false
newline_sequence = "\n"
keep_trailing_newline = false
extensions = []
autoescape = true
[tool.semantic_release.branches.main]
match = "(main|master)"
prerelease_token = "rc"
prerelease = false