From 817238918bbde918e3ad278cc6b6e0cb6604bf6a Mon Sep 17 00:00:00 2001 From: "Keto D. Zhang" Date: Fri, 15 Nov 2024 11:09:29 -0800 Subject: [PATCH] Remove example extension from package --- asdf_pydantic/examples/__init__.py | 0 asdf_pydantic/examples/extensions.py | 19 ------------------- asdf_pydantic/examples/shapes.py | 7 ------- asdf_pydantic/examples/tree.py | 17 ----------------- pyproject.toml | 3 --- 5 files changed, 46 deletions(-) delete mode 100644 asdf_pydantic/examples/__init__.py delete mode 100644 asdf_pydantic/examples/extensions.py delete mode 100644 asdf_pydantic/examples/shapes.py delete mode 100644 asdf_pydantic/examples/tree.py diff --git a/asdf_pydantic/examples/__init__.py b/asdf_pydantic/examples/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/asdf_pydantic/examples/extensions.py b/asdf_pydantic/examples/extensions.py deleted file mode 100644 index b79d4d9..0000000 --- a/asdf_pydantic/examples/extensions.py +++ /dev/null @@ -1,19 +0,0 @@ -from __future__ import annotations - -from asdf.extension import Extension - -from asdf_pydantic.converter import AsdfPydanticConverter -from asdf_pydantic.examples.shapes import AsdfRectangle -from asdf_pydantic.examples.tree import AsdfTreeNode - -AsdfPydanticConverter.add_models(AsdfRectangle, AsdfTreeNode) - - -class ExampleExtension(Extension): - extension_uri = "asdf://asdf-pydantic/examples/extensions/examples-1.0.0" - converters = [AsdfPydanticConverter()] # type: ignore - tags = [*AsdfPydanticConverter().tags] # type: ignore - - -def get_extensions() -> list[Extension]: - return [ExampleExtension()] diff --git a/asdf_pydantic/examples/shapes.py b/asdf_pydantic/examples/shapes.py deleted file mode 100644 index f47f07a..0000000 --- a/asdf_pydantic/examples/shapes.py +++ /dev/null @@ -1,7 +0,0 @@ -from asdf_pydantic import AsdfPydanticModel - - -class AsdfRectangle(AsdfPydanticModel): - _tag = "asdf://asdf-pydantic/examples/tags/rectangle-1.0.0" - width: float - height: float diff --git a/asdf_pydantic/examples/tree.py b/asdf_pydantic/examples/tree.py deleted file mode 100644 index d695f86..0000000 --- a/asdf_pydantic/examples/tree.py +++ /dev/null @@ -1,17 +0,0 @@ -from __future__ import annotations - -from typing import Optional, Union - -from pydantic import BaseModel - -from asdf_pydantic import AsdfPydanticModel - - -class Node(BaseModel): - child: Optional[Node] = None - - -class AsdfTreeNode(Node, AsdfPydanticModel): - _tag = "asdf://asdf-pydantic/examples/tags/tree-node-1.0.0" - - child: Optional[Union[AsdfTreeNode, Node]] = None diff --git a/pyproject.toml b/pyproject.toml index a5393e3..34148d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,9 +33,6 @@ Documentation = "https://asdf-pydantic.readthedocs.io" Issues = "https://github.com/ketozhang/asdf-pydantic/issues" Source = "https://github.com/ketozhang/asdf-pydantic" -[project.entry-points] -'asdf.extensions' = { asdf_pydantic_extension = 'asdf_pydantic.examples.extensions:get_extensions' } - [tool.hatch.version] source = "vcs"