Bundle Yamale schema

TIL! Using the existence of obscure member sys._MEIPASS, I can detect if
we're running from a bundled PyInstaller binary, versus running from Python
directly.

Add schema.yaml to the datas of the PyInstaller spec. Then, if the
-/--schema flag is given, use it, and if it's not given, default to the
built-in one if we're running from a bundled binary, or fall-through to
./schema.yaml in other cases.

This avoids the need for config/schema.py as a carbon-copy of the schema,
slick!
This commit is contained in:
Pim van Pelt
2022-04-05 12:40:05 +00:00
parent fdb732142a
commit 289138da94
5 changed files with 25 additions and 95 deletions

@ -22,7 +22,7 @@ sudo pip3 install pyinstaller
./tests.py -d -t unittest/yaml/*.yaml
## Build the tool
pyinstaller vppcfg --onefile
pyinstaller vppcfg.spec --onefile
dist/vppcfg -h
```