Skip to content

Commit

Permalink
Add toggleable error if Python version is incompatible
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Luis Cano Rodríguez <[email protected]>
  • Loading branch information
astrojuanlu committed Jul 4, 2023
1 parent bb49565 commit 75b5770
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions kedro/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,26 @@
configuration and pipeline assembly.
"""

import sys
import warnings

__version__ = "0.18.11"


class KedroPythonVersionWarning(UserWarning):
"""Custom class for warnings about incompatibilities with Python versions."""

pass


if not sys.warnoptions:
warnings.simplefilter("error", KedroPythonVersionWarning)

if sys.version_info >= (3, 11):
warnings.warn(
"""Kedro is not yet fully compatible with this Python version.
To proceed at your own risk and ignore this warning,
run Kedro with `python -W "default:Kedro is not yet fully compatible" -m kedro ...`
or set the PYTHONWARNINGS environment variable accordingly.""",
KedroPythonVersionWarning,
)

0 comments on commit 75b5770

Please sign in to comment.