python: mkvenv: introduce TOML-like representation of dependencies
commit0f1ec0705b92b79e5e5f69bed236639dae67d312
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 8 Aug 2023 07:47:25 +0000 (8 09:47 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 28 Aug 2023 07:55:05 +0000 (28 09:55 +0200)
treed0a160e0840d854e77aaeeaed61551813da4ee58
parent67b9a83daf384f3dc24e83f22da40e34da49021d
python: mkvenv: introduce TOML-like representation of dependencies

We would like to place all Python dependencies in the same file, so that
we can add more information without having long and complex command lines.
The plan is to have a TOML file with one entry per package, for example

  [avocado]
  avocado-framework = {
    accepted = "(>=88.1, <93.0)",
    installed = "88.1",
    canary = "avocado"
  }

Each TOML section will thus be a dictionary of dictionaries.  Modify
mkvenv.py's workhorse function, _do_ensure, to already operate on such
a data structure.  The "ensure" subcommand is modified to separate the
depspec into a name and a version part, and use the result (plus the
--diagnose argument) to build a dictionary for each command line argument.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
python/scripts/mkvenv.py