Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

beroda
Copy link
Collaborator

@beroda beroda commented Sep 10, 2025

Overview

VTK_DEFAULT_OPENGL_WINDOW env variable is set on the tox config. It prevents users from changing its value outside of tox.
This PR fixes that by setting the env variable specifically when the CI env variable is true.

Moreover, VTK_DEFAULT_OPENGL_WINDOW is also explicitely specified for doctest-modules job.

@beroda beroda requested a review from a team as a code owner September 10, 2025 15:39
@pyvista-bot pyvista-bot added the maintenance Low-impact maintenance activity label Sep 10, 2025
@beroda beroda self-assigned this Sep 10, 2025
akaszynski
akaszynski previously approved these changes Sep 10, 2025
@@ -15,6 +15,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
VTK_DEFAULT_OPENGL_WINDOW: "vtkEGLRenderWindow"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to define "vtkEGLRenderWindow" as a variable in tox for CI use only, such that it can be reused, e.g. for the docstring/doctest workflow? I.e. address this comment #7861 (comment)

Maybe define CI_VTK_DEFAULT_OPENGL_WINDOW = "vtkEGLRenderWindow" as the variable in tox, and do something like:

Suggested change
VTK_DEFAULT_OPENGL_WINDOW: "vtkEGLRenderWindow"
VTK_DEFAULT_OPENGL_WINDOW: CI_VTK_DEFAULT_OPENGL_WINDOW

Copy link
Contributor

Choose a reason for hiding this comment

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

alternatively, define a pre-command that checks if the env var CI is true, and if it is then export VTK_DEFAULT_OPENGL_WINDOW = "vtkEGLRenderWindow"? This way we wouldn't need to define it as an env var inside the workflow itself, and would be self-contained inside the tox config.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can also address this separately with a future PR that adds tox to the docstring tests

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is there a way to define "vtkEGLRenderWindow" as a variable in tox for CI use only, such that it can be reused, e.g. for the docstring/doctest workflow? I.e. address this comment #7861 (comment)

Don't think it's possible to set and env variable in tox depending on the value of another one (ie. CI)

alternatively, define a pre-command that checks if the env var CI is true, and if it is then export VTK_DEFAULT_OPENGL_WINDOW = "vtkEGLRenderWindow"? This way we wouldn't need to define it as an env var inside the workflow itself, and would be self-contained inside the tox config.

commands output cannot be captured in subsequent commands, so I don't think this is possible either.

Maybe through a dedicated homemade plugin ...

Copy link
Collaborator Author

@beroda beroda Sep 10, 2025

Choose a reason for hiding this comment

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

@user27182 does f7c8862 is what you intended ?

If yes, do you prefer cherry-picking f7c8862 inside another dedicated PR ?

Copy link
Member

Choose a reason for hiding this comment

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

And I went to verify it's working by checking the software report, but I guess there is none?? Or at least I couldn't find it. Maybe it was excluded with #7916 ?

Looks like we need to add that back in. We can open an issue or simply add it in this PR.

Copy link
Collaborator Author

@beroda beroda Sep 11, 2025

Choose a reason for hiding this comment

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

And I went to verify it's working by checking the software report, but I guess there is none?? Or at least I couldn't find it. Maybe it was excluded with #7916 ?

Fixed in 1a0e117

I see, then I guess we should include doctest-modules in the list of cases where we want to set VTK_DEFAULT_OPENGL_WINDOW? Is that correct, @akaszynski, we want these two workflows to use this consistently?

I'd say so. It's better to be explicit IMO to try to set the render window, and it's a bit of future proofing to ensure that should we decide to use a GPU in one of our workflows.

Done in d79dc41

And as an additional unrelated note, is it an easy change to exclude -v from the documentation image tests? I find the extra 5000 lines in the log for all the test cases to be unnecessary for this. (-v was not used for this prior to #7916)

Done in a834b43

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @beroda ! I was expecting the report to include "vtkEGLRenderWindow" as the render window, but instead it's just a generic "vtkRenderWindow".
https://github.com/pyvista/pyvista/actions/runs/17657586560/job/50184056166#step:7:40

This does not appear to be specific to this workflow, it seems the unit tests, type checking, docstring tests also do not appear to be reporting a concrete render window class.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @beroda ! I was expecting the report to include "vtkEGLRenderWindow" as the render window, but instead it's just a generic "vtkRenderWindow". https://github.com/pyvista/pyvista/actions/runs/17657586560/job/50184056166#step:7:40

This does not appear to be specific to this workflow, it seems the unit tests, type checking, docstring tests also do not appear to be reporting a concrete render window class.

This is reported/tracked in #7948

Copy link
Contributor

Choose a reason for hiding this comment

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

With the fix from #7949 , on Windows unit tests we have Render Window : vtkOSOpenGLRenderWindow
https://github.com/pyvista/pyvista/actions/runs/17685334349/job/50268816978?pr=7949#step:7:57

This differs from the default of EGL set for the docs. Perhaps we want to use the same render window for all CI jobs, not just docs/docstrings? Not sure if that will cause any generated images will differ and introduce regressions... but if not perhaps we should consider doing so for consistency?

@pyvista-bot
Copy link
Contributor

pyvista-bot commented Sep 10, 2025

@pyvista-bot pyvista-bot temporarily deployed to pull request September 10, 2025 16:09 Inactive
Copy link

codecov bot commented Sep 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.40%. Comparing base (f0de483) to head (9e7a7a1).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7945   +/-   ##
=======================================
  Coverage   96.40%   96.40%           
=======================================
  Files         150      150           
  Lines       32675    32675           
  Branches     4114     4114           
=======================================
  Hits        31501    31501           
  Misses        570      570           
  Partials      604      604           

@pyvista-bot pyvista-bot temporarily deployed to pull request September 10, 2025 21:08 Inactive
@beroda beroda changed the title Revert VTK_DEFAULT_OPENGL_WINDOW from tox to github CI env Set VTK_DEFAULT_OPENGL_WINDOW for specific tox jobs Sep 11, 2025
@pyvista-bot pyvista-bot temporarily deployed to pull request September 11, 2025 21:48 Inactive
@beroda
Copy link
Collaborator Author

beroda commented Sep 12, 2025

Per #7945 (comment), waiting for #7948 to be closed before continuing this PR.

@beroda beroda marked this pull request as draft September 12, 2025 07:11
@pyvista-bot pyvista-bot temporarily deployed to pull request September 12, 2025 10:56 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Low-impact maintenance activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants