Restore spacy.cli.project API (#13053)

* Restore spacy.cli.project API

* Fix typing errors, add simple import test
This commit is contained in:
Adriane Boyd 2023-10-10 15:35:25 +02:00 committed by GitHub
parent 65e7bd54f5
commit 77c568e524
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 24 additions and 2 deletions

View File

@ -22,8 +22,17 @@ from .init_pipeline import init_pipeline_cli # noqa: F401
from .package import package # noqa: F401
from .pretrain import pretrain # noqa: F401
from .profile import profile # noqa: F401
from .train import train_cli # noqa: F401
from .validate import validate # noqa: F401
from .project.assets import project_assets # type: ignore[attr-defined] # noqa: F401
from .project.clone import project_clone # type: ignore[attr-defined] # noqa: F401
from .project.document import ( # type: ignore[attr-defined] # noqa: F401
project_document,
)
from .project.dvc import project_update_dvc # type: ignore[attr-defined] # noqa: F401
from .project.pull import project_pull # type: ignore[attr-defined] # noqa: F401
from .project.push import project_push # type: ignore[attr-defined] # noqa: F401
from .project.run import project_run # type: ignore[attr-defined] # noqa: F401
from .train import train_cli # type: ignore[attr-defined] # noqa: F401
from .validate import validate # type: ignore[attr-defined] # noqa: F401
@app.command("link", no_args_is_help=True, deprecated=True, hidden=True)

View File

View File

@ -0,0 +1 @@
from weasel.cli.assets import *

View File

@ -0,0 +1 @@
from weasel.cli.clone import *

View File

@ -0,0 +1 @@
from weasel.cli.document import *

1
spacy/cli/project/dvc.py Normal file
View File

@ -0,0 +1 @@
from weasel.cli.dvc import *

View File

@ -0,0 +1 @@
from weasel.cli.pull import *

View File

@ -0,0 +1 @@
from weasel.cli.push import *

View File

@ -0,0 +1 @@
from weasel.cli.remote_storage import *

1
spacy/cli/project/run.py Normal file
View File

@ -0,0 +1 @@
from weasel.cli.run import *

View File

@ -1061,3 +1061,8 @@ def test_debug_data_trainable_lemmatizer_not_annotated():
data = _compile_gold(train_examples, ["trainable_lemmatizer"], nlp, True)
assert data["no_lemma_annotations"] == 2
def test_project_api_imports():
from spacy.cli import project_run
from spacy.cli.project.run import project_run # noqa: F401, F811