-
Notifications
You must be signed in to change notification settings - Fork 137
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
adding matcher POC #761
Open
valkolovos
wants to merge
18
commits into
pact-foundation:master
Choose a base branch
from
valkolovos:matcher_poc
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
adding matcher POC #761
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
e77b562
adding matcher POC
valkolovos 18d0e12
Matcher / generator implementations and examples
valkolovos a843538
linting and python version fixes
valkolovos 1ca2832
linting and formatting fixes
valkolovos 5262e13
fix: missing typing arguments
JP-Ellis 834c73b
fix: incompatible override
JP-Ellis 2902425
fix: kwargs typing
JP-Ellis bedd5a8
refactor: prefer `|` over Optional and Union
JP-Ellis 7830611
chore: prefer ABC over ABCMeta
JP-Ellis ff434a0
docs: add matcher module preamble
JP-Ellis 85d2fea
refactor: rename matchers to match
JP-Ellis 511c41a
chore: re-organise match module
JP-Ellis 4cd67f5
fix recursive typing issues
valkolovos fe4d4af
fix issues importing MatcherEncoder
valkolovos 547fbe1
fixing typing issues for python3.9
valkolovos 0dfc73c
refactor: split types into stub
JP-Ellis 2f33caf
feat: add matchable typevar
JP-Ellis acf1710
refactor: matcher
JP-Ellis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from collections.abc import Collection, Mapping, Sequence | ||
from collections.abc import Set as AbstractSet | ||
from decimal import Decimal | ||
from fractions import Fraction | ||
from typing import TypeAlias | ||
|
||
from pydantic import BaseModel | ||
|
||
_BaseMatchable: TypeAlias = ( | ||
int | float | complex | bool | str | bytes | bytearray | memoryview | None | ||
) | ||
""" | ||
Base types that generally can't be further decomposed. | ||
|
||
See: https://docs.python.org/3/library/stdtypes.html | ||
""" | ||
|
||
_ContainerMatchable: TypeAlias = ( | ||
Sequence[Matchable] | ||
| AbstractSet[Matchable] | ||
| Mapping[_BaseMatchable, Matchable] | ||
| Collection[Matchable] | ||
) | ||
""" | ||
Containers that can be further decomposed. | ||
|
||
These are defined based on the abstract base classes defined in the | ||
[`collections.abc`][collections.abc] module. | ||
""" | ||
|
||
_ExtraMatchable: TypeAlias = BaseModel | Decimal | Fraction | ||
|
||
Matchable: TypeAlias = _BaseMatchable | _ContainerMatchable | _ExtraMatchable | ||
""" | ||
All supported matchable types. | ||
""" |
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.
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.
TIL about stub files :)