Skip to content

Commit 2241c06

Browse files
committed
Correctly reference package resources in CLI
1 parent 1bc2a5c commit 2241c06

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dphon/cli.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
import logging
6767
import time
6868
import os
69+
import pkg_resources
6970
from itertools import combinations
7071
from pathlib import Path
7172
from typing import Dict
@@ -130,8 +131,9 @@ def run() -> None:
130131
def setup(args: Dict) -> Language:
131132
"""Set up the spaCy processing pipeline."""
132133
# get sound table
133-
sound_table = get_sound_table_json(
134-
Path("./dphon/data/sound_table_v2.json"))
134+
v2_path = pkg_resources.resource_filename(
135+
__package__, "data/sound_table_v2.json")
136+
sound_table = get_sound_table_json(Path(v2_path))
135137

136138
# add Doc metadata
137139
if not Doc.has_extension("id"):

0 commit comments

Comments
 (0)