Add our own checks for too many deprecation warnings. Limit to once per package.
(key: t.Any)
| 49 | |
| 50 | |
| 51 | def should_warn(key: t.Any) -> bool: |
| 52 | """Add our own checks for too many deprecation warnings. |
| 53 | |
| 54 | Limit to once per package. |
| 55 | """ |
| 56 | env_flag = os.environ.get("TRAITLETS_ALL_DEPRECATIONS") |
| 57 | if env_flag and env_flag != "0": |
| 58 | return True |
| 59 | |
| 60 | if key not in _deprecations_shown: |
| 61 | _deprecations_shown.add(key) |
| 62 | return True |
| 63 | else: |
| 64 | return False |
no test coverage detected
searching dependent graphs…