Commit Graph

4 Commits

Author SHA1 Message Date
Maíra Canal
eecf94cc8e bin: explicitly use python3 instead of python
The `python` command's default behaviour can vary between OSes and even
different versions of the same OS. On some systems, `python` might still
point to Python 2 for backward compatibility, while on others, it might
point to Python 3.

As Mesa already requires "Python 3.6 or newer", use `python3` explicitly
to ensure that the script is using a Python 3 interpreter.

Moreover, this commit allows this script to run on macOS, as macOS doesn't
have a `python` symlink or alias by default. Therefore, currently, when
running this script in macOS, you get a "python: command not found" error.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35918>
2025-07-03 20:52:48 +00:00
Eric Engestrom
f548d84a35 bin/python-venv: fix venv folder check
My last refactor before merging !26354 was incorrect and broke the
script when use for the first time (or after deleting the venv folder).

Fixes: 69ec13b303 ("bin/python-venv: detect python version change")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26453>
2023-12-02 11:48:35 +00:00
Eric Engestrom
69ec13b303 bin/python-venv: detect python version change
The venv only works for a specific python version; when updating python,
the venv needs to be regenerated.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26354>
2023-11-30 08:39:17 +00:00
Eric Engestrom
75f44bd79a bin: add wrapper to run scripts in a python venv
This isolates the script environment from the rest of the machine,
avoiding missing/incompatible dependencies and avoiding polluting the
rest of the machine with python packages.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24367>
2023-08-03 23:21:31 +00:00