-
-
Notifications
You must be signed in to change notification settings - Fork 5
ENH: Add pytest_extra_requires
to conditionally ignore paths / skip functions unless requirements are met
#204
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
Use fnmatch_ex from _pytest.pathlib to match pytest itself.
This allows to conditionally skip/ignore paths depending on the PEP 508 requirements: pytest_extra_requires = { "path/to/file" : "cupy>=2.3.4" }
@flying-sheep would you be interested in giving this a spin to see if this addresses your request in gh-197? |
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.
Looks great, only things can have multiple requirements, so that should be handled.
pytest_extra_requires
to conditionally ignore paths unless requirements are metpytest_extra_requires
to conditionally ignore paths / skip functions unless requirements are met
Co-authored-by: Philipp A. <[email protected]>
a9eecd9
to
fd5a2db
Compare
Thanks! Your edits are in. Adding |
No further comments, so let's land this and iterate as necessary. Thanks a whole lot @flying-sheep ! |
pytest_extra_requires
to conditionally ignore paths / skip functions unless requirements are metpytest_extra_requires
to conditionally ignore paths / skip functions unless requirements are met
fixes gh-197
Potential follow-ups
spin
-made dev builds do not play nice withpackaging.requirements.version
. Can add a fallback to__version__
. This is only relevant if a spin-built package is a dependency, so this should be very rare. Probably not worth bothering until a there's a real use case.{"module.func": "cupy>2.3.4"}
, similar topytest_extra_ignore