-
Notifications
You must be signed in to change notification settings - Fork 5
setup mise #289
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
base: master
Are you sure you want to change the base?
setup mise #289
Conversation
IMO this kind of change lacks an essential introduction in the commit message(s), detailing what problem it solves and why it's the good way to solve it: see https://docs.xcp-ng.org/project/development-process/commit-message-conventions/ |
pyproject.toml
Outdated
version = "0.1.0" | ||
description = "Add your description here" | ||
readme = "README.md" | ||
requires-python = ">=3.12" |
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.
Do we already depend on python 3.12?
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.
no (not yet) I'll change that
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.
done
[tools] | ||
"npm:xo-cli" = "0.32.1" | ||
python = "3.13" | ||
uv = "0.6" |
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.
is it mise
that relies on uv
for the multiple python interpreter support?
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
use the same python binaries as uv
but it doesn't require uv
to install python.
uv
is there to deal with the python dependencies
install `mise` once with ~~sh curl https://mise.run | sh ~~ then just run ~~sh mise run test tests/misc/test_basic_without_ssh.py --hosts=gln-xcpng ~~ to install all the required dependencies, including `xo-cli`, `python`, and required python modules, and run the selected tests. If you prefer not to use `mise run`, you can tell mise to install the dependencies and then set up the shell environment to have them accessible in the shell: ~~sh mise install mise activate | source ~~ `mise` deactivates itself as soon as you leave the project directory, and reactivates when you enter a directory with a `mise` configuration, so you may even put that last command in your global shell configuration. Signed-off-by: Gaëtan Lehmann <[email protected]>
Signed-off-by: Gaëtan Lehmann <[email protected]>
Today, configuring the test environment requires several manual steps, and the same is true when updating the test dependencies.
Moreover, the developers are not all using the same Python version, which may introduce differences in the test behavior.
Finally, with some dependencies from the operating system, most notably on Python, we are forced to use the oldest version available on our test environment, and can't benefit from the newest features.
mise
helps solve most of this problem. It takes care of installing the dependencies independently of the languages they are written in. It ensures that the dependencies are at the exact same version on all the test environments that are set up. It can install a language like Python or Node at a specific version. It is easily installable as a single binary.install
mise
once withcurl https://mise.run | sh
then just run
mise run test tests/misc/test_basic_without_ssh.py --hosts=gln-xcpng
to install all the required dependencies, including
xo-cli
,python
, and required python modules, and run the selected tests.If you prefer not to use
mise run
, you can tell mise to install the dependencies and then set up the shell environment to have them accessible in the shell:mise
deactivates itself as soon as you leave the project directory, and reactivates when you enter a directory with amise
configuration, so you may even put that last command in your global shell configuration.