spaCy/spacy/cli
Paul O'Leary McCann b4e457d9fe
Accept multiple code files in all CLI commands (#12101)
* Add support for multiple code files to all relevant commands

Prior to this, only the package command supported multiple code files.

* Update docs

* Add debug data test, plus generic fixtures

One tricky thing here: it's tempting to create the config by creating a
pipeline in code, but that requires declaring the custom components
here. However the CliRunner appears to be run in the same process or
otherwise have access to our registry, so it works even without any
code arguments. So it's necessary to avoid declaring the components in
the tests.

* Add debug config test and restructure

The code argument imports the provided file. If it adds item to the
registry, that affects global state, which CliRunner doesn't isolate.
Since there's no standard way to remove things from the registry, this
instead uses subprocess.run to run commands.

* Use a more generic, parametrized test

* Add output arg for assemble and pretrain

Assemble and pretrain require an output argument. This commit adds
assemble testing, but not pretrain, as that requires an actual trainable
component, which is not currently in the test config.

* Add evaluate test and some cleanup

* Mark tests as slow

* Revert argument name change

* Apply suggestions from code review

Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com>

* Format API CLI docs

* isort

* Fix imports in tests

* isort

* Undo changes to package CLI help

* Fix python executable and lang code in test

* Fix executable in another test

---------

Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com>
Co-authored-by: Raphael Mitsch <r.mitsch@outlook.com>
2023-08-01 15:24:02 +02:00
..
project isort all the things 2023-06-26 11:41:03 +02:00
templates Merge branch 'upstream_master' into sync_v4 2023-07-19 16:37:31 +02:00
__init__.py isort all the things 2023-06-26 11:41:03 +02:00
_util.py Accept multiple code files in all CLI commands (#12101) 2023-08-01 15:24:02 +02:00
apply.py isort all the things 2023-06-26 11:41:03 +02:00
assemble.py Accept multiple code files in all CLI commands (#12101) 2023-08-01 15:24:02 +02:00
benchmark_speed.py isort all the things 2023-06-26 11:41:03 +02:00
convert.py isort all the things 2023-06-26 11:41:03 +02:00
debug_config.py Accept multiple code files in all CLI commands (#12101) 2023-08-01 15:24:02 +02:00
debug_data.py Accept multiple code files in all CLI commands (#12101) 2023-08-01 15:24:02 +02:00
debug_diff.py isort all the things 2023-06-26 11:41:03 +02:00
debug_model.py isort all the things 2023-06-26 11:41:03 +02:00
download.py isort all the things 2023-06-26 11:41:03 +02:00
evaluate.py Accept multiple code files in all CLI commands (#12101) 2023-08-01 15:24:02 +02:00
find_threshold.py isort all the things 2023-06-26 11:41:03 +02:00
info.py isort all the things 2023-06-26 11:41:03 +02:00
init_config.py isort all the things 2023-06-26 11:41:03 +02:00
init_pipeline.py Merge branch 'upstream_master' into sync_v4 2023-07-19 16:37:31 +02:00
package.py Accept multiple code files in all CLI commands (#12101) 2023-08-01 15:24:02 +02:00
pretrain.py Accept multiple code files in all CLI commands (#12101) 2023-08-01 15:24:02 +02:00
profile.py isort all the things 2023-06-26 11:41:03 +02:00
train.py Accept multiple code files in all CLI commands (#12101) 2023-08-01 15:24:02 +02:00
validate.py isort all the things 2023-06-26 11:41:03 +02:00