File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 88import argparse
99import shutil
1010import functools
11- import pkg_resources
11+ import importlib .resources as importlib_resources
12+
1213import yaml
1314
1415from ._r_components_generation import write_class_file
@@ -57,7 +58,16 @@ def generate_components(
5758
5859 is_windows = sys .platform == "win32"
5960
60- extract_path = pkg_resources .resource_filename ("dash" , "extract-meta.js" )
61+ # Get path to extract-meta.js using importlib.resources
62+ try :
63+ # Python 3.9+
64+ extract_path = str (
65+ importlib_resources .files ("dash" ).joinpath ("extract-meta.js" )
66+ )
67+ except AttributeError :
68+ # Python 3.8 fallback
69+ with importlib_resources .path ("dash" , "extract-meta.js" ) as p :
70+ extract_path = str (p )
6171
6272 reserved_patterns = "|" .join (f"^{ p } $" for p in reserved_words )
6373
You can’t perform that action at this time.
0 commit comments