Repository navigation
feat(manifest): add description field for environments - #7162
Open
harshitsaini17 wants to merge 1 commit into
Open
harshitsaini17 wants to merge 1 commit into
harshitsaini17 wants to merge 1 commit into
Conversation
Environments can now carry an optional `description`, shown by `pixi info` (text and JSON). Updates the JSON schema and docs. Fixes prefix-dev#7105
description field for environments
This branch has not been deployed
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
Adds an optional
descriptionfield to environments, as requested in #7105, so the purpose of an environment can live in the manifest instead of a comment:pixi infonow shows it (only for environments that have one):and
pixi info --jsonincludes"description"on the environment, omitted when unset.Changes:
pixi_manifest: parsedescriptiononTomlEnvironmentand store it onEnvironment(list formenv = ["feat"]→None). Manifest mutations that rebuild environments (add/remove feature, etc.) keep the existing description.pixi_core:Environment::description()accessor.pixi_cli: show it inpixi infotext and JSON output.descriptionadded toEnvironmentinschema/model.py;schema.jsonand thepyprojectschemas regenerated withpython model.py.[environments]reference with an example.Fixes #7105
How Has This Been Tested?
pixi_manifest: description parsed, absent →None, wrong type (description = 42) →expected a string, found integer, and a full-manifest test covering both the table and list forms.'description'among the accepted keys.cargo test -p pixi_manifest -p pixi-build-rust --lib(670 passed),cargo test -p pixi_core --lib(339 passed),cargo test -p pixi_cli --lib(221 passed).cargo clippy -p pixi_manifest -p pixi_core -p pixi_cli --all-targets --no-deps -- -D warningsandcargo fmt --all -- --check: clean.python model.py+pytestinschema/(102 passed, 1 skipped).pixi info/pixi info --jsonon a manifest with described, undescribed and list-form environments;pixi workspace environment addkeeps the other environment's description;description = 42is rejected bypixi task list.Note:
pixi_manifestmust be tested together with a crate that enables minijinja'sjsonfeature (e.g.pixi-build-rust, as the workspace test run does); testing it alone makes the existingtojson_stays_jsontest fail onmaintoo. That is unrelated to this PR.AI Disclosure
Checklist:
schema/model.py.