mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-26 17:24:41 +03:00
Only include runtime-relevant config in package CLI dependency detection (#9211)
This commit is contained in:
parent
d74870d38c
commit
20f63e7154
|
@ -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"])
|
||||
|
|
Loading…
Reference in New Issue
Block a user