From 77c568e5247bd0ff3744abce5c8541ecd7930524 Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Tue, 10 Oct 2023 15:35:25 +0200 Subject: [PATCH] Restore spacy.cli.project API (#13053) * Restore spacy.cli.project API * Fix typing errors, add simple import test --- spacy/cli/__init__.py | 13 +++++++++++-- spacy/cli/project/__init__.py | 0 spacy/cli/project/assets.py | 1 + spacy/cli/project/clone.py | 1 + spacy/cli/project/document.py | 1 + spacy/cli/project/dvc.py | 1 + spacy/cli/project/pull.py | 1 + spacy/cli/project/push.py | 1 + spacy/cli/project/remote_storage.py | 1 + spacy/cli/project/run.py | 1 + spacy/tests/test_cli.py | 5 +++++ 11 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 spacy/cli/project/__init__.py create mode 100644 spacy/cli/project/assets.py create mode 100644 spacy/cli/project/clone.py create mode 100644 spacy/cli/project/document.py create mode 100644 spacy/cli/project/dvc.py create mode 100644 spacy/cli/project/pull.py create mode 100644 spacy/cli/project/push.py create mode 100644 spacy/cli/project/remote_storage.py create mode 100644 spacy/cli/project/run.py diff --git a/spacy/cli/__init__.py b/spacy/cli/__init__.py index f3c6dbfed..1d402ff0c 100644 --- a/spacy/cli/__init__.py +++ b/spacy/cli/__init__.py @@ -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) diff --git a/spacy/cli/project/__init__.py b/spacy/cli/project/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/spacy/cli/project/assets.py b/spacy/cli/project/assets.py new file mode 100644 index 000000000..591d1959e --- /dev/null +++ b/spacy/cli/project/assets.py @@ -0,0 +1 @@ +from weasel.cli.assets import * diff --git a/spacy/cli/project/clone.py b/spacy/cli/project/clone.py new file mode 100644 index 000000000..11d2511a3 --- /dev/null +++ b/spacy/cli/project/clone.py @@ -0,0 +1 @@ +from weasel.cli.clone import * diff --git a/spacy/cli/project/document.py b/spacy/cli/project/document.py new file mode 100644 index 000000000..1952524a9 --- /dev/null +++ b/spacy/cli/project/document.py @@ -0,0 +1 @@ +from weasel.cli.document import * diff --git a/spacy/cli/project/dvc.py b/spacy/cli/project/dvc.py new file mode 100644 index 000000000..aa1ae7dd9 --- /dev/null +++ b/spacy/cli/project/dvc.py @@ -0,0 +1 @@ +from weasel.cli.dvc import * diff --git a/spacy/cli/project/pull.py b/spacy/cli/project/pull.py new file mode 100644 index 000000000..5e603273d --- /dev/null +++ b/spacy/cli/project/pull.py @@ -0,0 +1 @@ +from weasel.cli.pull import * diff --git a/spacy/cli/project/push.py b/spacy/cli/project/push.py new file mode 100644 index 000000000..3a8e8869d --- /dev/null +++ b/spacy/cli/project/push.py @@ -0,0 +1 @@ +from weasel.cli.push import * diff --git a/spacy/cli/project/remote_storage.py b/spacy/cli/project/remote_storage.py new file mode 100644 index 000000000..29409150f --- /dev/null +++ b/spacy/cli/project/remote_storage.py @@ -0,0 +1 @@ +from weasel.cli.remote_storage import * diff --git a/spacy/cli/project/run.py b/spacy/cli/project/run.py new file mode 100644 index 000000000..cc6a5ac42 --- /dev/null +++ b/spacy/cli/project/run.py @@ -0,0 +1 @@ +from weasel.cli.run import * diff --git a/spacy/tests/test_cli.py b/spacy/tests/test_cli.py index 86451317b..ff53ed1e1 100644 --- a/spacy/tests/test_cli.py +++ b/spacy/tests/test_cli.py @@ -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