Skip to content

Commit

Permalink
suppres warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Apr 8, 2021
1 parent 9044ed1 commit f9bb7b4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pl_bolts/utils/warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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:
Expand Down

0 comments on commit f9bb7b4

Please sign in to comment.