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

Function write_repodata_record

constructor/preconda.py:280–304  ·  view source on GitHub ↗
(info: dict, dst_dir: str)

Source from the content-addressed store, hash-verified

278
279
280def write_repodata_record(info: dict, dst_dir: str):
281 all_dists = info["_dists"].copy()
282 for env_data in info.get("_extra_envs_info", {}).values():
283 all_dists += env_data["_dists"]
284 for dist in all_dists:
285 if filename_dist(dist).endswith(".conda"):
286 _dist = filename_dist(dist)[:-6]
287 elif filename_dist(dist).endswith(".tar.bz2"):
288 _dist = filename_dist(dist)[:-8]
289 record_file = join(_dist, "info", "repodata_record.json")
290 record_file_src = join(info["_download_dir"], record_file)
291
292 with open(record_file_src) as rf:
293 rr_json = json.load(rf)
294
295 rr_json["url"] = get_final_url(info, rr_json["url"])
296 rr_json["channel"] = get_final_url(info, rr_json["channel"])
297
298 if not isdir(join(dst_dir, _dist, "info")):
299 os.makedirs(join(dst_dir, _dist, "info"))
300
301 record_file_dest = join(dst_dir, record_file)
302
303 with open(record_file_dest, "w") as rf:
304 json.dump(rr_json, rf, indent=2, sort_keys=True)
305
306
307def write_initial_state_explicit_txt(info: dict, dst_dir: str, urls: tuple[str, str]):

Callers 1

write_filesFunction · 0.85

Calls 3

filename_distFunction · 0.85
get_final_urlFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected