-
Notifications
You must be signed in to change notification settings - Fork 0
ci: limit cibuildwheel pytest collection to tests directory #81
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
Conversation
Co-authored-by: hzhangxyz <[email protected]>
hzhangxyz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python -m 别丢了
Co-authored-by: hzhangxyz <[email protected]>
Done. Updated to keep |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.