Fix installed model URL method and CI test

This commit is contained in:
Adriane Boyd 2023-03-06 12:11:06 +01:00
parent 586ec16114
commit e106e502bb
2 changed files with 3 additions and 3 deletions

View File

@ -60,8 +60,8 @@ steps:
condition: eq(variables['python_version'], '3.8')
- script: |
python -W error -m spacy info ca_core_news_sm --url
displayName: 'Test info --url CLI'
python -W error -m spacy info ca_core_news_sm | grep -q download_url
displayName: 'Test download_url in info CLI'
condition: eq(variables['python_version'], '3.8')
- script: |

View File

@ -138,7 +138,7 @@ def info_installed_model_url(model: str) -> Optional[str]:
"""
try:
dist = importlib_metadata.distribution(model)
data = dist.read_text("direct_url.json")
data = json.loads(dist.read_text("direct_url.json"))
return data["url"]
except importlib_metadata.PackageNotFoundError:
# no such package