Skip to content

Commit

Permalink
Only include runtime-relevant config in package CLI dependency detect…
Browse files Browse the repository at this point in the history
  • Loading branch information
ines authored and adrianeboyd committed Sep 27, 2021
1 parent 783b0b4 commit c559e09
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions spacy/cli/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,11 @@ def get_third_party_dependencies(
own_packages = ("spacy", "spacy-legacy", "spacy-nightly", "thinc", "srsly")
distributions = util.packages_distributions()
funcs = defaultdict(set)
for path, value in util.walk_dict(config):
if path[-1].startswith("@"): # collect all function references by registry
funcs[path[-1][1:]].add(value)
# We only want to look at runtime-relevant sections, not [training] or [initialize]
for section in ("nlp", "components"):
for path, value in util.walk_dict(config[section]):
if path[-1].startswith("@"): # collect all function references by registry
funcs[path[-1][1:]].add(value)
for component in config.get("components", {}).values():
if "factory" in component:
funcs["factories"].add(component["factory"])
Expand Down

0 comments on commit c559e09

Please sign in to comment.