Skip to content

build: Add a python script to test imports during the build#1057

Open
cedrik-fuoco-adsk wants to merge 21 commits intoAcademySoftwareFoundation:mainfrom
cedrik-fuoco-adsk:add-python-test-import
Open

build: Add a python script to test imports during the build#1057
cedrik-fuoco-adsk wants to merge 21 commits intoAcademySoftwareFoundation:mainfrom
cedrik-fuoco-adsk:add-python-test-import

Conversation

@cedrik-fuoco-adsk
Copy link
Copy Markdown
Contributor

@cedrik-fuoco-adsk cedrik-fuoco-adsk commented Jan 12, 2026

Add a python script to test imports during the build

Linked issues

n/a

Summarize your change.

Add build-time validation of Python package imports and clarify Python test purposes.

Describe the reason for the change.

When there are issues with package imports (ABI incompatibilities, missing dependencies, etc.), we often find them out at runtime. This change adds test_python_imports.py to detect import failures during the build.

Additionally, renamed test_python.py to test_python_distribution.py to better distinguish between:

  • Import testing (validates pip-installed packages)
  • Distribution testing (validates relocatability and environment setup)

Describe what you have tested and on which operating system.

MacOS

Add a list of changes, and note any that might need special attention during the review.

If possible, provide screenshots.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Copy link
Copy Markdown
Contributor

@rogernelson rogernelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thank you!

Copy link
Copy Markdown
Contributor

@bernie-laberge bernie-laberge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent initiative !
Thanks!

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
cedrik-fuoco-adsk and others added 4 commits January 12, 2026 14:30
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
@cedrik-fuoco-adsk
Copy link
Copy Markdown
Contributor Author

cedrik-fuoco-adsk commented Jan 14, 2026

Address the PR comments, but I am stil having issues with OTIO and Windows in debug.

The first issue was avec the debug postfix of OTIO. OTIO uses "d" but python expects "_d". (See AcademySoftwareFoundation/OpenTimelineIO#1173). For now, I fixed (I think) that by manually renaming the files in the python script.

But now I'm having this issue:
error : ImportError: DLL load failed while importing _otio: A dynamic link library (DLL) initialization routine failed.

         Added to PATH for DLL loading: D:\a\OpenRV\OpenRV\_build\RV_DEPS_PYTHON3\install\bin, D:\a\OpenRV\OpenRV\_build\RV_DEPS_PYTHON3\install\DLLs
         ================================================================================
         Testing Python package imports at build time
         Python: 3.11.9 (remotes/pull/1057/merge-dirty:edb9cf1, Jan 13 2026, 21:03:38) [MSC v.1940 64 bit (AMD64)]
         Platform: win32
         Executable: D:\a\OpenRV\OpenRV\_build\RV_DEPS_PYTHON3\install\bin\python_d.exe
         Source: D:\a\OpenRV\OpenRV\src\build\requirements.txt.in
         Skipping: pip, setuptools, wheel
         Python bin directory: D:\a\OpenRV\OpenRV\_build\RV_DEPS_PYTHON3\install\bin
         Python bin is on PATH: Yes
         ================================================================================
         
         Testing numpy                                         (from requirements.txt)... OK
         Testing opentimelineio                                (from requirements.txt)... Fixed OTIO Debug extension: _opentimed.cp311-win_amd64.pyd -> _opentime_d.cp311-win_amd64.pyd
         Fixed OTIO Debug extension: _otiod.cp311-win_amd64.pyd -> _otio_d.cp311-win_amd64.pyd
         FAILED
    33>CUSTOMBUILD : error : ImportError: DLL load failed while importing _otio: A dynamic link library (DLL) initialization routine failed. [D:\a\OpenRV\OpenRV\_build\cmake\dependencies\RV_DEPS_PYTHON3-stage-target.vcxproj]
           Diagnostic info for OpenTimelineIO:
           Site-packages: ['D:\\a\\OpenRV\\OpenRV\\_build\\RV_DEPS_PYTHON3\\install', 'D:\\a\\OpenRV\\OpenRV\\_build\\RV_DEPS_PYTHON3\\install\\Lib\\site-packages']
           Found opentimelineio at: D:\a\OpenRV\OpenRV\_build\RV_DEPS_PYTHON3\install\Lib\site-packages\opentimelineio
           Contents: adapters, algorithms, console, core, exceptions.py, hooks.py, media_linker.py, opentime.py, plugins, schema
           _opentime files: ['_opentimed.cp311-win_amd64.pyd', '_opentime_d.cp311-win_amd64.pyd']
         Testing PyOpenGL                                      (from requirements.txt)... OK
         Testing PyOpenGL_accelerate                           (from requirements.txt)... OK
         Testing certifi                                       (from requirements.txt)... OK
         Testing six                                           (from requirements.txt)... OK
         Testing packaging                                     (from requirements.txt)... OK
         Testing requests                                      (from requirements.txt)... OK
         Testing cryptography                                  (from requirements.txt)... OK
         Testing pydantic                                      (from requirements.txt)... OK
         Testing cryptography.fernet                           (additional import)... OK
         Testing cryptography.hazmat.bindings._rust            (additional import)... OK
         
         ================================================================================
         Results: 11 passed, 1 failed
         ================================================================================

@rogernelson

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
@cedrik-fuoco-adsk
Copy link
Copy Markdown
Contributor Author

Sorry for the bunch of commits since a couple days. It should be all good to review now. @eloisebrosseau @bernie-laberge @rogernelson

@cedrik-fuoco-adsk
Copy link
Copy Markdown
Contributor Author

Before merging this PR, I will wait a bit more time for AcademySoftwareFoundation/OpenTimelineIO#1991 to be merged in OTIO. I might merged it sooner if it's taking more time than expected.

@cedrik-fuoco-adsk cedrik-fuoco-adsk changed the title Add a python script to test imports during the build build: Add a python script to test imports during the build Feb 19, 2026
cedrik-fuoco-adsk and others added 2 commits March 26, 2026 14:21
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants