Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set PYOPENGL_PLATFORM before opengl imports #149

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

chrishavlin
Copy link
Contributor

Closes #144 and also partly addresses #148 -- switching to headless rendering context now works as expected without having to manually set the PYOPENGL_PLATFORM environment variable.

I also switched how pytest sets PYOPENGL_PLATFORM since the monkeypatch was not having an effect (due to all the imports at the top oftest_yt_idv.py. pytest now runs for me locally without having to set PYOPENGL_PLATFORM.

@chrishavlin chrishavlin added bug Something isn't working infrastructure Related to CI, versioning, websites, organizational issues, etc labels Oct 28, 2024
@chrishavlin chrishavlin marked this pull request as draft October 28, 2024 17:25
@chrishavlin chrishavlin marked this pull request as ready for review October 28, 2024 17:25

# PYOPENGL_PLATFORM must be set before any opengl imports
if engine in ("osmesa", "egl"):
os.environ["PYOPENGL_PLATFORM"] = engine
Copy link
Member

Choose a reason for hiding this comment

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

There's some distinction in how this sets the environment (like, not to parent process) that I think works in our favor. So, good!

@chrishavlin chrishavlin merged commit 20e5388 into yt-project:main Oct 28, 2024
6 checks passed
@chrishavlin chrishavlin deleted the env_var_handling branch October 28, 2024 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working infrastructure Related to CI, versioning, websites, organizational issues, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PYOPENGL_PLATFORM not being set in pytest context?
2 participants