-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor conditional imports for Pydantic versions
- Remove asserts
- Loading branch information
1 parent
ed012a9
commit 11e42d4
Showing
25 changed files
with
90 additions
and
88 deletions.
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
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 |
---|---|---|
|
@@ -10,4 +10,4 @@ | |
- type: tickit.devices.sink.Sink | ||
name: sink | ||
inputs: | ||
input: amp:amplified_signal | ||
input: amp:amplified_signal |
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 |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
- type: tickit.devices.sink.Sink | ||
name: counter_sink | ||
inputs: | ||
input: counter:_value | ||
input: counter:_value |
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 |
---|---|---|
|
@@ -11,4 +11,4 @@ | |
- type: tickit.devices.sink.Sink | ||
name: sink | ||
inputs: | ||
flux: shutter:flux | ||
flux: shutter:flux |
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,14 +1,44 @@ | ||
import sys | ||
|
||
try: | ||
import pydantic.v1 as pydantic | ||
from pydantic.v1 import ( | ||
BaseConfig, | ||
BaseModel, | ||
Field, | ||
ValidationError, | ||
create_model, | ||
parse_obj_as, | ||
) | ||
from pydantic.v1.dataclasses import dataclass as pydantic_dataclass | ||
from pydantic.v1.error_wrappers import ErrorWrapper | ||
except ImportError: | ||
import pydantic # type: ignore[no-redef] | ||
from pydantic import ( # type: ignore | ||
BaseConfig, | ||
BaseModel, | ||
Field, | ||
ValidationError, | ||
create_model, | ||
parse_obj_as, | ||
) | ||
from pydantic.dataclasses import dataclass as pydantic_dataclass # type: ignore | ||
from pydantic.error_wrappers import ErrorWrapper # type: ignore | ||
|
||
|
||
if sys.version_info >= (3, 8): | ||
from typing import Protocol, TypedDict, runtime_checkable | ||
elif sys.version_info >= (3, 5): | ||
from typing_extensions import Protocol, TypedDict, runtime_checkable | ||
|
||
__all__ = ["Protocol", "TypedDict", "runtime_checkable", "pydantic"] | ||
__all__ = [ | ||
"Protocol", | ||
"TypedDict", | ||
"runtime_checkable", | ||
"pydantic_dataclass", | ||
"ErrorWrapper", | ||
"BaseConfig", | ||
"BaseModel", | ||
"create_model", | ||
"Field", | ||
"parse_obj_as", | ||
"ValidationError", | ||
] |
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
Oops, something went wrong.