-
Notifications
You must be signed in to change notification settings - Fork 204
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
feat: Show all available task with task list #1286
Conversation
He @hoxbro, It works like a charm. The change in the list mechanism is ready for me. The
If that would take some time you could also move that to a different PR. |
Can you help me and tell me which file(s) I should add the tests to?
What do you think about updating the polarify example with the following: [tasks]
postinstall = "pip install --no-build-isolation --no-deps --disable-pip-version-check -e ."
python_version = {cmd = 'python --version --version', hidden = true}
polar_version = {cmd = 'python -c "import polars; print(f\"Polars version: {polars.__version__}\")"', hidden = true}
start = {depends_on=['python_version', 'polar_version']}
# Before:
# start = 'python -c "import sys; print(f\"Python version: {sys.version}\"); import polars; print(f\"Polars version: {polars.__version__}\")"'
I have updated the model and the
This should now be done. |
I have tried to add the CLI argument in https://github.com/prefix-dev/pixi/pull/1286/commits/b89a048acdf244ddca825146e46ecb841b4cb0f7/ |
I noticed that |
Seeing this I was reminded of this issue: #934 |
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 additions!
The best way to test it in the |
For the example, what about the |
Co-authored-by: Ruben Arts <ruben@prefix.dev>
I actually like seeing the commands, even though they are hidden. I don't think adding a silent command will be too hard, but if so, I or someone else can do it in another PR. I will take a look at the |
He @hoxbro, I'm really sorry to say this, but we're talking in a voice chat about this feature and @wolfv came with another option which made the logic even simpler, and more intuitive from a user perspective and we would like to change it to that. Removing the This would reduce all the changes required to support this feature. e.g.: [tasks]
_hidden = "echo This task is not listed but can be run"
echo = {depends_on = ["_hidden"]}
|
No problem. I will take a look at it later. Do you also want then want this to be hidden from
I think this statement is a bit of a stretch, as this is a hidden feature (pun intended 😄 ) and likely will be harder to discover except by looking at the documentation. Also, make it a bit weird if you actually want to run the hidden feature. |
Yes please.
I agree that its a stretch as it is purely based on taste. However this feature not resulting in changed behavior of the actual task, which makes me like the small naming trick compared to a full option. I hope this improve the explanation for the request for change. |
src/cli/task.rs
Outdated
// Task::Execute(process) => Some(true) != process.hidden, | ||
// _ => true, | ||
// }) | ||
.filter(|&(key, _)| !key.as_str().starts_with('_')) | ||
.map(|(key, _)| key) |
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 want to use filter_map
here as this seems to be the correct thing to do. Just need some more time to get it right.
no spoilers 🙂
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'm not 100% sold on if filter_map
is better than the filter
and map
combination.
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.
Looks great! One tip to consolidate the logic into one function.
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.
Awesome, Thanks!
Co-authored-by: Ruben Arts <ruben@prefix.dev>
Resolves #1276
TODO:
Add test(s), Skipping it for nowschema/model.py
.reference/configuration.md
Maybe:
Mainly copied over functionality from other places in the code.