Skip compat table tests for prerelease versions
import pytest
from click import NoSuchOption
+from packaging.specifiers import SpecifierSet
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.schemas import ProjectConfigSchema, RecommendationSchema, validate
@@ -492,6 +493,9 @@ def test_string_to_list_intify(value):
def test_download_compatibility():
+ spec = SpecifierSet("==" + about.__version__)
+ spec.prereleases = False
+ if about.__version__ in spec:
model_name = "en_core_web_sm"
compatibility = get_compatibility()
version = get_version(model_name, compatibility)
@@ -499,6 +503,9 @@ def test_download_compatibility():
def test_validate_compatibility_table():
+ spec = SpecifierSet("==" + about.__version__)
+ spec.prereleases = False
+ if about.__version__ in spec:
model_pkgs, compat = get_model_pkgs()
spacy_version = get_minor_version(about.__version__)
current_compat = compat.get(spacy_version, {})
