Skip to content

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

setup mise #289

wants to merge 2 commits into from

Conversation

glehmann
Copy link
Contributor

@glehmann glehmann commented Mar 27, 2025

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 with

curl 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 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.

@glehmann glehmann mentioned this pull request Mar 27, 2025
@stormi
Copy link
Member

stormi commented Mar 27, 2025

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"
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

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"
Copy link
Contributor

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?

Copy link
Contributor Author

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

glehmann added 2 commits April 5, 2025 23:13
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]>
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

Successfully merging this pull request may close these issues.

3 participants