From 0fe7430491fe7b54c8ffa089d6321729868e982e Mon Sep 17 00:00:00 2001 From: aballman <35912177+aballman@users.noreply.github.com> Date: Wed, 20 May 2026 14:22:38 -0700 Subject: [PATCH 1/2] chore: deprecate wrap_in_fastapi via PEP 702 @deprecated Mark wrap_in_fastapi (and the etl-uvicorn CLI it backs) as deprecated. New plugins should hand-roll a FastAPI app with explicit /invoke, /schema, /precheck, /id, and /ready handlers; chunker is the reference pattern. Adds the typing_extensions.deprecated decorator (IDE/type-checker strikethrough + runtime DeprecationWarning), a README banner, and a CHANGELOG entry. Bumps version to 0.0.43. --- CHANGELOG.md | 4 ++++ README.md | 5 +++++ unstructured_platform_plugins/__version__.py | 2 +- unstructured_platform_plugins/etl_uvicorn/api_generator.py | 6 ++++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da6e9ed..1b0c06a 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 hand-roll their own FastAPI app — see the `chunker` plugin in `platform-plugins` for the reference pattern. + ## 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..1d4d872 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,11 @@ # 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 hand-roll their own FastAPI app with +> explicit `/invoke`, `/schema`, `/precheck`, `/id`, and `/ready` handlers. +> The `chunker` plugin in `platform-plugins` is the reference pattern. + 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..221427e 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,11 @@ def update_filedata_model(new_type) -> BaseModel: return new_filedata_model +@deprecated( + "wrap_in_fastapi is deprecated; hand-roll a FastAPI app instead. " + "See platform_plugins/plugins/chunker for the reference pattern " + "(explicit /invoke, /schema, /precheck, /id, /ready handlers)." +) def wrap_in_fastapi( func: Callable, plugin_id: str, From 5276d7e4533480ea27fa81624eda1c64a47f829f Mon Sep 17 00:00:00 2001 From: aballman <35912177+aballman@users.noreply.github.com> Date: Wed, 20 May 2026 14:48:28 -0700 Subject: [PATCH 2/2] chore: remove references to private repos from deprecation copy --- CHANGELOG.md | 2 +- README.md | 5 ++--- unstructured_platform_plugins/etl_uvicorn/api_generator.py | 5 ++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b0c06a..aa60819 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## 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 hand-roll their own FastAPI app — see the `chunker` plugin in `platform-plugins` for the reference pattern. +* **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 diff --git a/README.md b/README.md index 1d4d872..70f01ec 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,8 @@ ![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 hand-roll their own FastAPI app with -> explicit `/invoke`, `/schema`, `/precheck`, `/id`, and `/ready` handlers. -> The `chunker` plugin in `platform-plugins` is the reference pattern. +> 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. diff --git a/unstructured_platform_plugins/etl_uvicorn/api_generator.py b/unstructured_platform_plugins/etl_uvicorn/api_generator.py index 221427e..06e0074 100644 --- a/unstructured_platform_plugins/etl_uvicorn/api_generator.py +++ b/unstructured_platform_plugins/etl_uvicorn/api_generator.py @@ -110,9 +110,8 @@ def update_filedata_model(new_type) -> BaseModel: @deprecated( - "wrap_in_fastapi is deprecated; hand-roll a FastAPI app instead. " - "See platform_plugins/plugins/chunker for the reference pattern " - "(explicit /invoke, /schema, /precheck, /id, /ready handlers)." + "wrap_in_fastapi is deprecated; build a FastAPI app directly with " + "explicit handlers for the plugin contract routes." ) def wrap_in_fastapi( func: Callable,