mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-10 19:57:17 +03:00
WIP: improve model version deps
This commit is contained in:
parent
a44d51a3d8
commit
4fd087572a
|
@ -138,7 +138,7 @@ def list_files(data_dir):
|
|||
|
||||
def list_requirements(meta):
|
||||
parent_package = meta.get('parent_package', 'spacy')
|
||||
requirements = [parent_package + meta['spacy_version']]
|
||||
requirements = [parent_package + '>=' + meta['spacy_version']]
|
||||
if 'setup_requires' in meta:
|
||||
requirements += meta['setup_requires']
|
||||
if 'requirements' in meta:
|
||||
|
|
|
@ -265,6 +265,15 @@ def is_compatible_model(meta):
|
|||
return True
|
||||
|
||||
|
||||
def get_model_version_range(version):
|
||||
"""Generate a version range like >=1.2.3,<1.3.0 based on a given spaCy
|
||||
version. Models are always compatible across patch versions but not
|
||||
across minor or major versions.
|
||||
"""
|
||||
major, minor = split_version(version)
|
||||
return f">={version},<{major}.{minor + 1}.0"
|
||||
|
||||
|
||||
def load_config(path, create_objects=False):
|
||||
"""Load a Thinc-formatted config file, optionally filling in objects where
|
||||
the config references registry entries. See "Thinc config files" for details.
|
||||
|
|
Loading…
Reference in New Issue
Block a user