-
Notifications
You must be signed in to change notification settings - Fork 11
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
[feat] initialize from an existing environment #162
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #162 +/- ##
==========================================
+ Coverage 97.89% 98.23% +0.33%
==========================================
Files 9 9
Lines 996 1074 +78
==========================================
+ Hits 975 1055 +80
+ Misses 21 19 -2 ☔ View full report in Codecov by Sentry. |
* no need for temporary lockfile * add timestamp to lockfile output * only re-lock platforms when the hash changes (or forced)
jjhelmus
approved these changes
Apr 26, 2024
LGTM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this PR
conda-project init --from-environment <name or prefix>
conda-project install
only re-lock if the current platform needs to be re-lockedUsing the
--from-environment <name or prefix path>
flag theenvironment.yml
andconda-lock.<env-name>yml
files will be generated from an existing conda environment.The
conda-lock.<env-name>.yml
for the current platform is constructed by performing a fullconda env export
so that the environment is captured as-is into the lockfile. Only packages for the current platform are written in to the lock. When someone attempts to install on another platform conda-project will automatically lock the missing platforms, but not modify the original platform, unless the environment.yml file was changed.The environment.yml captures the requested conda and pip packages as follows. You'll see that conda packages are prefixed with its channel and the full version is captured in the spec even if a specific version was not originally requested. This helps keep the environment close to the original if the original platform is re-locked and when other platforms are locked.
You'll see that all four major platforms are listed in the environment.yml, but a full cross-platform solve is not attempted by default. The user could do
conda project init --from-environment <env-or-path> --lock
, which will capture the current platform according to the above procedure and then lock the remaining platforms.