You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I've been using the following pytest-inspired decorator in some of my projects when a duty cannot run on a specific Python version:
defskip_if(condition: bool, reason: str):
"""Decorator allowing to skip a duty if a condition is met. Parameters: condition: The condition to meet. reason: The reason to skip. Returns: A decorator. """defdecorator(func):
@wraps(func)defwrapper(ctx, *args, **kwargs):
ifcondition:
ctx.run(["true"], title=reason)
else:
func(ctx, *args, **kwargs)
returnwrapperreturndecorator
...allowing to do this for example:
@duty@skip_if(sys.version_info< (3, 8) orsys.version_info>= (3, 11),reason="Checking docs is not supported on Python 3.7 and 3.11, skipping",)defcheck_docs(ctx): ...
Describe the solution you'd like
Could be nice to provide that natively.
Describe alternatives you've considered
Custom code in projects.
Additional context
/
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I've been using the following pytest-inspired decorator in some of my projects when a duty cannot run on a specific Python version:
...allowing to do this for example:
Describe the solution you'd like
Could be nice to provide that natively.
Describe alternatives you've considered
Custom code in projects.
Additional context
/
The text was updated successfully, but these errors were encountered: