Skip to content

Refactor to add conda-standalone hash and remove flat keys in info.json - #1329

Merged
marcoesters merged 13 commits into
conda:mainfrom
Jrice1317:condastandalone-hash
Aug 21, 2026
Merged

Refactor to add conda-standalone hash and remove flat keys in info.json#1329
marcoesters merged 13 commits into
conda:mainfrom
Jrice1317:condastandalone-hash

Conversation

@Jrice1317

Copy link
Copy Markdown
Contributor

Description

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 Aug 19, 2026
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Aug 19, 2026

@marcoesters marcoesters left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! There are two items missing:

  1. A news file.
  2. The _conda_exe_payloads* keys in shar.py are still flat.

Comment thread constructor/main.py Outdated
info["_conda_exe_version"] = exe_version
info["_conda_exe"]["type"] = exe_type
info["_conda_exe"]["version"] = exe_version
info["_conda_exe"]["SHA256"] = (hash_files([Path(exe_path)], "sha256")["sha256"],)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
info["_conda_exe"]["SHA256"] = (hash_files([Path(exe_path)], "sha256")["sha256"],)
info["_conda_exe"]["sha256"] = (hash_files([Path(exe_path)], "sha256")["sha256"],)

We should probably stay consistent with the notation in constructor. The hash also just needs to be calculated if info.json is used as an output since we're not verifying the hash anywhere else.

And why is this a tuple instead of a string?

Comment thread tests/test_examples.py Outdated
# Test that info.json contains serialized objects
info_json = json.loads((root_path / "info.json").read_text())
assert isinstance(info_json.get("_conda_exe_version"), str)
assert isinstance(info_json.get("_conda_exe").get("version"), str)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should also check that the hash and the path are non-empty strings.

@Jrice1317
Jrice1317 requested a review from marcoesters August 21, 2026 10:49
@Jrice1317
Jrice1317 force-pushed the condastandalone-hash branch from fc9c7eb to 1539025 Compare August 21, 2026 19:15
@Jrice1317
Jrice1317 marked this pull request as ready for review August 21, 2026 21:49
@Jrice1317
Jrice1317 requested a review from a team as a code owner August 21, 2026 21:49
@Jrice1317

Copy link
Copy Markdown
Contributor Author

@marcoesters My slack is not working atm, but this is ready for review. TIA!

@marcoesters marcoesters left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The current hashes are stored in a dictionary, which makes the output look like:

{
  "_conda_exe": {
    "sha256": {
      "sha256": "71f39e1dba13d5ea14a63b835467f19d9873791a7bb5ab6151425d367b74e0d8"
    },
  }
}

I made suggestions that should fix this.

Comment thread tests/test_examples.py Outdated
Comment thread constructor/main.py Outdated
Co-authored-by: Marco Esters <mesters@anaconda.com>
@github-project-automation github-project-automation Bot moved this from 🆕 New to ✅ Approved in 🔎 Review Aug 21, 2026
@marcoesters
marcoesters merged commit 308168f into conda:main Aug 21, 2026
39 checks passed
@github-project-automation github-project-automation Bot moved this from ✅ Approved to 🏁 Done in 🔎 Review Aug 21, 2026
@Jrice1317
Jrice1317 deleted the condastandalone-hash branch August 21, 2026 23:09
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: 🏁 Done

Development

Successfully merging this pull request may close these issues.

3 participants