Repository navigation
Size estimate updates using construct.yaml options #1331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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/<name>/ | ||
| 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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is correct for an installer that only has a
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. understood, let me think harder about it. I can see that this logic worked for my current use-case, but there are others that I have not thought about |
||
| 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"] = ( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| ### Enhancements | ||
|
|
||
| * Adjusts the way that the estimated disk usage is calculated, based on more `construct.yaml` variables. (#1330 via #1331) | ||
|
|
||
| ### Bug fixes | ||
|
|
||
| * <news item> | ||
|
|
||
| ### Deprecations | ||
|
|
||
| * <news item> | ||
|
|
||
| ### Docs | ||
|
|
||
| * <news item> | ||
|
|
||
| ### Other | ||
|
|
||
| * <news item> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to keep the archives in the size calculation no matter what the value of
keep_pkgsis since these files are removed after package installation.The purpose of the file size calculation is not just to inform the user, but to prevent running out of disk space. So, the value should be the amount of disk space the installer needs for the installation, not what's left in the end.