Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Correctly display unrequested environments on
task list
(prefi…
…x-dev#2402) Description **Issue**: - explicitly requesting tasks for a specific environment with the `--environment` flag, along with the `--summary (-s)` flag, would also display tasks available in other environments. <details> <summary> before fix: </summary> current `pixi task ls --summary` ![image](https://github.com/user-attachments/assets/a7fc008f-6d85-46c6-a3b6-434941c5ba38) ![image](https://github.com/user-attachments/assets/c8b20ad8-5515-426c-a683-4e0e89f4f22e) </details> **Fix**: - A new `env_task_map` was introduced, which either maps the explicitly requested environment (if specified) or iterates over all environments, filtering based on platform compatibility. - Removed the `get_tasks_per_env` function, but could extract the new logic back out into it - Tried to prevent iterating over `projects.environments()` again <details> <summary> after fix: </summary> regular `task ls --summary` still works: ![image](https://github.com/user-attachments/assets/7e1c3402-328b-4606-b1d4-89a638d5f98c) ![image](https://github.com/user-attachments/assets/8c3df61f-84a9-4877-ae5c-c2994e91cc15) `pixi task ls` with no args unaffected: ![image](https://github.com/user-attachments/assets/744fbb34-5a05-4bc2-b22d-b630eb0a91ac) </details>
- Loading branch information