Merge remote-tracking branch 'raghu/main' into dev

This commit is contained in:
DavHau 2021-10-13 22:52:25 +07:00
commit 7e00121e33
6 changed files with 14 additions and 1 deletions

View File

@ -1,4 +1,5 @@
import json
from jsonschema import validate
import os
import re
import subprocess as sp
@ -331,6 +332,7 @@ class PackageCommand(Command):
lock['generic']['sourcesCombinedHash'] = hash
# re-write dream.lock
checkLockJSON(order_dict(lock))
with open(outputDreamLock, 'w') as f:
json.dump(order_dict(lock), f, indent=2)
@ -349,6 +351,17 @@ class PackageCommand(Command):
print(f"Created {output}/dream.lock")
def checkLockJSON(lock):
try:
lock_schema_raw=open(dream2nix_src+"/specifications/dream-lock-schema.json").read()
lock_schema=json.loads(lock_schema_raw)
except Exception as e:
print(e)
try:
validate(lock,schema=lock_schema)
except Exception as e1:
print(e1)
def callNixFunction(function_path, **kwargs):

View File

@ -16,7 +16,7 @@ let
b = builtins;
cliPython = python3.withPackages (ps: [ ps.networkx ps.cleo ]);
cliPython = python3.withPackages (ps: [ ps.networkx ps.cleo ps.jsonschema ]);
in
{