Skip to content

Conversation

@Jrice1317
Copy link
Contributor

@Jrice1317 Jrice1317 commented Jan 13, 2026

Description

Overview

This PR adds frozen environment metadata support across all installer types, enabling users to easily protect their environments.

Changes

  • Implemented metadata schema and validation
  • Added support for shell (SH) installers
  • Added support for macOS package (PKG) installers
  • Added support for Windows executable (EXE) installers
  • Extended integration test coverage across all installer types
  • Updated documentation and examples

Related Links

https://conda.org/learn/ceps/cep-0022/

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@github-project-automation github-project-automation bot moved this to 🆕 New in 🔎 Review Jan 13, 2026
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Jan 13, 2026
@Jrice1317 Jrice1317 changed the title Metadata Provide metadata to easily protect environments Jan 13, 2026
- 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
@Jrice1317 Jrice1317 marked this pull request as ready for review January 14, 2026 14:19
@Jrice1317 Jrice1317 requested a review from a team as a code owner January 14, 2026 14:19
}
],
"default": null,
"description": "Same as `freeze_base`, but for this conda environment.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"but for this conda environment", does this mean the same thing as "for the currently activated conda environment"?

Copy link
Contributor

@lrandersson lrandersson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!



# Validate frozen environments
def validate_frozen_envs(info, exe_type, exe_version) -> bool:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we annotate the types for info, exe_type, exe_version?

- Conda-standalone version if frozen environments exist
"""

def get_frozen_env(path) -> str | None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)


# Collect environments using freeze_base/freeze_env
frozen_envs = set()
if info.get("freeze_base", {}).get("conda") is not None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any risk here that info.get("freeze_base", {}).get("conda") evaluates to an empty string and results in follow-up errors?

Comment on lines +165 to +168
sys.exit(
"Error: conda-standalone 25.5.x has known issues with frozen environments. "
"Please use conda-standalone 25.7.0 or newer."
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a sys.exit call instead of an exception?

fh.write("\n".join(builder))


def write_frozen(freeze_info, dst_dir):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any type annotations needed?

Comment on lines +176 to +177
if os.path.exists(join(tmp_dir, "conda-meta", "frozen")):
post_t.add(join(tmp_dir, "conda-meta", "frozen"), "conda-meta/frozen")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering this PR is in draft 1063 I'd suggest we also use pathlib here if possible (same for below).

@@ -0,0 +1,19 @@
### Enhancements

* Add support for installing [protected conda environments](https://conda.org/learn/ceps/cep-0022#specification). (#1149)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Add support for installing [protected conda environments](https://conda.org/learn/ceps/cep-0022#specification). (#1149)
* Add support for installing [protected (frozen) conda environments](https://conda.org/learn/ceps/cep-0022#specification). (#1149)

Perhaps it would be good to expose wording frozen that we use for the feature. Feel free to ignore this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed [bot] added once the contributor has signed the CLA

Projects

Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

3 participants