ci: limit cibuildwheel pytest collection to tests directory - #81
Merged
Conversation
Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>
hzhangxyz
marked this pull request as ready for review
December 9, 2025 08:31
Copilot
AI
changed the title
[WIP] Update cibuildwheel test command for pytest configuration
ci: limit cibuildwheel pytest collection to tests directory
Dec 9, 2025
Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>
Contributor
Author
Done. Updated to keep |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the cibuildwheel test command to explicitly restrict pytest test collection to the tests/ directory, preventing unintended collection of tests from other subdirectories like bnf/tests/. The change addresses a ModuleNotFoundError that occurred when cibuildwheel ran python -m pytest {project}, which caused pytest to collect tests from all directories, including bnf/tests/ which depends on a different package (apyds_bnf).
Key Changes:
- Modified the cibuildwheel test-command to explicitly target
{project}/testsinstead of{project} - Added explicit
--cov=apydsflag to maintain coverage reporting during wheel testing
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| windows.archs = ["AMD64"] | ||
| test-requires = ["pytest", "pytest-cov"] | ||
| test-command = ["python -m pytest {project}"] | ||
| test-command = ["python -m pytest {project}/tests --cov=apyds"] |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
hzhangxyz
approved these changes
Dec 9, 2025
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.
Plan to fix cibuildwheel test command
test-commandin[tool.cibuildwheel]sectionpython -mprefixChanges Made
Updated the cibuildwheel test command from:
to:
This change:
python -mprefix to ensure pytest runs in the correct Python environment{project}/testsdirectory (prevents collecting frombnf/tests/)--cov=apydsflag for coverage parity with local runsIssue Summary
The original cibuildwheel test command caused pytest to collect tests from all directories including
bnf/tests/, which failed with ModuleNotFoundError forapyds_bnf. The fix restricts collection to only the maintests/directory while maintaining thepython -mprefix and adding coverage option.Security Summary
No security vulnerabilities detected. This is a configuration-only change to the pyproject.toml file.
Original prompt
This pull request was created as a result of the following prompt from Copilot chat.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.