spaCy/spacy/cli
Paul O'Leary McCann ac05de2c6c
Fix Language-specific factory handling in package command (#9674)
* Use internal names for factories

If a component factory is registered like `@French.factory(...)` instead
of `@Language.factory(...)`, the name in the factories registry will be
prefixed with the language code. However in the nlp.config object the
factory will be listed without the language code. The `add_pipe` code
has fallback logic to handle this, but packaging code and the registry
itself don't.

This change makes it so that the factory name in nlp.config is the
language-specific form. It's not clear if this will break anything else,
but it does seem to fix the inconsistency and resolve the specific user
issue that brought this to our attention.

* Change approach to use fallback in package lookup

This adds fallback logic to the package lookup, so it doesn't have to
touch the way the config is built. It seems to fix the tests too.

* Remove unecessary line

* Add test

Thsi also adds an assert that seems to have been forgotten.
2021-11-29 08:31:02 +01:00
..
project 🏷 Add Mypy check to CI and ignore all existing Mypy errors (#9167) 2021-10-14 15:21:40 +02:00
templates Fix tok2vec-less textcat generation in website quickstart (#9610) 2021-11-03 15:11:07 +01:00
__init__.py assemble CLI command (#7783) 2021-04-19 18:39:11 +10:00
_util.py 🏷 Add Mypy check to CI and ignore all existing Mypy errors (#9167) 2021-10-14 15:21:40 +02:00
assemble.py Tidy up with flake8: imports, comparisons, etc. 2021-06-28 12:08:15 +02:00
convert.py Minor fixes to convert CLI (#9465) 2021-10-14 18:37:34 +02:00
debug_config.py Add --code to spacy debug CLI 2021-03-12 09:51:26 +01:00
debug_data.py Remove some old version refs in the docs (#9448) 2021-10-21 11:17:59 +02:00
debug_model.py Tidy up with flake8: imports, comparisons, etc. 2021-06-28 12:08:15 +02:00
download.py Use minor version for compatibility check (#8403) 2021-06-21 09:39:22 +02:00
evaluate.py 🏷 Add Mypy check to CI and ignore all existing Mypy errors (#9167) 2021-10-14 15:21:40 +02:00
info.py 🏷 Add Mypy check to CI and ignore all existing Mypy errors (#9167) 2021-10-14 15:21:40 +02:00
init_config.py 🏷 Add Mypy check to CI and ignore all existing Mypy errors (#9167) 2021-10-14 15:21:40 +02:00
init_pipeline.py Add support for floret vectors (#8909) 2021-10-27 14:08:31 +02:00
package.py Fix Language-specific factory handling in package command (#9674) 2021-11-29 08:31:02 +01:00
pretrain.py Check if the resume path points to a directory (#7919) 2021-04-28 09:17:15 +02:00
profile.py 🏷 Add Mypy check to CI and ignore all existing Mypy errors (#9167) 2021-10-14 15:21:40 +02:00
train.py Add docs section for spacy.cli.train.train (#9545) 2021-10-29 10:36:34 +02:00
validate.py 🏷 Add Mypy check to CI and ignore all existing Mypy errors (#9167) 2021-10-14 15:21:40 +02:00