119 parser = argparse.ArgumentParser(description=__doc__,
120 formatter_class=argparse.RawDescriptionHelpFormatter)
121 parser.add_argument(
"--tag", required=
True, help=
"the release tag to build")
122 parser.add_argument(
"--commit", help=
"the commit the tag points at (resolved locally if omitted)")
123 parser.add_argument(
"-o",
"--output", help=
"write here instead of stdout")
124 args = parser.parse_args()
128 manifest = json.loads(NIGHTLY_MANIFEST.read_text(encoding=
"utf-8"),
129 object_pairs_hook=OrderedDict)
133 for module
in manifest[
"modules"]:
134 if not isinstance(module, dict)
or module.get(
"name") !=
"ansel":
137 module[
"sources"] = [OrderedDict([
145 module[
"config-opts"] += [
146 "-DFETCH_LENS_DB=OFF",
147 f
"-DLENS_DB_DIR={BUILD_ROOT}/{LENS_DEST}",
148 "-DFETCH_NN_MODELS=OFF",
149 f
"-DNN_MODELS_DIR={BUILD_ROOT}/{MODELS_DEST}",
152 build_options = module.get(
"build-options", {})
153 build_options.pop(
"build-args",
None)
155 module[
"build-options"] = build_options
157 module.pop(
"build-options",
None)
160 sys.exit(
"no module named 'ansel' in the nightly manifest")
162 text = json.dumps(manifest, indent=4, ensure_ascii=
False) +
"\n"
164 Path(args.output).write_text(text, encoding=
"utf-8")
165 print(f
"wrote {args.output}: {args.tag} at {commit[:12]}, "
166 f
"lens database v{schema}, {len(sources)} payload sources", file=sys.stderr)
168 sys.stdout.write(text)