From 788a9f6f5c27ed8983c0de2144a43256ef3f6e19 Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Tue, 31 Aug 2021 13:43:33 +0530 Subject: [PATCH] CI: Add support for using Opengl in Subprocess (Windows) There is an environment variable in glcontext which can be used for the locating the `opengl32.dll`. Use that instead of dynamically loading the DLL which is error prone. --- .github/workflows/ci.yml | 1 + tests/__init__.py | 10 ---------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba9a87a153..18646f7cdc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,7 @@ jobs: env: DISPLAY: :0 PYTEST_ADDOPTS: "--color=yes" # colors in pytest + GLCONTEXT_WIN_LIBGL: C:\msys64\mingw64\bin\opengl32.dll strategy: fail-fast: false matrix: diff --git a/tests/__init__.py b/tests/__init__.py index 27e33d1ad0..e69de29bb2 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,10 +0,0 @@ -import os - -if os.getenv("CI") and os.name == "nt": - location = r"C:\msys64\mingw64\bin" - os.environ["PATH"] = location + os.pathsep + os.getenv("PATH") - import ctypes - - ctypes.CDLL(r"C:\msys64\mingw64\bin\OPENGL32.dll") - if hasattr(os, "add_dll_directory"): - os.add_dll_directory(location)