Provide metadata to easily protect environments#1149
Merged
marcoesters merged 15 commits intoconda:mainfrom Jan 26, 2026
Merged
Provide metadata to easily protect environments#1149marcoesters merged 15 commits intoconda:mainfrom
marcoesters merged 15 commits intoconda:mainfrom
Conversation
- Add version check for frozen environments - Implement comprehensive testing for base and extra environments - Handle different datatypes for frozen file specifications - Add helper functions for version range validation
- Refine schema design for freeze_base and freeze_env - Add validation models to catch configuration errors early - Update examples and documentation - Separate base environment vs extra_env freezing logic
lrandersson
reviewed
Jan 16, 2026
lrandersson
reviewed
Jan 16, 2026
constructor/main.py
Outdated
| - Conda-standalone version if frozen environments exist | ||
| """ | ||
|
|
||
| def get_frozen_env(path) -> str | None: |
Contributor
There was a problem hiding this comment.
Suggested change
| def get_frozen_env(path) -> str | None: | |
| def get_frozen_env(path: str) -> str | None: |
(I'm assuming it's of type str so feel free to ignore)
constructor/preconda.py
Outdated
| fh.write("\n".join(builder)) | ||
|
|
||
|
|
||
| def write_frozen(freeze_info, dst_dir): |
Contributor
There was a problem hiding this comment.
Any type annotations needed?
Co-authored-by: Robin <34315751+lrandersson@users.noreply.github.com>
lrandersson
approved these changes
Jan 22, 2026
marcoesters
reviewed
Jan 23, 2026
constructor/preconda.py
Outdated
|
|
||
|
|
||
| def write_index_cache(info, dst_dir, used_packages): | ||
| def write_index_cache(info: dict, dst_dir: str, used_packages): |
Contributor
There was a problem hiding this comment.
Suggested change
| def write_index_cache(info: dict, dst_dir: str, used_packages): | |
| def write_index_cache(info: dict, dst_dir: str, used_packages: list[str]): |
I think?
Contributor
Author
There was a problem hiding this comment.
I wasn't sure myself, which is why I left it hoping someone else would. 😅
constructor/preconda.py
Outdated
|
|
||
|
|
||
| def write_conda_meta(info, dst_dir, final_urls_md5s, user_requested_specs=None): | ||
| def write_conda_meta(info: dict, dst_dir: str, final_urls_md5s: tuple, user_requested_specs=None): |
Contributor
There was a problem hiding this comment.
Suggested change
| def write_conda_meta(info: dict, dst_dir: str, final_urls_md5s: tuple, user_requested_specs=None): | |
| def write_conda_meta(info: dict, dst_dir: str, final_urls_md5s: tuple[str, str], user_requested_specs: list[str] | None = None): |
constructor/preconda.py
Outdated
|
|
||
|
|
||
| def write_initial_state_explicit_txt(info, dst_dir, urls): | ||
| def write_initial_state_explicit_txt(info: dict, dst_dir: str, urls: tuple): |
Contributor
There was a problem hiding this comment.
Just like with the md5 example above, you may want to add the types of the elements in the tuple
Also added suggested type annotations for preconda.py Co-authored-by: Marco Esters <mesters@anaconda.com>
marcoesters
approved these changes
Jan 26, 2026
This file contains hidden or 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
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.
Description
Overview
This PR adds frozen environment metadata support across all installer types, enabling users to easily protect their environments.
Changes
Related Links
https://conda.org/learn/ceps/cep-0022/
Checklist - did you ...
newsdirectory (using the template) for the next release's release notes?