rez environment for the test framework
encodingguidelines_env is the rez package with the Python environment for enctests: Python 3.11 and the packages in requirements.txt. FFmpeg is not included, so it can be picked per run.
The build script is a starting point. So far it has only been run on macOS (Apple silicon), and only with the PyPI install step skipped. The downloads, constraints.txt, Windows and Linux are all untested.
Files
| File | Purpose |
|---|---|
build_env.py | Builds everything on Linux, Windows or macOS |
constraints.txt | Versions of the indirect dependencies, taken from the macOS install |
encodingguidelines_env/package.py | The environment package |
Requirements
- rez, installed with its
install.py, withrezon thePATH - Python 3.11 with pip, installed system-wide (not a virtualenv, and on Windows not the Microsoft Store version)
- Network access to PyPI
- Google Chrome, for the report graphs (or run
kaleido_get_chromein the built environment) - An FFmpeg with
libvmafandzscale, pluslibdav1dorlibaomto decode AV1 - The VMAF model files (
vmaf_v0.6.1.json,vmaf_4k_v0.6.1.json)
Build
Run from the repository root. Check the steps first with --dry-run.
Windows:
py -3.11 rez\build_env.py --dry-run
py -3.11 rez\build_env.py
Linux and macOS:
python3.11 rez/build_env.py --dry-run
python3.11 rez/build_env.py
Packages go into rez’s local_packages_path; use --prefix <path> for another repository. Existing packages are reused, so the script is safe to re-run after fixing a problem.
The steps are:
rez bindtheplatform,archandospackages, if missing.- Write a
pythonpackage pointing at the interpreter running the script, if there is nopython-3.11package. On Windows it adds the interpreter’s folder to thePATH; elsewhere it symlinks the interpreter. rez pipeach line ofrequirements.txt.rez build --installthe environment package.- Resolve the environment and import every package.
Run the tests
VMAF_MODEL_DIR is set automatically if the models are in a usual Linux or macOS location. Windows has none, so set it yourself. A value you have already set is kept.
From the enctests folder, with FFmpeg on the PATH:
rez env encodingguidelines_env -- python -m testframework.main --test-config-dir ./test_configs --source-folder ./sources
If you have rez packages for FFmpeg, add one to the request (e.g. ffmpeg-8.1). See the enctests README for downloading source media and for the other options.
Windows: things to check
None of these have been tried. They come from reading the code.
- The test framework splits command lines with
shlex.split, which treats backslashes as escapes. Use forward slashes inFFMPEG_BIN,IDIFF_BINand other paths you pass in, and expect trouble with paths that contain spaces. ffprobe’s path is made by replacing everyffmpeginFFMPEG_BINwithffprobe, so a folder withffmpegin its name breaks it. LeavingFFMPEG_BINunset and putting FFmpeg on thePATHavoids this.- Check that
idiffandoiiotool, installed by the OpenImageIO wheel, run inside the environment. -
Check that the generated
pythonpackage starts the right interpreter:rez env encodingguidelines_env -- python -c "import sys; print(sys.executable, sys.version)"
For an agent setting up a new machine
- Work through Requirements, run
--dry-run, then build. Report what is missing instead of installing system software without asking. - If a step fails, fix
build_env.pyorpackage.pyrather than editing installed packages by hand, so the fix works on the next machine. Keep Linux and macOS working. - Keep
requirements.txtand therequireslist inpackage.pyin sync, and increase the packageversionwhenpackage.pychanges. - Once built, run one small test config (
--test-config) before the whole suite. - Commit fixes to this branch with
git commit -s, and update this README with what was tested, on which OS and versions.