Skip to content
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

pixi run should prioritize calling command rather than task #850

Closed
2 tasks done
zen-xu opened this issue Feb 26, 2024 · 2 comments
Closed
2 tasks done

pixi run should prioritize calling command rather than task #850

zen-xu opened this issue Feb 26, 2024 · 2 comments
Labels
🐞 bug Something isn't working

Comments

@zen-xu
Copy link
Contributor

zen-xu commented Feb 26, 2024

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

$ pixi --version
pixi 0.14.0
[project]
name = "playground"
version = "0.1.0"
description = "Add a short description here"
authors = ["ZhengYu, Xu <zen-xu@outlook.com>"]
channels = ["conda-forge"]
platforms = ["osx-arm64"]

[tasks]
pre-commit = "pixi run -e dev pre-commit"

[dependencies]

[feature.py38.dependencies]
python = "3.8.*"

[feature.py311.dependencies]
python = "3.11.*"

[feature.dev.dependencies]
pre-commit = "*"

[environments]
default = ["py311"]
py38 = ["py38"]
py311 = ["py311"]
dev = ["dev"]
$ pixi shell
$ pixi run pre-commit
✨ Pixi task (default): pixi run -e dev pre-commit
✨ Pixi task (dev): pixi run -e dev pre-commit
✨ Pixi task (dev): pixi run -e dev pre-commit
✨ Pixi task (dev): pixi run -e dev pre-commit
✨ Pixi task (dev): pixi run -e dev pre-commit
✨ Pixi task (dev): pixi run -e dev pre-commit
✨ Pixi task (dev): pixi run -e dev pre-commit
✨ Pixi task (dev): pixi run -e dev pre-commit
✨ Pixi task (dev): pixi run -e dev pre-commit
✨ Pixi task (dev): pixi run -e dev pre-commit
✨ Pixi task (dev): pixi run -e dev pre-commit
✨ Pixi task (dev): pixi run -e dev pre-commit
✨ Pixi task (dev): pixi run -e dev pre-commit
✨ Pixi task (dev): pixi run -e dev pre-commit
✨ Pixi task (dev): pixi run -e dev pre-commit
✨ Pixi task (dev): pixi run -e dev pre-commit
✨ Pixi task (dev): pixi run -e dev pre-commit
✨ Pixi task (dev): pixi run -e dev pre-commit
...

Issue description

I installed some Python tools in the dev environment and exported these commands in tasks for use in other environments, but pixi triggers recursive calls.

Expected behavior

pixi run should prioritize calling command rather than task

@zen-xu zen-xu added the 🐞 bug Something isn't working label Feb 26, 2024
@zen-xu
Copy link
Contributor Author

zen-xu commented Feb 26, 2024

Or provide some mechanism to distinguish between commands and tasks.

[tasks]
# @<cmd> is a command rather than a task
pre-commit = "pixi run -e dev @pre-commit"

@baszalmstra
Copy link
Contributor

If you add the task the the dev environment (e.g [feature.dev.tasks]) instead of to the default environment and just call pre-commit without recursion then I think this will work as you expected.

@zen-xu zen-xu closed this as completed Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants