Replies: 2 comments 1 reply
-
|
Note that in the second case, I would have something like that in mise: [tools]
uv = "latest"
[settings]
experimental = true
[env._.python]
venv = { path = ".venv", create = true }
uv_venv_auto = "create|source"
[tasks.uv-deps]
run = "uv sync --frozen"
[tasks.ansible-galaxy]
depends = ["uv-deps"]
run = "ansible-galaxy install -f requirements.yml"
[tasks.install-pre-commit]
depends = ["uv-deps"]
run = "pre-commit install --install-hooks"
[tasks.install]
run.tasks = ["ansible-galaxy", "install-pre-commit"]
[hooks]
enter.task = "install"
[[watch_files]]
pattern = "uv.lock"
run.task = "uv-deps"
[[watch_files]]
pattern = "requirements.yml"
run.task = "ansible-galaxy"
[[watch_files]]
pattern = ".pre-commit.config.yaml"
run.task = "install-pre-commit" |
Beta Was this translation helpful? Give feedback.
-
|
Two PRs have been opened to address this:
[prepare.uv]
auto = true
[prepare.ansible-galaxy]
auto = true
depends = ["uv"]
run = "ansible-galaxy install -f requirements.yml"
sources = ["requirements.yml"]
outputs = [".galaxy-installed"]With these two changes, your direnv workflow should be replicable — prepare steps run in dependency order before task execution, and hooks can trigger tasks on enter or when watched files change. This comment was generated by Claude Code. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
In one of an internal project of my company, I am trying to drop direnv and pdm in favor of mise and uv. The goal is to have something easy to use by my coworkers and that does not mess with globally installed stuff.
One of the things I have achieved with direnv but cannot replicate with mise is ensuring that dependencies are in sync before executing tasks. The
.envrcfile looks to something like that:With the
watch_filedirectives, this scripts is automatically executed each time:I have tried to replicate this with mise and custom prepare steps but it seems they are executed in parallel without ordering. As my prepare steps have dependencies and must be run in order, this fails. I also tried with watches and hooks but the issue remain.
Any idea on how I could handle this with mise?
If we were to slightly change the way hook and prepare works, I would suggest to either :
run.taskin a first phase and then let the task engine figure the order of execution.Beta Was this translation helpful? Give feedback.
All reactions