maqet 0.0.1.3__tar.gz → 0.0.1.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- maqet-0.0.1.4/PKG-INFO +5 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/README.md +6 -8
- {maqet-0.0.1.3 → maqet-0.0.1.4}/pyproject.toml +1 -9
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/maqet/core.py +16 -0
- maqet-0.0.1.4/src/maqet.egg-info/PKG-INFO +5 -0
- maqet-0.0.1.3/PKG-INFO +0 -104
- maqet-0.0.1.3/src/maqet.egg-info/PKG-INFO +0 -104
- {maqet-0.0.1.3 → maqet-0.0.1.4}/setup.cfg +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/maqet/__init__.py +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/maqet/functions.py +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/maqet/logger.py +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/maqet/storage.py +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/maqet.egg-info/SOURCES.txt +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/maqet.egg-info/dependency_links.txt +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/maqet.egg-info/requires.txt +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/maqet.egg-info/top_level.txt +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/qemu/machine/__init__.py +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/qemu/machine/console_socket.py +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/qemu/machine/machine.py +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/qemu/machine/py.typed +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/qemu/machine/qtest.py +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/qemu/qmp/__init__.py +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/qemu/qmp/error.py +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/qemu/qmp/events.py +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/qemu/qmp/legacy.py +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/qemu/qmp/message.py +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/qemu/qmp/models.py +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/qemu/qmp/protocol.py +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/qemu/qmp/py.typed +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/qemu/qmp/qmp_client.py +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/qemu/qmp/qmp_shell.py +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/qemu/qmp/qmp_tui.py +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/qemu/qmp/util.py +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/qemu/utils/__init__.py +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/qemu/utils/accel.py +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/qemu/utils/py.typed +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/qemu/utils/qemu_ga_client.py +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/qemu/utils/qom.py +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/qemu/utils/qom_common.py +0 -0
- {maqet-0.0.1.3 → maqet-0.0.1.4}/src/qemu/utils/qom_fuse.py +0 -0
maqet-0.0.1.4/PKG-INFO
ADDED
@@ -17,7 +17,7 @@ so all features implemented are primarily pursuing this goal.
|
|
17
17
|
|
18
18
|
### Roadmap
|
19
19
|
|
20
|
-
First usable version:
|
20
|
+
First usable version a.k.a. MVP a.k.a. v0.0.1:
|
21
21
|
|
22
22
|
- [x] YAML manifest for VM settings
|
23
23
|
- [x] Storage (-drive) management:
|
@@ -35,6 +35,7 @@ Goals for near future (sorted by priority):
|
|
35
35
|
- [ ] Extensible system of kwargs handling in every class (see in dev notes)
|
36
36
|
- [ ] Unit tests
|
37
37
|
- [ ] Full translation of strings into QMP key inputs
|
38
|
+
- [ ] Small usage example
|
38
39
|
|
39
40
|
Advanced goals
|
40
41
|
|
@@ -45,7 +46,7 @@ Advanced goals
|
|
45
46
|
|
46
47
|
## Usage guide
|
47
48
|
|
48
|
-
See [example](
|
49
|
+
See [example](./example)
|
49
50
|
Full documentation will be later
|
50
51
|
|
51
52
|
## Development notes
|
@@ -55,8 +56,7 @@ Full documentation will be later
|
|
55
56
|
Problem: classes have *args and **kwargs arguments. It gives flexibility,
|
56
57
|
but also makes argument handling cumbersome (Ladder of if statements).
|
57
58
|
|
58
|
-
Main class - Maqet, get it's kwargs and uses them as a config,
|
59
|
-
parses and creates Machine class object
|
59
|
+
Main class - Maqet, get it's kwargs and uses them as a config, parses and creates Machine class object
|
60
60
|
with relevant arguments, also in form of kwargs.
|
61
61
|
|
62
62
|
Idea is to make it extensible and unified. Like this:
|
@@ -81,13 +81,11 @@ some_custom_field:
|
|
81
81
|
```
|
82
82
|
|
83
83
|
Binary is easy, just pass it into Machine
|
84
|
-
What about arguments? Also pass into Machie, I made parser that turn them
|
85
|
-
into cli arguments for qemu binary
|
84
|
+
What about arguments? Also pass into Machie, I made parser that turn them into cli arguments for qemu binary
|
86
85
|
Storage? Call object Storage for every object in the list and pass contents inside
|
87
86
|
Custom field? It will be ignored. If we want to use it?
|
88
87
|
For example:
|
89
|
-
We want to turn `memory: 8G, cpu: 4` into `-m 8G -smp 4`
|
90
|
-
and run `print("I_LIKE_PONIES")` before VM starts.
|
88
|
+
We want to turn `memory: 8G, cpu: 4` into `-m 8G -smp 4` and run `print("I_LIKE_PONIES")` before VM starts.
|
91
89
|
So we need somehow to extend Maqet class. How to do it? Still not sure.
|
92
90
|
|
93
91
|
### QEMU not in PyPI
|
@@ -3,18 +3,10 @@ requires = ["setuptools >= 61.0"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
4
4
|
|
5
5
|
[project]
|
6
|
-
readme = "README.md"
|
7
6
|
name = "maqet"
|
8
|
-
version = "0.0.1.
|
7
|
+
version = "0.0.1.4"
|
9
8
|
requires-python = ">= 3.12"
|
10
9
|
dependencies = ["python-benedict>=0.33.2"]
|
11
|
-
classifiers = [
|
12
|
-
# Specify the Python versions you support here.
|
13
|
-
"Programming Language :: Python :: 3.12",
|
14
|
-
]
|
15
|
-
|
16
|
-
[project.urls]
|
17
|
-
Repository = "https://gitlab.com/m4x0n_24/maqet/-/tree/main"
|
18
10
|
|
19
11
|
[tool.setuptools.packages.find]
|
20
12
|
where = ["src"]
|
@@ -260,6 +260,8 @@ class Maqet:
|
|
260
260
|
self.Machine = Machine # For comfortable stage building
|
261
261
|
self._config = benedict(kwargs)
|
262
262
|
|
263
|
+
self._validate_config()
|
264
|
+
|
263
265
|
self._stages = dict()
|
264
266
|
self.storage: dict[str, Drive] = dict()
|
265
267
|
|
@@ -276,6 +278,18 @@ class Maqet:
|
|
276
278
|
else:
|
277
279
|
LOG.warning(f"Stage {stage} not found. Skipping")
|
278
280
|
|
281
|
+
def _validate_config(self):
|
282
|
+
default_config_fields = {
|
283
|
+
'binary': 'qemu-system-x86_64',
|
284
|
+
'arguments': [],
|
285
|
+
'user_arguments': [],
|
286
|
+
'storage': {}
|
287
|
+
}
|
288
|
+
|
289
|
+
for k, v in default_config_fields.items():
|
290
|
+
if k not in self._config:
|
291
|
+
self._config[k] = v
|
292
|
+
|
279
293
|
@property
|
280
294
|
def command(self) -> str:
|
281
295
|
"""
|
@@ -298,9 +312,11 @@ class Maqet:
|
|
298
312
|
@config.setter
|
299
313
|
def set_config(self, new_config: dict):
|
300
314
|
self._config = benedict(new_config)
|
315
|
+
self._validate_config()
|
301
316
|
|
302
317
|
def merge_config(self, new_config: dict):
|
303
318
|
self._config.merge(new_config)
|
319
|
+
self._validate_config()
|
304
320
|
|
305
321
|
def add_argument(self, argument: str) -> None:
|
306
322
|
"""
|
maqet-0.0.1.3/PKG-INFO
DELETED
@@ -1,104 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: maqet
|
3
|
-
Version: 0.0.1.3
|
4
|
-
Project-URL: Repository, https://gitlab.com/m4x0n_24/maqet/-/tree/main
|
5
|
-
Classifier: Programming Language :: Python :: 3.12
|
6
|
-
Requires-Python: >=3.12
|
7
|
-
Description-Content-Type: text/markdown
|
8
|
-
Requires-Dist: python-benedict>=0.33.2
|
9
|
-
|
10
|
-
# MAQET
|
11
|
-
|
12
|
-
**Work in progress.** Documentation and code can be absolute mess.
|
13
|
-
|
14
|
-
If you are willing to help - open issue, MR or do something else
|
15
|
-
to attract maintainer's attention
|
16
|
-
|
17
|
-
## Description
|
18
|
-
|
19
|
-
MAQET stands for M4x0n QEmu Tool.
|
20
|
-
It's based on [QEMU](https://gitlab.com/qemu-project/qemu) python [tooling](https://gitlab.com/qemu-project/qemu/-/tree/master/python?ref_type=heads).
|
21
|
-
|
22
|
-
Main goal of this project is to provide good way to run qemu virtual machine.
|
23
|
-
Author (m4x0n) wants to create virtual environment for repeatable testing
|
24
|
-
of Linux installation and configuration before messing around with real computer,
|
25
|
-
so all features implemented are primarily pursuing this goal.
|
26
|
-
|
27
|
-
### Roadmap
|
28
|
-
|
29
|
-
First usable version:
|
30
|
-
|
31
|
-
- [x] YAML manifest for VM settings
|
32
|
-
- [x] Storage (-drive) management:
|
33
|
-
- [x] RAW and QCOW2 files
|
34
|
-
- [x] Using backing images for QCOW2
|
35
|
-
- [x] Internal snapshots for QCOW2
|
36
|
-
- [x] Stages defined as python functions with decorator (Flask style)
|
37
|
-
- [x] CLI to specify stage, additional arguments and options
|
38
|
-
- [x] QMP commands
|
39
|
-
|
40
|
-
Goals for near future (sorted by priority):
|
41
|
-
|
42
|
-
- [ ] Unified naming of variables (what is config? What is manifest?)
|
43
|
-
- [ ] Code cleanup, adding typing hints, docstrings etc.
|
44
|
-
- [ ] Extensible system of kwargs handling in every class (see in dev notes)
|
45
|
-
- [ ] Unit tests
|
46
|
-
- [ ] Full translation of strings into QMP key inputs
|
47
|
-
|
48
|
-
Advanced goals
|
49
|
-
|
50
|
-
- [ ] Custom QMP command presets
|
51
|
-
- [ ] Advanced storage management
|
52
|
-
- [ ] Runtime snapshots via qmp
|
53
|
-
- [ ] Remote storage types (iscsi)
|
54
|
-
|
55
|
-
## Usage guide
|
56
|
-
|
57
|
-
See [example](https://gitlab.com/m4x0n_24/maqet/-/tree/main/example)
|
58
|
-
Full documentation will be later
|
59
|
-
|
60
|
-
## Development notes
|
61
|
-
|
62
|
-
### Unification of **kwargs handling in extensible way
|
63
|
-
|
64
|
-
Problem: classes have *args and **kwargs arguments. It gives flexibility,
|
65
|
-
but also makes argument handling cumbersome (Ladder of if statements).
|
66
|
-
|
67
|
-
Main class - Maqet, get it's kwargs and uses them as a config,
|
68
|
-
parses and creates Machine class object
|
69
|
-
with relevant arguments, also in form of kwargs.
|
70
|
-
|
71
|
-
Idea is to make it extensible and unified. Like this:
|
72
|
-
|
73
|
-
```yaml
|
74
|
-
binary: qemu-system-x86_64
|
75
|
-
arguments:
|
76
|
-
- foo
|
77
|
-
- bar
|
78
|
-
- baz
|
79
|
-
storage:
|
80
|
-
- hda:
|
81
|
-
size: 5G
|
82
|
-
type: qcow2
|
83
|
-
options:
|
84
|
-
id: sda
|
85
|
-
...
|
86
|
-
some_custom_field:
|
87
|
-
- memory: 8G
|
88
|
-
- cpu: 4
|
89
|
-
- print: I_LIKE_PONIES
|
90
|
-
```
|
91
|
-
|
92
|
-
Binary is easy, just pass it into Machine
|
93
|
-
What about arguments? Also pass into Machie, I made parser that turn them
|
94
|
-
into cli arguments for qemu binary
|
95
|
-
Storage? Call object Storage for every object in the list and pass contents inside
|
96
|
-
Custom field? It will be ignored. If we want to use it?
|
97
|
-
For example:
|
98
|
-
We want to turn `memory: 8G, cpu: 4` into `-m 8G -smp 4`
|
99
|
-
and run `print("I_LIKE_PONIES")` before VM starts.
|
100
|
-
So we need somehow to extend Maqet class. How to do it? Still not sure.
|
101
|
-
|
102
|
-
### QEMU not in PyPI
|
103
|
-
|
104
|
-
Now QEMU tooling for python is used as sparse-checkouted git submodule.
|
@@ -1,104 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: maqet
|
3
|
-
Version: 0.0.1.3
|
4
|
-
Project-URL: Repository, https://gitlab.com/m4x0n_24/maqet/-/tree/main
|
5
|
-
Classifier: Programming Language :: Python :: 3.12
|
6
|
-
Requires-Python: >=3.12
|
7
|
-
Description-Content-Type: text/markdown
|
8
|
-
Requires-Dist: python-benedict>=0.33.2
|
9
|
-
|
10
|
-
# MAQET
|
11
|
-
|
12
|
-
**Work in progress.** Documentation and code can be absolute mess.
|
13
|
-
|
14
|
-
If you are willing to help - open issue, MR or do something else
|
15
|
-
to attract maintainer's attention
|
16
|
-
|
17
|
-
## Description
|
18
|
-
|
19
|
-
MAQET stands for M4x0n QEmu Tool.
|
20
|
-
It's based on [QEMU](https://gitlab.com/qemu-project/qemu) python [tooling](https://gitlab.com/qemu-project/qemu/-/tree/master/python?ref_type=heads).
|
21
|
-
|
22
|
-
Main goal of this project is to provide good way to run qemu virtual machine.
|
23
|
-
Author (m4x0n) wants to create virtual environment for repeatable testing
|
24
|
-
of Linux installation and configuration before messing around with real computer,
|
25
|
-
so all features implemented are primarily pursuing this goal.
|
26
|
-
|
27
|
-
### Roadmap
|
28
|
-
|
29
|
-
First usable version:
|
30
|
-
|
31
|
-
- [x] YAML manifest for VM settings
|
32
|
-
- [x] Storage (-drive) management:
|
33
|
-
- [x] RAW and QCOW2 files
|
34
|
-
- [x] Using backing images for QCOW2
|
35
|
-
- [x] Internal snapshots for QCOW2
|
36
|
-
- [x] Stages defined as python functions with decorator (Flask style)
|
37
|
-
- [x] CLI to specify stage, additional arguments and options
|
38
|
-
- [x] QMP commands
|
39
|
-
|
40
|
-
Goals for near future (sorted by priority):
|
41
|
-
|
42
|
-
- [ ] Unified naming of variables (what is config? What is manifest?)
|
43
|
-
- [ ] Code cleanup, adding typing hints, docstrings etc.
|
44
|
-
- [ ] Extensible system of kwargs handling in every class (see in dev notes)
|
45
|
-
- [ ] Unit tests
|
46
|
-
- [ ] Full translation of strings into QMP key inputs
|
47
|
-
|
48
|
-
Advanced goals
|
49
|
-
|
50
|
-
- [ ] Custom QMP command presets
|
51
|
-
- [ ] Advanced storage management
|
52
|
-
- [ ] Runtime snapshots via qmp
|
53
|
-
- [ ] Remote storage types (iscsi)
|
54
|
-
|
55
|
-
## Usage guide
|
56
|
-
|
57
|
-
See [example](https://gitlab.com/m4x0n_24/maqet/-/tree/main/example)
|
58
|
-
Full documentation will be later
|
59
|
-
|
60
|
-
## Development notes
|
61
|
-
|
62
|
-
### Unification of **kwargs handling in extensible way
|
63
|
-
|
64
|
-
Problem: classes have *args and **kwargs arguments. It gives flexibility,
|
65
|
-
but also makes argument handling cumbersome (Ladder of if statements).
|
66
|
-
|
67
|
-
Main class - Maqet, get it's kwargs and uses them as a config,
|
68
|
-
parses and creates Machine class object
|
69
|
-
with relevant arguments, also in form of kwargs.
|
70
|
-
|
71
|
-
Idea is to make it extensible and unified. Like this:
|
72
|
-
|
73
|
-
```yaml
|
74
|
-
binary: qemu-system-x86_64
|
75
|
-
arguments:
|
76
|
-
- foo
|
77
|
-
- bar
|
78
|
-
- baz
|
79
|
-
storage:
|
80
|
-
- hda:
|
81
|
-
size: 5G
|
82
|
-
type: qcow2
|
83
|
-
options:
|
84
|
-
id: sda
|
85
|
-
...
|
86
|
-
some_custom_field:
|
87
|
-
- memory: 8G
|
88
|
-
- cpu: 4
|
89
|
-
- print: I_LIKE_PONIES
|
90
|
-
```
|
91
|
-
|
92
|
-
Binary is easy, just pass it into Machine
|
93
|
-
What about arguments? Also pass into Machie, I made parser that turn them
|
94
|
-
into cli arguments for qemu binary
|
95
|
-
Storage? Call object Storage for every object in the list and pass contents inside
|
96
|
-
Custom field? It will be ignored. If we want to use it?
|
97
|
-
For example:
|
98
|
-
We want to turn `memory: 8G, cpu: 4` into `-m 8G -smp 4`
|
99
|
-
and run `print("I_LIKE_PONIES")` before VM starts.
|
100
|
-
So we need somehow to extend Maqet class. How to do it? Still not sure.
|
101
|
-
|
102
|
-
### QEMU not in PyPI
|
103
|
-
|
104
|
-
Now QEMU tooling for python is used as sparse-checkouted git submodule.
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|