-
Notifications
You must be signed in to change notification settings - Fork 176
Provide metadata to easily protect environments #1149
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
base: main
Are you sure you want to change the base?
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
left a comment
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.
Nice work!
constructor/main.py
Outdated
| - Conda-standalone version if frozen environments exist | ||
| """ | ||
|
|
||
| def get_frozen_env(path) -> str | None: |
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.
| 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): |
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.
Any type annotations needed?
Co-authored-by: Robin <34315751+lrandersson@users.noreply.github.com>
constructor/preconda.py
Outdated
|
|
||
|
|
||
| def write_index_cache(info, dst_dir, used_packages): | ||
| def write_index_cache(info: dict, dst_dir: str, used_packages): |
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.
| 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?
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 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): |
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.
| 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): |
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.
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>
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?