Skip to content

Update dependencies#285

Open
rwb27 wants to merge 3 commits intomainfrom
update-dependencies
Open

Update dependencies#285
rwb27 wants to merge 3 commits intomainfrom
update-dependencies

Conversation

@rwb27
Copy link
Collaborator

@rwb27 rwb27 commented Mar 5, 2026

This PR updates our dependencies, in particular we now specify pydantic ~= 2.12 and fastapi >=0.135.

This required a few fixes:

  • We no longer get a SchemaError if bad constraints are specified, instead it's a RuntimeError. I've updated error checking code accordingly. No need to support the old behaviour, as we now require a newer pydantic.
  • I use a different attribute to get the schema of BlobModel when generating the schema for Blob, due to a deprecation warning.

The only remaining warning I get in tests is a deprecation warning about websockets. I think this must be the fault of fastapi or uvicorn and I've not gotten to the bottom of it. However, this is not a new warning - it happened before the updates as well.

Edit: this does not answer #283 as that will only be fixed once Pydantic 2.13 is released. It may still be worth merging, as the fixes here will be needed when we upgrade to pydantic 2.13.

rwb27 added 3 commits March 5, 2026 00:11
This forces an update of `pydantic` which skips over an upstream bug.
I was extracting the schema from a model using the now-deprecated `__get_pydantic_core_schema__`. It turns out there's a much simpler way, which is the `__pydantic_core_schema__` property that doesn't raise a warning. I have switched to this, and gotten rid of my deprecation warnings.
As I've upped the minimum pydantic version anyway, there's no need to support two versions - I've just updated the code to check for a `RuntimeError` instead of a `SchemaError`.

I've also updated my test case, which no longer causes Pydantic to fail - I've found another combination that does cause the same error, and we now use that.
@barecheck
Copy link

barecheck bot commented Mar 5, 2026

Barecheck - Code coverage report

Total: 96.3%

Your code coverage diff: -0.01% ▾

Uncovered files and lines
FileLines
src/labthings_fastapi/outputs/blob.py301, 904-905
src/labthings_fastapi/utilities/__init__.py137, 153

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant