diff --git a/CHANGELOG.md b/CHANGELOG.md index da6e9ed..aa60819 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.43 + +* **Deprecate `wrap_in_fastapi`** - Mark `wrap_in_fastapi` (and the `etl-uvicorn` CLI it backs) as deprecated via PEP 702 `@deprecated`. New plugins should build a FastAPI app directly with explicit handlers for the plugin contract routes. + ## 0.0.42 * **Support "none" value for OTEL_TRACES_EXPORTER and OTEL_METRICS_EXPORTER** - Filter "none" from exporter lists and return None when no exporters configured to properly disable OpenTelemetry instrumentation diff --git a/README.md b/README.md index b0f5b1c..70f01ec 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ # Unstructured Platform Plugins ![CI](https://github.com/Unstructured-IO/unstructured-platform-plugins/actions/workflows/ci.yml/badge.svg?branch=main) +> **Deprecation notice:** `wrap_in_fastapi` (and the `etl-uvicorn` CLI it backs) +> is deprecated. New plugins should build a FastAPI app directly with explicit +> handlers for the plugin contract routes (`/invoke`, `/schema`, `/id`, etc.). + Information about how to build custom plugins to integrate with Unstructured Platform. ## Plugin Development diff --git a/unstructured_platform_plugins/__version__.py b/unstructured_platform_plugins/__version__.py index 89da183..9c0e950 100644 --- a/unstructured_platform_plugins/__version__.py +++ b/unstructured_platform_plugins/__version__.py @@ -1 +1 @@ -__version__ = "0.0.42" # pragma: no cover +__version__ = "0.0.43" # pragma: no cover diff --git a/unstructured_platform_plugins/etl_uvicorn/api_generator.py b/unstructured_platform_plugins/etl_uvicorn/api_generator.py index 4e9c119..06e0074 100644 --- a/unstructured_platform_plugins/etl_uvicorn/api_generator.py +++ b/unstructured_platform_plugins/etl_uvicorn/api_generator.py @@ -11,6 +11,7 @@ from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor from pydantic import BaseModel, Field, create_model from starlette.responses import RedirectResponse +from typing_extensions import deprecated from unstructured_ingest.data_types.file_data import BatchFileData, FileData, file_data_from_dict from unstructured_ingest.error import UnstructuredIngestError from uvicorn.config import LOG_LEVELS @@ -108,6 +109,10 @@ def update_filedata_model(new_type) -> BaseModel: return new_filedata_model +@deprecated( + "wrap_in_fastapi is deprecated; build a FastAPI app directly with " + "explicit handlers for the plugin contract routes." +) def wrap_in_fastapi( func: Callable, plugin_id: str,