File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 44# This source code is licensed under the BSD-style license found in the
55# LICENSE file in the root directory of this source tree.
66
7+ # FIXME: remove this once wandb fixed this issue
8+ # https://github.com/wandb/wandb/issues/10890
9+ # Patch importlib.metadata.distributions before wandb imports it
10+ # to filter out packages with None metadata
11+ import importlib .metadata
12+
13+ # Guard to ensure this runs only once
14+ if not hasattr (importlib .metadata , "_distributions_patched" ):
15+ _original_distributions = importlib .metadata .distributions
16+
17+ def _patched_distributions ():
18+ """Filter out distributions with None metadata"""
19+ for distribution in _original_distributions ():
20+ if distribution .metadata is not None :
21+ yield distribution
22+
23+ importlib .metadata .distributions = _patched_distributions
24+ importlib .metadata ._distributions_patched = True
25+
726import logging
827from functools import lru_cache
928
You can’t perform that action at this time.
0 commit comments