Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 49 additions & 47 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# uv pip compile dev-requirements.in -o dev-requirements.txt
-e .
# via -r dev-requirements.in
agent-detector==2.0.0
# via fastapi-cloud-cli
alabaster==1.0.0
# via sphinx
annotated-doc==0.0.5
Expand All @@ -10,7 +12,7 @@ annotated-doc==0.0.5
# typer
annotated-types==0.8.0
# via pydantic
anyio==4.14.2
anyio==4.15.1
# via
# httpx
# httpx2
Expand All @@ -21,7 +23,7 @@ apeye==1.4.1
# via sphinx-toolbox
apeye-core==1.1.5
# via apeye
astroid==4.1.2
astroid==4.3.4
# via sphinx-autoapi
attrs==26.1.0
# via
Expand All @@ -44,18 +46,18 @@ certifi==2026.7.22
# sentry-sdk
# sphinx-prompt
# sphobjinv
charset-normalizer==3.4.9
charset-normalizer==3.5.2
# via requests
click==8.4.2
click==8.5.0
# via
# pydoclint
# rich-toolkit
# uvicorn
codespell==2.4.3
# via labthings-fastapi
coverage==7.15.3
coverage==7.16.2
# via pytest-cov
detect-installer==0.1.0
detect-installer==0.2.1
# via fastapi-cloud-cli
dict2css==0.6.0
# via sphinx-toolbox
Expand Down Expand Up @@ -90,15 +92,15 @@ fastapi==0.135.4
# via labthings-fastapi
fastapi-cli==0.0.32
# via fastapi
fastapi-cloud-cli==0.23.0
fastapi-cloud-cli==0.26.0
# via fastapi-cli
fastar==0.11.0
fastar==0.12.0
# via fastapi-cloud-cli
filelock==3.32.2
filelock==4.0.12
# via
# cachecontrol
# sphinx-toolbox
flake8==7.3.0
flake8==7.4.1
# via
# flake8-pyproject
# flake8-rst
Expand All @@ -120,17 +122,17 @@ html5lib==1.1
# via sphinx-toolbox
httpcore==1.0.9
# via httpx
httpcore2==2.9.1
httpcore2==2.13.1
# via httpx2
httptools==0.8.0
# via uvicorn
httpx==0.28.1
# via
# fastapi
# fastapi-cloud-cli
httpx2==2.9.1
httpx2==2.13.1
# via labthings-fastapi
idna==3.18
idna==3.20
# via
# anyio
# apeye-core
Expand All @@ -141,9 +143,9 @@ idna==3.18
# sphinx-prompt
ifaddr==0.2.0
# via zeroconf
imagesize==2.0.0
imagesize==2.0.1
# via sphinx
iniconfig==2.3.0
iniconfig==2.3.1
# via pytest
itsdangerous==2.2.0
# via fastapi
Expand All @@ -160,14 +162,14 @@ jsonschema==4.26.0
# sphobjinv
jsonschema-specifications==2025.9.1
# via jsonschema
librt==0.13.0
librt==0.16.0
# via mypy
markdown-it-py==3.0.0
# via
# mdit-py-plugins
# myst-parser
# rich
markupsafe==3.0.3
markupsafe==3.0.4
# via
# jinja2
# sphinx-jinja2-compat
Expand All @@ -177,7 +179,7 @@ mdit-py-plugins==0.6.1
# via myst-parser
mdurl==0.1.2
# via markdown-it-py
msgpack==1.2.1
msgpack==1.2.3
# via cachecontrol
mypy==1.20.2
# via labthings-fastapi
Expand All @@ -189,40 +191,40 @@ natsort==8.4.0
# via domdf-python-tools
numpy==2.2.6
# via labthings-fastapi
packaging==26.2
packaging==26.3
# via
# pytest
# sphinx
pathspec==1.1.1
# via mypy
pillow==12.3.0
# via labthings-fastapi
platformdirs==4.11.0
platformdirs==4.12.4
# via apeye
pluggy==1.6.0
# via
# pytest
# pytest-cov
pycodestyle==2.14.0
pycodestyle==2.15.0
# via flake8
pydantic==2.13.4
pydantic==2.14.0
# via
# fastapi
# fastapi-cloud-cli
# labthings-fastapi
# pydantic-extra-types
# pydantic-settings
pydantic-core==2.46.4
pydantic-core==2.50.0
# via pydantic
pydantic-extra-types==2.11.1
# via fastapi
pydantic-settings==2.14.2
pydantic-settings==2.15.0
# via fastapi
pydoclint==0.9.1
pydoclint==0.11.0
# via labthings-fastapi
pyflakes==3.4.0
pyflakes==4.0.3
# via flake8
pygments==2.20.0
pygments==2.21.0
# via
# flake8-rst-docstrings
# pytest
Expand All @@ -237,9 +239,9 @@ pytest==9.1.1
# pytest-mock
pytest-cov==7.1.0
# via labthings-fastapi
pytest-mock==3.15.1
pytest-mock==3.16.0
# via labthings-fastapi
python-dotenv==1.2.2
python-dotenv==1.2.4
# via
# pydantic-settings
# uvicorn
Expand Down Expand Up @@ -267,11 +269,11 @@ rich==15.0.0
# via
# rich-toolkit
# typer
rich-toolkit==0.20.3
rich-toolkit==0.20.6
# via
# fastapi-cli
# fastapi-cloud-cli
rignore==0.8.0
rignore==0.8.1
# via fastapi-cloud-cli
roman==5.2
# via sphinx-toolbox
Expand All @@ -281,17 +283,17 @@ rpds-py==0.30.0
# referencing
ruamel-yaml==0.19.1
# via sphinx-toolbox
ruff==0.16.1
ruff==0.16.10
# via labthings-fastapi
sentry-sdk==2.66.1
sentry-sdk==2.71.0
# via fastapi-cloud-cli
shellingham==1.5.4
# via typer
six==1.17.0
# via html5lib
snowballstemmer==3.1.1
# via sphinx
soupsieve==2.9.1
soupsieve==2.10
# via beautifulsoup4
sphinx==8.1.3
# via
Expand All @@ -305,7 +307,7 @@ sphinx==8.1.3
# sphinx-tabs
# sphinx-toolbox
# sphinxcontrib-jquery
sphinx-autoapi==3.8.0
sphinx-autoapi==3.8.1
# via labthings-fastapi
sphinx-autodoc-typehints==3.0.1
# via sphinx-toolbox
Expand All @@ -317,7 +319,7 @@ sphinx-rtd-theme==3.1.0
# via labthings-fastapi
sphinx-tabs==3.5.0
# via sphinx-toolbox
sphinx-toolbox==4.3.0
sphinx-toolbox==4.3.1
# via labthings-fastapi
sphinxcontrib-applehelp==2.0.0
# via sphinx
Expand All @@ -335,13 +337,13 @@ sphinxcontrib-serializinghtml==2.0.0
# via sphinx
sphobjinv==2.4
# via labthings-fastapi
starlette==1.3.1
starlette==1.7.0
# via fastapi
tabulate==0.10.0
# via sphinx-toolbox
tinycss2==1.5.1
# via dict2css
tomli==2.4.1
tomli==2.5.0
# via
# coverage
# fastapi-cli
Expand All @@ -355,11 +357,11 @@ truststore==0.10.4
# via
# httpcore2
# httpx2
typer==0.27.1
typer==0.27.3
# via
# fastapi-cli
# fastapi-cloud-cli
types-jsonschema==4.26.0.20260518
types-jsonschema==4.26.0.20261006
# via labthings-fastapi
typing-extensions==4.16.0
# via
Expand All @@ -381,30 +383,30 @@ typing-extensions==4.16.0
# starlette
# typing-inspection
# uvicorn
typing-inspection==0.4.2
typing-inspection==0.4.4
# via
# fastapi
# pydantic
# pydantic-settings
urllib3==2.7.0
urllib3==2.8.0
# via
# requests
# sentry-sdk
# sphinx-prompt
uvicorn==0.52.1
uvicorn==0.54.0
# via
# fastapi
# fastapi-cli
# fastapi-cloud-cli
uvloop==0.22.1
uvloop==0.23.0
# via uvicorn
watchfiles==1.2.0
watchfiles==1.3.0
# via uvicorn
webencodings==0.5.1
webencodings==0.6.1
# via
# html5lib
# tinycss2
websockets==16.1.1
# via uvicorn
zeroconf==0.150.0
zeroconf==0.151.5
# via labthings-fastapi
8 changes: 7 additions & 1 deletion src/labthings_fastapi/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,8 +598,8 @@
with self._invocations_lock:
try:
invocation: Any = self._invocations[id]
except KeyError as e:
raise HTTPException(

Check warning on line 602 in src/labthings_fastapi/actions.py

View workflow job for this annotation

GitHub Actions / coverage

601-602 lines are not covered with tests
status_code=404,
detail="No action invocation found with ID {id}",
) from e
Expand All @@ -612,7 +612,7 @@
invocation.output.response
):
# TODO: honour "accept" header
return invocation.output.response()

Check warning on line 615 in src/labthings_fastapi/actions.py

View workflow job for this annotation

GitHub Actions / coverage

615 line is not covered with tests
try:
return serialise_from_user_code(
model_instance=invocation.output_model_instance,
Expand Down Expand Up @@ -648,8 +648,8 @@
with self._invocations_lock:
try:
invocation: Any = self._invocations[id]
except KeyError as e:
raise HTTPException(

Check warning on line 652 in src/labthings_fastapi/actions.py

View workflow job for this annotation

GitHub Actions / coverage

651-652 lines are not covered with tests
status_code=404,
detail="No action invocation found with ID {id}",
) from e
Expand Down Expand Up @@ -827,7 +827,13 @@
f"{name}_invocation",
__base__=InvocationModel,
input=(self.input_model, ...),
output=(Optional[self.output_model], None),
output=(Optional[self.output_model], None), # type: ignore[arg-type]
# mypy spuriously flags this as incorrect. I think this is another
# example of https://github.com/pydantic/pydantic/issues/3585
# where the `pydantic` lead dev suggests using Any. As that's
# equivalent to adding an ignore, I've just added the ignore, as
# I think it's less confusing than going via a variable that's
# typed as `Any`.
)
self.invocation_model.__name__ = f"{name}_invocation"

Expand All @@ -844,7 +850,7 @@
"""
super().__set_name__(owner, name)
if self.name != self.func.__name__:
raise ValueError(

Check warning on line 853 in src/labthings_fastapi/actions.py

View workflow job for this annotation

GitHub Actions / coverage

853 line is not covered with tests
f"Action name '{self.name}' does not match function name "
f"'{self.func.__name__}'",
)
Expand Down Expand Up @@ -985,14 +991,14 @@
try:
responses[200]["model"] = self.output_model
pass
except AttributeError:
print(f"Failed to generate response model for action {self.name}")

Check warning on line 995 in src/labthings_fastapi/actions.py

View workflow job for this annotation

GitHub Actions / coverage

994-995 lines are not covered with tests
# Add an additional media type if we may return a file
if hasattr(self.output_model, "media_type"):
responses[200]["content"][self.output_model.media_type] = {}

Check warning on line 998 in src/labthings_fastapi/actions.py

View workflow job for this annotation

GitHub Actions / coverage

998 line is not covered with tests
# Now we can add the endpoint to the app.
if thing.path is None:
raise NotConnectedToServerError(

Check warning on line 1001 in src/labthings_fastapi/actions.py

View workflow job for this annotation

GitHub Actions / coverage

1001 line is not covered with tests
"Can't add the endpoint without thing.path!"
)
app.post(
Expand Down Expand Up @@ -1040,7 +1046,7 @@
"""
path = path or thing.path
if path is None:
raise NotConnectedToServerError("Can't generate forms without a path!")

Check warning on line 1049 in src/labthings_fastapi/actions.py

View workflow job for this annotation

GitHub Actions / coverage

1049 line is not covered with tests
forms = [
Form[ActionOp](href=path + self.name, op=[ActionOp.invokeaction]),
]
Expand Down
Loading