From 653dcf7d537bdf3273552e957007de1a4dd25ba7 Mon Sep 17 00:00:00 2001 From: Andy Maloney Date: Thu, 20 Aug 2026 12:50:12 -0500 Subject: [PATCH 1/3] Size estimate updates using construct.yaml options This commit modifies `constructor/winexe.py` based on the following options found in `construct.yaml` ```yaml keep_pkgs: true condarc: allow_softlinks: false always_copy: true ``` These sets of options within `construct.yaml` creates copies of packages because hard links are not used. Not using hard links prevents users from copy/pasting environments or packages across drives, and getting errors due to broken links. --- constructor/winexe.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/constructor/winexe.py b/constructor/winexe.py index cff693e72..04bed69b5 100644 --- a/constructor/winexe.py +++ b/constructor/winexe.py @@ -278,7 +278,21 @@ def make_nsi( variables["uninstall_with_conda_exe"] = bool(info.get("uninstall_with_conda_exe")) variables["needs_python_exe"] = info.get("_win_install_needs_python_exe", True) - approx_pkgs_size_kb = approx_size_kb(info, "pkgs") + # - `keep_pkgs: true` + `always_copy: true` = tarballs + 2 * extracted + # - `keep_pkgs: true` + `always_copy: false` = tarballs + extracted + # - `keep_pkgs: false` = extracted only + # `keep_pkgs: true` + if info.get("keep_pkgs", False): + # tarballs in pkgs/ + size_tarballs = info.get("_approx_tarballs_size", 0) + # extracted tarballs in pkgs// + size_extracted = info.get("_approx_pkgs_size", 0) + # `always_copy: true` in condarc means installed files are copies, not hard links + if info.get("condarc", {}).get("always_copy", False): + size_extracted = 2 * size_extracted + approx_pkgs_size_kb = int((size_tarballs + size_extracted) / 1000) + else: + approx_pkgs_size_kb = approx_size_kb(info, "pkgs") # UPPERCASE variables are unescaped (and unquoted) variables["CONDA_LOG_ARG"] = ( From a53d957c98488f1b55e7f0cd49d10742971f892c Mon Sep 17 00:00:00 2001 From: Andy Maloney Date: Thu, 20 Aug 2026 15:55:32 -0500 Subject: [PATCH 2/3] added the news file --- news/1330-disk-size-estimate-updates | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 news/1330-disk-size-estimate-updates diff --git a/news/1330-disk-size-estimate-updates b/news/1330-disk-size-estimate-updates new file mode 100644 index 000000000..cef5a3bb8 --- /dev/null +++ b/news/1330-disk-size-estimate-updates @@ -0,0 +1,19 @@ +### Enhancements + +* Adjusts the way that the estimated disk usage is calculated, based on more `construct.yaml` variables. + +### Bug fixes + +* + +### Deprecations + +* + +### Docs + +* + +### Other + +* From 03f4325e7007fd7f8eeadcd6679929f09c65dc11 Mon Sep 17 00:00:00 2001 From: Andy Maloney Date: Thu, 20 Aug 2026 16:56:58 -0500 Subject: [PATCH 3/3] Apply suggestion from @marcoesters Co-authored-by: Marco Esters --- news/1330-disk-size-estimate-updates | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/1330-disk-size-estimate-updates b/news/1330-disk-size-estimate-updates index cef5a3bb8..86021a691 100644 --- a/news/1330-disk-size-estimate-updates +++ b/news/1330-disk-size-estimate-updates @@ -1,6 +1,6 @@ ### Enhancements -* Adjusts the way that the estimated disk usage is calculated, based on more `construct.yaml` variables. +* Adjusts the way that the estimated disk usage is calculated, based on more `construct.yaml` variables. (#1330 via #1331) ### Bug fixes