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

Function approx_size_kb

constructor/utils.py:292–305  ·  view source on GitHub ↗
(info, which="pkgs")

Source from the content-addressed store, hash-verified

290
291
292def approx_size_kb(info, which="pkgs"):
293 valid = ("pkgs", "tarballs", "total")
294 assert which in valid, f"'which' must be one of {valid}"
295 size_pkgs = info.get("_approx_pkgs_size", 0)
296 size_tarballs = info.get("_approx_tarballs_size", 0)
297 if which == "pkgs":
298 size_bytes = size_pkgs
299 elif which == "tarballs":
300 size_bytes = size_tarballs
301 else:
302 size_bytes = size_pkgs + size_tarballs
303
304 # division by 10^3 instead of 2^10 is deliberate here. gives us more room
305 return int(math.ceil(size_bytes / 1000))
306
307
308def copy_conda_exe(

Callers 4

make_nsiFunction · 0.85
get_headerFunction · 0.85
modify_xmlFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected