diff --git a/pl_bolts/utils/warnings.py b/pl_bolts/utils/warnings.py index c81c58a440..60d3a82771 100644 --- a/pl_bolts/utils/warnings.py +++ b/pl_bolts/utils/warnings.py @@ -4,6 +4,8 @@ MISSING_PACKAGE_WARNINGS: Dict[str, int] = {} +WARN_MISSING_PACKAGE = int(os.environ.get('WARN_MISSING_PACKAGE', False)) + def warn_missing_pkg( pkg_name: str, @@ -23,6 +25,9 @@ def warn_missing_pkg( Returns: Number of warning calls """ + if not WARN_MISSING_PACKAGE: + return -1 + if pkg_name not in MISSING_PACKAGE_WARNINGS: extra_text = os.linesep + extra_text if extra_text else '' if not pypi_name: