Revert "Load the cli module lazily for spacy.info (#12962)"

This reverts commit beda27a91e.
This commit is contained in:
Adriane Boyd 2023-10-04 12:33:33 +02:00
parent 92ce32aa3f
commit 6d0185f7fb
2 changed files with 1 additions and 10 deletions

View File

@ -13,6 +13,7 @@ from thinc.api import Config, prefer_gpu, require_cpu, require_gpu # noqa: F401
from . import pipeline # noqa: F401 from . import pipeline # noqa: F401
from . import util from . import util
from .about import __version__ # noqa: F401 from .about import __version__ # noqa: F401
from .cli.info import info # noqa: F401
from .errors import Errors from .errors import Errors
from .glossary import explain # noqa: F401 from .glossary import explain # noqa: F401
from .language import Language from .language import Language
@ -76,9 +77,3 @@ def blank(
# We should accept both dot notation and nested dict here for consistency # We should accept both dot notation and nested dict here for consistency
config = util.dot_to_dict(config) config = util.dot_to_dict(config)
return LangClass.from_config(config, vocab=vocab, meta=meta) return LangClass.from_config(config, vocab=vocab, meta=meta)
def info(*args, **kwargs):
from .cli.info import info as cli_info
return cli_info(*args, **kwargs)

View File

@ -12,7 +12,6 @@ from thinc.api import Config
import spacy import spacy
from spacy import about from spacy import about
from spacy import info as spacy_info
from spacy.cli import info from spacy.cli import info
from spacy.cli._util import parse_config_overrides, string_to_list, walk_directory from spacy.cli._util import parse_config_overrides, string_to_list, walk_directory
from spacy.cli.apply import apply from spacy.cli.apply import apply
@ -193,9 +192,6 @@ def test_cli_info():
raw_data = info(tmp_dir, exclude=[""]) raw_data = info(tmp_dir, exclude=[""])
assert raw_data["lang"] == "nl" assert raw_data["lang"] == "nl"
assert raw_data["components"] == ["textcat"] assert raw_data["components"] == ["textcat"]
raw_data = spacy_info(tmp_dir, exclude=[""])
assert raw_data["lang"] == "nl"
assert raw_data["components"] == ["textcat"]
def test_cli_converters_conllu_to_docs(): def test_cli_converters_conllu_to_docs():