Enforce Python venv usage, install meson and ninja via venv pip #329
+45
−69
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ubuntu 24.04 ships with Python 3.12 as the default system installation, which enforces PEP 668. The present installation instructions for the project do not wholly account for this nor make it easy for non-savvy users to decide on how to resolve the
externally-managed-environment
error. The easiest way to resolve it which many users will come across is to run thepip install
command with the--break-system-packages
switch, which is ill-advised for a whole host of reasons.The correct path forward, instead, is to enforce usage of
meson
andninja
via a virtual environment, per recommendations in PEP 668. This change-set:.venv
,.venv
on the targets which buildmwrap
and$(BUILD)/build.ninja
, andmeson
andninja
in an implicitvenv activate
.As a secondary benefit to this procedure, we now have the full breadth of PyPI at our disposal, should we wish to make use of external dependencies from it in our Python-based tooling. However, this must be met with scrutiny, and we should establish clear guidelines on what dependencies will be permitted as extensions to Python's standard library.