Use venv for Python tests#26
Open
zmoon wants to merge 6 commits intoufs-community:mainfrom
Open
Conversation
so that it will work in read-only container
in the container for spack
to reflect more deps than just pytest
There was a problem hiding this comment.
Pull request overview
This PR updates CECE’s CTest-based Python test setup to run inside a build-directory virtual environment so test dependencies can be installed even when the base environment is read-only (e.g., certain container runtimes). It also adjusts the GitHub Actions workflow to avoid installing some Python test deps globally since they’ll be installed into the venv by CTest fixtures.
Changes:
- Create a Python venv under the CMake build directory and run Python/pytest tests using that venv interpreter.
- Add CTest fixtures to upgrade pip and install Python test dependencies into the venv before running Python tests.
- Update CI to stop globally installing pytest/pyyaml (now installed by CTest fixtures) while keeping deps needed for scripts run outside CTest.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| CMakeLists.txt | Adds build-dir venv creation + fixture-driven pip installs; switches Python tests to use the venv interpreter. |
| .github/workflows/ci.yml | Removes global pytest/pyyaml install; documents that CTest fixtures handle these in the build-dir venv. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
so that it will work in read-only container