Add 'system python' validation for some py scripts.

The goal of this test is to try to import some critical py scripts with the
system python of the building machine.
The main target is to ensure that these py scripts remain usable by all
buildbot machines, as some of them are using fairly outdated python
versions.

Current status:
* Scripts in `build_files` and `docs` are checked.
* Some python scripts in `build_files` were 'reverted' to be compatible
  with older required python version currently (3.6).
* A few scripts are excluded from the test, mostly because they use Blender's
  `bpy` module, which means they are only intended to be ran with Blender's
  python anyway.
* The test is only enabled for Linux buildbots currently, as they use the
  oldest Python by far.

Notes:
* Some more scripts are likely to be moved around in the future.
* Whether these tests need to be enabled on windows or macos platforms remains
  an open question.

Pull Request: https://projects.blender.org/blender/blender/pulls/130746
This commit is contained in:
Bastien Montagne
2024-12-24 11:55:29 +01:00
committed by Bastien Montagne
parent 2040b8e864
commit 2c9ab53273
10 changed files with 252 additions and 45 deletions

View File

@@ -20,6 +20,7 @@ import time
from typing import (
TextIO,
Dict,
)
@@ -31,7 +32,7 @@ def man_format(data: str) -> str:
return data
def blender_extract_info(blender_bin: str) -> dict[str, str]:
def blender_extract_info(blender_bin: str) -> Dict[str, str]:
blender_env = {
"ASAN_OPTIONS": (
os.environ.get("ASAN_OPTIONS", "") +