diff --git a/README.md b/README.md index 724a19db8..784ec89ad 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ -# Snips NLU (0.8.6) +# Snips NLU (0.8.7) [![Build Status](https://jenkins2.snips.ai/buildStatus/icon?job=SDK/snips-nlu/master)](https://jenkins2.snips.ai/job/SDK/job/snips-nlu/view/Branches/job/master) +**Model Version (0.8.5)** + ## Production Use Python wheels of the `snips-nlu` package can be found on the nexus repository at this URL: https://nexus-repository.snips.ai/#browse/browse/components:pypi-internal @@ -106,3 +108,12 @@ engine.fitted # True ``` where `dataset` is a dictionary which format is described [here](https://github.com/snipsco/snips-nlu/blob/develop/snips_nlu/tests/resources/sample_dataset.json) + +### Versioning +The NLU Engine has a separated versioning for the underlying model: +``` python +import snips_nlu + +model_version = snips_nlu.__model_version__ +python_package_version = snips_nlu.__version__ +``` diff --git a/snips_nlu/__init__.py b/snips_nlu/__init__.py index 20e2decc4..e2db63a9f 100644 --- a/snips_nlu/__init__.py +++ b/snips_nlu/__init__.py @@ -6,6 +6,8 @@ from snips_nlu.resources import load_resources from snips_nlu.utils import ROOT_PATH, PACKAGE_NAME +__model_version__ = "0.8.5" + VERSION_FILE_NAME = "__version__" with io.open(os.path.join(ROOT_PATH, PACKAGE_NAME, VERSION_FILE_NAME)) as f: diff --git a/snips_nlu/__version__ b/snips_nlu/__version__ index 120f53215..35864a97f 100644 --- a/snips_nlu/__version__ +++ b/snips_nlu/__version__ @@ -1 +1 @@ -0.8.6 \ No newline at end of file +0.8.7 \ No newline at end of file diff --git a/snips_nlu/tests/test_version.py b/snips_nlu/tests/test_version.py index ae0aaf15c..b3b33849c 100644 --- a/snips_nlu/tests/test_version.py +++ b/snips_nlu/tests/test_version.py @@ -2,7 +2,7 @@ from semantic_version import Version -from snips_nlu import __version__ +from snips_nlu import __version__, __model_version__ class TestVersion(unittest.TestCase): @@ -20,3 +20,18 @@ def version_should_be_semantic(self): # Then self.assertTrue(valid, "Version number '%s' is not semantically valid") + + def model_version_should_be_semantic(self): + # Given + model_version = __model_version__ + + # When + valid = False + try: + Version(model_version) + valid = True + except ValueError: + pass + + # Then + self.assertTrue(valid, "Version number '%s' is not semantically valid")