mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-02 06:44:56 +03:00
Merge remote-tracking branch 'raghu/main' into dev
This commit is contained in:
commit
7e00121e33
@ -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):
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user