MCPcopy Create free account
hub / github.com/conda/constructor / verify

Function verify

constructor/construct.py:161–179  ·  view source on GitHub ↗
(info)

Source from the content-addressed store, hash-verified

159
160
161def verify(info):
162 schema = json.loads(SCHEMA_PATH.read_text())
163 validator = get_validator_class()(schema)
164 errors = []
165 for error_or_warning in validator.iter_errors(info):
166 if isinstance(error_or_warning, DeprecatedFieldWarning):
167 print("Warning:", error_or_warning, file=sys.stderr)
168 else:
169 errors.append(error_or_warning)
170 if errors:
171 msg = ["Configuration has validation errors:"]
172 for error in errors:
173 msg.append(f"- {error}")
174 sys.exit("\n".join(msg))
175
176 if signtool := info.get("windows_signing_tool"):
177 need_cert_file = ["signtool", "signtool.exe"]
178 if signtool in need_cert_file and not info.get("signing_certificate"):
179 sys.exit(f"The signing tool '{signtool}' requires 'signing_certificate' to be set.")

Callers

nothing calls this directly

Calls 3

get_validator_classFunction · 0.85
getMethod · 0.80
read_textMethod · 0.45

Tested by

no test coverage detected