Skip to content

Commit

Permalink
suppres warnings (#617)
Browse files Browse the repository at this point in the history
* suppres warnings

* chlog
  • Loading branch information
Borda authored Apr 8, 2021
1 parent b97c846 commit 35f6314
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [0.3.3] - 2021-04-DD

### Changed

- Suppressed missing package warnings, conditioned by `WARN_MISSING_PACKAGE="1"` ([#617](https://github.com/PyTorchLightning/lightning-bolts/pull/617))


## [0.3.2] - 2021-03-20

### Changed
Expand Down
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 35f6314

Please sign in to comment.