Skip to content

Commit

Permalink
🐛 Update ozi.spec.python
Browse files Browse the repository at this point in the history
PendingDeprecationWarning 52 weeks prior to python end-of-life
DeprecationWarning instead of RuntimeError if python end-of-life reached.

Signed-off-by: Eden Rose, MSc <[email protected]>
  • Loading branch information
rjdbcm authored May 4, 2024
1 parent 838a2bf commit b2ffa99
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ozi/spec/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ def __post_init__(self: Self) -> None:
)
ozi_support_eol = python3_eol - timedelta(weeks=DEPRECATION_DELTA_WEEKS)
if datetime.now(tz=timezone.utc).date() > python3_eol: # pragma: no cover
text = (
f'Python {pymajor}.{pyminor}.{pypatch} is not supported as of {python3_eol}.'
warn(
f'Python {pymajor}.{pyminor}.{pypatch} is not supported as of {python3_eol}.',
DeprecationWarning,
)
raise RuntimeError(text)
elif datetime.now(tz=timezone.utc).date() > ozi_support_eol: # pragma: no cover
warn(
f'Python {pymajor}.{pyminor}.{pypatch} support is deprecated '
f'Python {pymajor}.{pyminor}.{pypatch} support is pending deprecation '
f'as of {ozi_support_eol}.',
DeprecationWarning,
PendingDeprecationWarning,
)

@cached_property
Expand Down

0 comments on commit b2ffa99

Please sign in to comment.