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

Watch pyproject.toml and run uv sync on changes #27

Open
rsyring opened this issue Feb 14, 2025 · 1 comment
Open

Watch pyproject.toml and run uv sync on changes #27

rsyring opened this issue Feb 14, 2025 · 1 comment

Comments

@rsyring
Copy link
Member

rsyring commented Feb 14, 2025

https://mise.jdx.dev/hooks.html#watch-files-hook

@rsyring
Copy link
Member Author

rsyring commented Feb 18, 2025

A watch files hook looks like:

# mise.toml
[[watch_files]]
patterns = ['pyproject.toml']
run = 'uv sync'

It works but only the next time a mise command is ran or, in the case of shell activation, when the shell prompt loads again. Which, in my case, happened after running a different command with the output being mixed together:

 ❯ mise use -g ubi:tamasfe:taplo
mise ERROR HTTP status client error (404 Not Found) for url (https://api.github.com/repos/tamasfe:taplo/releases)
mise ERROR Run with --verbose or MISE_VERBOSE=1 for more information
warning: No `requires-python` value found in the workspace. Defaulting to `>=3.12`.
Resolved 5 packages in 969ms
      Built copier-py-package @ file:///home/rsyring/projects/copier-py-package
Prepared 3 packages in 255ms
Uninstalled 1 package in 0.68ms
Installed 3 packages in 2ms
 + blazeutils==0.7.0
 ~ copier-py-package==1.20241017.2 (from file:///home/rsyring/projects/copier-py-package)
 + wrapt==1.17.2

In the above output, the mise ERROR lines are from the command and everything else is from the uv sync. I don't like this approach and, if something like this is desired, we should look at something that runs in the background and whose output is not mixed with shell commands. Maybe supervisord (#10) or similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant