We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec9ce85 commit 3c27bb5Copy full SHA for 3c27bb5
1 file changed
dash/development/component_generator.py
@@ -8,7 +8,8 @@
8
import argparse
9
import shutil
10
import functools
11
-import pkg_resources
+import importlib.resources as importlib_resources
12
+
13
import yaml
14
15
from ._r_components_generation import write_class_file
@@ -57,7 +58,16 @@ def generate_components(
57
58
59
is_windows = sys.platform == "win32"
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)
71
72
reserved_patterns = "|".join(f"^{p}$" for p in reserved_words)
73
0 commit comments