mirror of https://github.com/explosion/spaCy.git
Skip compat table tests for prerelease versions (#9476)
This commit is contained in:
parent
9a824255d3
commit
271e8e7856
|
@ -1,5 +1,6 @@
|
||||||
import pytest
|
import pytest
|
||||||
from click import NoSuchOption
|
from click import NoSuchOption
|
||||||
|
from packaging.specifiers import SpecifierSet
|
||||||
from spacy.training import docs_to_json, offsets_to_biluo_tags
|
from spacy.training import docs_to_json, offsets_to_biluo_tags
|
||||||
from spacy.training.converters import iob_to_docs, conll_ner_to_docs, conllu_to_docs
|
from spacy.training.converters import iob_to_docs, conll_ner_to_docs, conllu_to_docs
|
||||||
from spacy.schemas import ProjectConfigSchema, RecommendationSchema, validate
|
from spacy.schemas import ProjectConfigSchema, RecommendationSchema, validate
|
||||||
|
@ -492,18 +493,24 @@ def test_string_to_list_intify(value):
|
||||||
|
|
||||||
|
|
||||||
def test_download_compatibility():
|
def test_download_compatibility():
|
||||||
model_name = "en_core_web_sm"
|
spec = SpecifierSet("==" + about.__version__)
|
||||||
compatibility = get_compatibility()
|
spec.prereleases = False
|
||||||
version = get_version(model_name, compatibility)
|
if about.__version__ in spec:
|
||||||
assert get_minor_version(about.__version__) == get_minor_version(version)
|
model_name = "en_core_web_sm"
|
||||||
|
compatibility = get_compatibility()
|
||||||
|
version = get_version(model_name, compatibility)
|
||||||
|
assert get_minor_version(about.__version__) == get_minor_version(version)
|
||||||
|
|
||||||
|
|
||||||
def test_validate_compatibility_table():
|
def test_validate_compatibility_table():
|
||||||
model_pkgs, compat = get_model_pkgs()
|
spec = SpecifierSet("==" + about.__version__)
|
||||||
spacy_version = get_minor_version(about.__version__)
|
spec.prereleases = False
|
||||||
current_compat = compat.get(spacy_version, {})
|
if about.__version__ in spec:
|
||||||
assert len(current_compat) > 0
|
model_pkgs, compat = get_model_pkgs()
|
||||||
assert "en_core_web_sm" in current_compat
|
spacy_version = get_minor_version(about.__version__)
|
||||||
|
current_compat = compat.get(spacy_version, {})
|
||||||
|
assert len(current_compat) > 0
|
||||||
|
assert "en_core_web_sm" in current_compat
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("component_name", ["ner", "textcat", "spancat", "tagger"])
|
@pytest.mark.parametrize("component_name", ["ner", "textcat", "spancat", "tagger"])
|
||||||
|
|
Loading…
Reference in New Issue