-
Notifications
You must be signed in to change notification settings - Fork 352
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
docs: extend python cookbook #3738
base: main
Are you sure you want to change the base?
Conversation
I did not get passing args via |
|
||
### Configuration files | ||
|
||
Recommended configuration |
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 certainly don't "recommend" this
|
||
Recommended configuration | ||
|
||
```tomo [~/.config/mise/config.toml] |
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.
typo
|
||
# This auto-updates tools and plugins | ||
[hooks] | ||
enter = "mise i -q && mise plugins update" |
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.
doesn't seem like this should go into the python cookbook
#MISE dir="{{cwd}}" | ||
|
||
# does not work with args | ||
#XXMISEXX depends=["preset:python"] |
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.
this would need to be resolved first
mise config set hooks.enter 'if [ -e tests/requirements.txt ] ; then extra_file="tests/requirements.txt" ; fi ; uv pip sync requirements.txt $extra_file' | ||
|
||
# this is more or less redundant after the above config, but if you want to run it manually you still can | ||
mise config set tasks.install_deps.description "Install dependencies" |
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.
mise task add
is a better way to do this
|
||
```sh | ||
# for every project | ||
mise tasks run -vvv preset:python 3.13 |
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.
why -vvv?
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.
Missed that, thx
@@ -44,3 +44,171 @@ echo "Project: $PROJECT_NAME" | |||
echo "Virtual Environment: $VIRTUAL_ENV" | |||
''' | |||
``` | |||
|
|||
## Using tasks to create mise.toml for individual projects |
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.
Maybe some of this content should go to https://mise.jdx.dev/mise-cookbook/presets.html, it also describes something similar. We can probably link it from the python cookbook page.
Or we can call this section python preset
and add a reference to the preset page
|
||
# install latest versions from {tests/,}requirements.txt when entering the project directory and when the requirements.txts change | ||
#mise config set hooks.enter "uv pip install -r pyproject.toml --all-extras" | ||
mise config set hooks.enter "uv pip sync pyproject.toml" |
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.
uv pip sync
uses uv as a pip replacement, it's not intended for uv-managed projects.
Did you mean to use uv sync
?
No description provided.