diff --git a/CHANGES.rst b/CHANGES.rst index 9f4a1b52f..51707099c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -15,6 +15,7 @@ The ASDF Standard is at v1.6.0 by returning ``None`` in ``Converter.select_tag`` [#1561] - Remove deprecated tests.helpers [#1597] - Remove deprecated load_custom_schema [#1596] +- Remove deprecated TagDefinition.schema_uri [#1595] 2.15.1 (2023-08-07) ------------------- diff --git a/asdf/_tests/test_extension.py b/asdf/_tests/test_extension.py index 6adc39a6b..d92d0041b 100644 --- a/asdf/_tests/test_extension.py +++ b/asdf/_tests/test_extension.py @@ -462,9 +462,6 @@ def test_tag_definition(): assert "URI: asdf://somewhere.org/extensions/foo/tags/foo-1.0" in repr(tag_def) - with pytest.warns(AsdfDeprecationWarning, match=r"The .* property is deprecated.*"): - assert tag_def.schema_uri == "asdf://somewhere.org/extensions/foo/schemas/foo-1.0" - tag_def = TagDefinition( "asdf://somewhere.org/extensions/foo/tags/foo-1.0", schema_uris=[ @@ -479,11 +476,6 @@ def test_tag_definition(): "asdf://somewhere.org/extensions/foo/schemas/foo-1.0", "asdf://somewhere.org/extensions/foo/schemas/base-1.0", ] - with pytest.warns(AsdfDeprecationWarning, match=r"The .* property is deprecated.*"), pytest.raises( - RuntimeError, - match=r"Cannot use .* when multiple schema URIs are present", - ): - tag_def.schema_uri with pytest.raises(ValueError, match=r"URI patterns are not permitted in TagDefinition"): TagDefinition("asdf://somewhere.org/extensions/foo/tags/foo-*") diff --git a/asdf/extension/_tag.py b/asdf/extension/_tag.py index 5072567aa..e96c4e67f 100644 --- a/asdf/extension/_tag.py +++ b/asdf/extension/_tag.py @@ -1,8 +1,3 @@ -import warnings - -from asdf.exceptions import AsdfDeprecationWarning - - class TagDefinition: """ Container for properties of a custom YAML tag. @@ -11,7 +6,7 @@ class TagDefinition: ---------- tag_uri : str Tag URI. - schema_uri : str, optional + schema_uris : str, optional URI of the schema that should be used to validate objects with this tag. title : str, optional @@ -50,32 +45,6 @@ def tag_uri(self): """ return self._tag_uri - @property - def schema_uri(self): - """ - DEPRECATED - - Get the URI of the schema that should be used to validate - objects with this tag. - - Returns - ------- - str or None - """ - warnings.warn( - "The TagDefinition.schema_uri property is deprecated. Use TagDefinition.schema_uris instead.", - AsdfDeprecationWarning, - ) - - if len(self._schema_uris) == 0: - return None - - if len(self._schema_uris) == 1: - return self._schema_uris[0] - - msg = "Cannot use TagDefinition.schema_uri when multiple schema URIs are present" - raise RuntimeError(msg) - @property def schema_uris(self): """ diff --git a/docs/asdf/extending/extensions.rst b/docs/asdf/extending/extensions.rst index 19c09f765..4a7303f3a 100644 --- a/docs/asdf/extending/extensions.rst +++ b/docs/asdf/extending/extensions.rst @@ -86,7 +86,7 @@ instead of just a string: tags = [ TagDefinition( "asdf://example.com/example-project/tags/foo-1.0.0", - schema_uri="asdf://example.com/example-project/schemas/foo-1.0.0", + schema_uris=["asdf://example.com/example-project/schemas/foo-1.0.0"], ) ] converters = [FooConverter()]