diff --git a/CHANGELOG.md b/CHANGELOG.md index ea3eff76a5fe0aa9a5bb912ef0002f82f2508248..b92ebce6de44057c5166d1a0d8a181a74574c8a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed ### +* The deprecated `parent` keyword from the YAML datamodel specification. Use + `inherit_from_{obligatory|recommended|suggested}` instead. + ### Fixed ### - Json schema exporter handles reference properties better. diff --git a/src/caosadvancedtools/models/parser.py b/src/caosadvancedtools/models/parser.py index 37f34e7bcbae48188c96b9bea6434d59571020fd..fa21aa13b1ee666a36d94280865835b922d6c721 100644 --- a/src/caosadvancedtools/models/parser.py +++ b/src/caosadvancedtools/models/parser.py @@ -52,9 +52,7 @@ from linkahead.common.datatype import get_list_datatype from .data_model import CAOSDB_INTERNAL_PROPERTIES, DataModel # Keywords which are allowed in data model descriptions. -KEYWORDS = ["parent", # deprecated, use inherit_from_* instead: - # https://gitlab.com/caosdb/caosdb-advanced-user-tools/-/issues/36 - "importance", +KEYWORDS = ["importance", "datatype", # for example TEXT, INTEGER or REFERENCE "unit", "description", @@ -595,16 +593,6 @@ debug : bool, optional self._inherit(name, prop, db.RECOMMENDED) elif prop_name == "inherit_from_suggested": self._inherit(name, prop, db.SUGGESTED) - elif prop_name == "parent": - warn( - DeprecationWarning( - "The `parent` keyword is deprecated and will be " - "removed in a future version. Use " - "`inherit_from_{obligatory|recommended|suggested}` " - "instead." - ) - ) - self._inherit(name, prop, db.OBLIGATORY) else: raise ValueError("invalid keyword: {}".format(prop_name)) diff --git a/src/doc/index.rst b/src/doc/index.rst index 6c2c5f9894ad5c0f5dc3f124de726d264f46d452..15a7b7ab7773f00149a58d948e3086775a059214 100644 --- a/src/doc/index.rst +++ b/src/doc/index.rst @@ -17,6 +17,8 @@ This documentation helps you to :doc:`get started<getting_started>`, explains th YAML data model specification <yaml_interface> Specifying a datamodel with JSON schema <json_schema_interface> _apidoc/modules + Related Projects <related_projects/index> + Back to overview <https://docs.indiscale.com/> diff --git a/src/doc/related_projects/index.rst b/src/doc/related_projects/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..87808b4264dfdd37dfa162025b24d31e63de7083 --- /dev/null +++ b/src/doc/related_projects/index.rst @@ -0,0 +1,25 @@ +Related Projects +++++++++++++++++ + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + :hidden: + +.. container:: projects + + For in-depth documentation for users, administrators and developers, you may want to visit the subproject-specific documentation pages for: + + :`Server <https://docs.indiscale.com/caosdb-server/>`_: The Java part of the LinkAhead server. + + :`MySQL backend <https://docs.indiscale.com/caosdb-mysqlbackend/>`_: The MySQL/MariaDB components of the LinkAhead server. + + :`WebUI <https://docs.indiscale.com/caosdb-webui/>`_: The default web frontend for the LinkAhead server. + + :`PyLinkAhead <https://docs.indiscale.com/caosdb-pylib/>`_: The LinkAhead Python library. + + :`LinkAhead Crawler <https://docs.indiscale.com/caosdb-crawler/>`_: The crawler is the main tool for automatic data integration in LinkAhead. + + :`LinkAhead <https://docs.indiscale.com/caosdb-deploy>`_: Your all inclusive LinkAhead software package. + + :`Back to Overview <https://docs.indiscale.com/>`_: LinkAhead Documentation. diff --git a/src/doc/yaml_interface.rst b/src/doc/yaml_interface.rst index ac3914385d31df5a306b3f8400fbcb6b005f17fa..48e27802e72177424fd2c6258492b283bbff0d3b 100644 --- a/src/doc/yaml_interface.rst +++ b/src/doc/yaml_interface.rst @@ -109,7 +109,6 @@ Keywords added as parents, and all Properties with at least the importance ``XXX`` are inherited. For example, ``inherited_from_recommended`` will inherit all Properties of importance ``recommended`` and ``obligatory``, but not ``suggested``. -- **parent**: Parent of this entity. Same as ``inherit_from_obligatory``. (*Deprecated*) Usage ===== diff --git a/unittests/test_yaml_model_parser.py b/unittests/test_yaml_model_parser.py index c66fef131f34e33c19335f5fd1e5858dec4b3e24..97c3450f654e7b836734335cafac37adc6e700bb 100644 --- a/unittests/test_yaml_model_parser.py +++ b/unittests/test_yaml_model_parser.py @@ -19,7 +19,7 @@ import unittest from datetime import date from tempfile import NamedTemporaryFile -from pytest import deprecated_call, raises, mark +from pytest import raises, mark import linkahead as db from caosadvancedtools.models.parser import (TwiceDefinedException, @@ -527,7 +527,7 @@ F: def test_issue_36(): - """Test whether the `parent` keyword is deprecated. + """Test whether the `parent` keyword is removed. See https://gitlab.com/caosdb/caosdb-advanced-user-tools/-/issues/36. @@ -550,17 +550,12 @@ R3: inherit_from_obligatory: - R1 """ - with deprecated_call(): - # Check whether this is actually deprecated + with raises(ValueError) as ve: + # The keyword has been removed, so it should raise a regular ValueError. model = parse_model_from_string(model_string) - assert "R3" in model - r3 = model["R3"] - assert isinstance(r3, db.RecordType) - for par in ["R1", "R2"]: - # Until removal, both do the same - assert has_parent(r3, par) - assert r3.get_parent(par)._flags["inheritance"] == db.OBLIGATORY + assert "invalid keyword" in str(ve.value) + assert "parent" in str(ve.value) def test_yaml_error():