-
Notifications
You must be signed in to change notification settings - Fork 167
Switch to using fmf.ContextDimension
#4894
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,31 @@ | ||||||||||||
| from typing import Generic, TypeVar | ||||||||||||
|
|
||||||||||||
| from fmf.context import Context, ContextDimension, DefaultContextDimension | ||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Import
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ☝️ this is the kind of stuff I have to cope with weekly wit Gemini |
||||||||||||
|
|
||||||||||||
| import tmt.utils | ||||||||||||
| from tmt.plugins import PluginRegistry | ||||||||||||
|
|
||||||||||||
| T = TypeVar("T") | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| class ContextError(tmt.utils.GeneralError): | ||||||||||||
| """ | ||||||||||||
| Error trying to create a context | ||||||||||||
| """ | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| class TmtDefaultContextDimension(DefaultContextDimension): | ||||||||||||
| case_sensitive = False | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| class TmtContextDimension(ContextDimension[T], Generic[T]): | ||||||||||||
| _default_dimension_cls = TmtDefaultContextDimension | ||||||||||||
| _registrar = {} | ||||||||||||
|
Comment on lines
+21
to
+23
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Defining
Suggested change
|
||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| class TmtContext(Context): | ||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One typo in the title and it thinks cows grow on trees 🙄 |
||||||||||||
| _context_dimensions = TmtContextDimension | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| _CONTEXT_REGISTRY = PluginRegistry('context') | ||||||||||||
| provides_context = _CONTEXT_REGISTRY.create_decorator() | ||||||||||||
|
Comment on lines
+30
to
+31
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||
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.
The
uv-pre-commithooks are commented out. Revert this change or remove the lines if they are no longer needed for the final implementation.