Update pydantic version to 2.13#319
Conversation
This bumps the minimum version of Pydantic to 2.13, which should avoid an upstream bug in earlier versions. Closes #283
Barecheck - Code coverage reportTotal: 96.64%Your code coverage diff: 0.00% ▴ ✅ All code changes are covered |
|
@julianstirling do you have a reproducible example I can run (or add to the test suite) to verify that updating Pydantic does actually fix the bug? If you're happy we just need to update the requirement, I'm happy to merge as-is. |
The issue is that if we use def test_importstring_reports_internal_import_error(tmp_path, monkeypatch):
# Create a module that exists, but fails to import due to missing dependency
(tmp_path / 'my_module.py').write_text('import definitely_missing_dep_xyz\n\nclass MyClass:\n pass\n')
monkeypatch.syspath_prepend(tmp_path)
adapter = TypeAdapter(ImportString)
with pytest.raises(ValidationError, match="No module named 'definitely_missing_dep_xyz'"):
adapter.validate_python('my_module.MyClass') |
dbcdff4 to
3470397
Compare
3470397 to
cfd2efb
Compare
This was surprisingly straightforward to do: I've already got a module of unimportable submodules used to test this, so I've added one specifically for this error. I think this is ready now, assuming the tests pass. |
|
I have run the newly-parametrized test with both |
This bumps the minimum version of Pydantic to 2.13, which should avoid an upstream bug in earlier versions.
Closes #283