Skip to content

Commit ede8d5e

Browse files
committed
Deprecate FileManager
1 parent d5aa216 commit ede8d5e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/labthings_fastapi/file_manager.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Manage files created by Actions
22
3+
**This module is deprecated in favour of `labthings_fastapi.outputs.blob`**
4+
35
Simple actions return everything you need to know about them in their return value,
46
which can be serialised to JSON. More complicated actions might need to return
57
more complicated responses, for example files.
@@ -12,6 +14,7 @@
1214
from __future__ import annotations
1315
from tempfile import TemporaryDirectory
1416
from typing import Annotated, Sequence, Optional
17+
from warnings import warn
1518

1619
from fastapi import Depends, Request
1720

@@ -27,6 +30,10 @@ class FileManager:
2730
__globals__ = globals() # "bake in" globals so dependency injection works
2831

2932
def __init__(self, invocation_id: InvocationID, request: Request):
33+
warn(
34+
"FileManager is deprecated in favour of labthings_fastapi.outputs.blob",
35+
DeprecationWarning,
36+
)
3037
self.invocation_id = invocation_id
3138
self._links: set[tuple[str, str]] = set()
3239
self._dir = TemporaryDirectory(prefix=f"labthings-{self.invocation_id}-")

0 commit comments

Comments
 (0)