mirror of https://github.com/explosion/spaCy.git
Fix DVC check
This commit is contained in:
parent
5ba1df5e78
commit
1e5b4d8524
|
@ -3,6 +3,7 @@ import typer
|
||||||
import srsly
|
import srsly
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from wasabi import msg
|
from wasabi import msg
|
||||||
|
import subprocess
|
||||||
import shlex
|
import shlex
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
@ -28,12 +29,11 @@ project_cli = typer.Typer(help="Command-line interface for spaCy projects")
|
||||||
@project_cli.callback(invoke_without_command=True)
|
@project_cli.callback(invoke_without_command=True)
|
||||||
def callback():
|
def callback():
|
||||||
# This runs before every project command and ensures DVC is installed
|
# This runs before every project command and ensures DVC is installed
|
||||||
# TODO: check for "dvc" command instead of Python library?
|
|
||||||
try:
|
try:
|
||||||
import dvc # noqa: F401
|
subprocess.run(["dvc", "--version"], stdout=subprocess.DEVNULL)
|
||||||
except ImportError:
|
except Exception:
|
||||||
msg.fail(
|
msg.fail(
|
||||||
"spaCy projects require DVC (Data Version Control)",
|
"spaCy projects require DVC (Data Version Control) and the 'dvc' command",
|
||||||
"You can install the Python package from pip (pip install dvc) or "
|
"You can install the Python package from pip (pip install dvc) or "
|
||||||
"conda (conda install -c conda-forge dvc). For more details, see the "
|
"conda (conda install -c conda-forge dvc). For more details, see the "
|
||||||
"documentation: https://dvc.org/doc/install",
|
"documentation: https://dvc.org/doc/install",
|
||||||
|
|
Loading…
Reference in New Issue