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 090f2e0
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions kedro/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,24 @@
configuration and pipeline assembly.
"""

import sys
import warnings

__version__ = "0.18.11"


class KedroPythonVersionWarning(UserWarning):
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 090f2e0

Please sign in to comment.