Size estimate updates using construct.yaml options - #1331
Conversation
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.
|
We require contributors to sign our Contributor License Agreement and we don't have one on file for @amaloney. In order for us to review and merge your code, please e-sign the Contributor License Agreement PDF. We then need to manually verify your signature, merge the PR (conda/infrastructure#1435), and ping the bot to refresh the PR. |
marcoesters
left a comment
There was a problem hiding this comment.
Thanks! This is an interesting problem and your code is a good start. I don't think we should take keep_pkgs into account though and the estimate is going to get complicated when extra environments are involved.
| # - `keep_pkgs: true` + `always_copy: false` = tarballs + extracted | ||
| # - `keep_pkgs: false` = extracted only | ||
| # `keep_pkgs: true` | ||
| if info.get("keep_pkgs", False): |
There was a problem hiding this comment.
I think we need to keep the archives in the size calculation no matter what the value of keep_pkgs is 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.
| 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 |
There was a problem hiding this comment.
This is correct for an installer that only has a base environment, but not for installers with multiple environments.
There was a problem hiding this comment.
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
Co-authored-by: Marco Esters <mesters@anaconda.com>
|
@conda-bot check |
Description
This commit modifies
constructor/winexe.pybased on the following options found inconstruct.yamlThese sets of options within
construct.yamlcreates 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.Resolves: #1330
Checklist - did you ...
newsdirectory (using the template) for the next release's release notes?Add / update necessary tests?Add / update outdated documentation?