spacy package CLI command accepts list of code_paths, but the others do not
- Dominant language
- Python
- Stars
- 33.9k
- Forks
- 4.7k
- Avg merge
- 3m
- Merged PRs (30d)
- 1
Description
I recently started a new spaCy project and decided not to create a separate Python module with all the custom code. While I can pass a comma-separated list of code paths to the [spacy package](https://spacy.io/api/cli#package) command, other CLI commands such as [spacy train](https://spacy.io/api/cli#train) and [spacy assemble](https://spacy.io/api/cli#assemble) only accept a single value for the `--code` option. This makes it impossible to build a project with more than one code file, even though it's possible to assemble one with multiple files.
It would be really helpful if all the spaCy CLI commands accepted a comma-separated list for the `--code` option. Otherwise, all the code has to be stuffed into a single file.
The `--code` option exists in the following commands:
* [debug](https://spacy.io/api/cli#debug)
* [train](https://spacy.io/api/cli#train)
* [pretrain](https://spacy.io/api/cli#pretrain)
* [evaluate](https://spacy.io/api/cli#evaluate)
* [assemble](https://spacy.io/api/cli#assemble)
* [package](https://spacy.io/api/cli#package) (accepts comma-separated list)
## How to reproduce the behaviour
**OK**:
```sh
spacy package --code file_a.py,file_b.py …
```
The comma-separated value to the `--code` option is split and all the code files are loaded ([package.py#L48](https://github.com/explosion/spaCy/blob/18ffe5bbd6a554920107ff48d1387df34c3f872a/spacy/cli/package.py#L48)).
**Not OK**:
```sh
spacy assemble --code file_a.py,file_b.py …
Path to Python code not found
```
The comma-separated value to the `--code` option is used as the literal path, which fails to load ([assemble.py#L41](https://github.com/explosion/spaCy/blob/18ffe5bbd6a554920107ff48d1387df34c3f872a/spacy/cli/assemble.py#L41)).
## Your Environment
* Operating System: macOS Ventura 13.1 (22C65)
* Python Version Used: 3.10.9
* spaCy Version Used: 3.4.3
* Environment Information:
Contributor guide
Assessment
This issue has not been assessed yet.