forked from Backblaze/b2-sdk-python
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Backblaze#499 from reef-technologies/lifecycle_new…
…_option Lifecycle new option
- Loading branch information
Showing
10 changed files
with
252 additions
and
180 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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
###################################################################### | ||
# | ||
# File: b2sdk/_internal/types.py | ||
# | ||
# Copyright 2024 Backblaze Inc. All Rights Reserved. | ||
# | ||
# License https://www.backblaze.com/using_b2_code.html | ||
# | ||
###################################################################### | ||
""" | ||
Types compatibility layer. | ||
We use this module to support pydantic-less installs, as well as native typing module us on newer python versions. | ||
""" | ||
import sys | ||
|
||
from annotated_types import Ge | ||
|
||
try: | ||
from typing_extensions import Annotated, NotRequired, TypedDict | ||
except ImportError: | ||
from typing import Annotated, NotRequired, TypedDict | ||
|
||
__all__ = [ # prevents linter from removing "unused imports" which we want to export | ||
"NotRequired", | ||
"PositiveInt", | ||
"TypedDict", | ||
"pydantic", | ||
] | ||
|
||
try: | ||
import pydantic | ||
|
||
if getattr(pydantic, "__version__", "") < "2": | ||
raise ImportError | ||
|
||
if sys.version_info < (3, 10): # https://github.com/pydantic/pydantic/issues/7873 | ||
import eval_type_backport # noqa | ||
except ImportError: | ||
pydantic = None | ||
|
||
PositiveInt = Annotated[int, Ge(0)] |
1 change: 1 addition & 0 deletions
1
changelog.d/+daysFromStartingToCancelingUnfinishedLargeFiles.added.md
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 @@ | ||
Add `daysFromStartingToCancelingUnfinishedLargeFiles` option to `lifecycle_rules` type annotation. |
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 @@ | ||
Add `annotated_types` dependency for type annotations that include basic value validation. |
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.