-
Notifications
You must be signed in to change notification settings - Fork 175
Move pkgs/env.txt lockfile to conda-meta/initial-state.explicit.txt to preserve it
#1059
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
Conversation
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works too. I wanted to start with the smallest diff possible.
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.
Changed. Let's see if I got it right :P
Co-authored-by: Marco Esters <[email protected]>
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's see: fe1e040
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 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?