AcademySoftwareFoundation / OpenImageIO

Reading, writing, and processing images in a wide variety of file formats, using a format-agnostic API, aimed at VFX applications.
https://openimageio.readthedocs.org
Apache License 2.0
1.98k stars 597 forks source link

Ensure that the tests find the built python module vs an install #4411

Open kdt3rd opened 2 months ago

kdt3rd commented 2 months ago

This may have a slightly messy un-intended consequence of "snap-shotting" pythonpath when configured in a large python env, but eases testing confusion on systems where pythonpath is not yet set, but an (older) copy of OpenImageIO is installed.

This fixes the python tests on my home machine.

Checklist:

linux-foundation-easycla[bot] commented 2 months ago

CLA Signed

The committers listed above are authorized under a signed CLA.

kdt3rd commented 2 months ago

With the latest commit, I can cleanly run the test target from the build folder (assuming I have previously downloaded the test images) without running an install, which eases the development workflow. I do not have a windows machine to test with, but windows (and ninja multiconfig) have multiple configs, so to avoid potential slicing, put the python modules in the appropriate config path - and copied the init.py in there such that it might work to load the dlls under windows (untested). Given that the CI runs the tests using the installed dist tree, I have disabled overriding the env variables in this scenario