Move pkgs/env.txt lockfile to conda-meta/initial-state.explicit.txt to preserve it#1059
Move pkgs/env.txt lockfile to conda-meta/initial-state.explicit.txt to preserve it#1059jaimergp merged 20 commits intoconda:mainfrom
pkgs/env.txt lockfile to conda-meta/initial-state.explicit.txt to preserve it#1059Conversation
env.txt lockfile in conda-metainitial-state.lockfile.txt lockfile to conda-meta/
constructor/nsis/main.nsi.tmpl
Outdated
| SetOutPath "{{ env.conda_meta }}" | ||
| File "{{ env.history_abspath }}" | ||
| # We also place a copy of the env.txt file here, as a lockfile | ||
| File /oname=initial-state.lockfile.txt "{{ env.env_txt_abspath }}" |
There was a problem hiding this comment.
Instead of renaming the env.txt file during the installation, why don't we just package env.txt as conda-meta/initial-state.lockfile.txt and use that file for the --file argument?
There was a problem hiding this comment.
That works too. I wanted to start with the smallest diff possible.
There was a problem hiding this comment.
Changed. Let's see if I got it right :P
Co-authored-by: Marco Esters <mesters@anaconda.com>
initial-state.lockfile.txt lockfile to conda-meta/initial-state.explicit.txt lockfile to conda-meta/
constructor/osxpkg.py
Outdated
| # We need to move the initial-state.explicit.txt files from pkgs/ to their conda-meta targets | ||
| shutil.move(join(pkgs_dir, "initial-state.explicit.txt"), conda_meta) | ||
| if isdir(join(pkgs_dir, "envs")): | ||
| for envname in os.listdir(join(pkgs_dir, "envs")): | ||
| lockfile = join(pkgs_dir, "envs", envname, "initial-state.explicit.txt") | ||
| env_conda_meta = join(prefix, "envs", envname, "conda-meta") | ||
| os.makedirs(env_conda_meta) | ||
| shutil.move(lockfile, env_conda_meta) |
There was a problem hiding this comment.
Not super proud of this block, but the alternative is refactoring the logic in preconda so it's multi-directory (and not just assume that everything goes in dst_dir == "pkgs/").
What do you think @marcoesters? Worth the refactor or not? There'll still be differences between Unix and Windows.
There was a problem hiding this comment.
I'm not sure if it's much of a refactor. Since write_files writes very specific files with very specific file locations, you could pass in prefix and adjust the paths inside the function accordingly. This would make the SH code a little simpler, too.
There was a problem hiding this comment.
I think this looks pretty clean and extendable. The directory creation can probably be further abstracted by using Path().parent.mkdir(parents=True, exist_ok=True), but that's probably better suited for #1063.
initial-state.explicit.txt lockfile to conda-meta/pkgs/env.txt lockfile to conda-meta/initial-state.explicit.txt to preserve it
Description
Closes #1052
Checklist - did you ...
newsdirectory (using the template) for the next release's release notes?