dandi / dandi-schema

Schemata for DANDI archive project
Apache License 2.0
5 stars 8 forks source link

Pydantic test failure on `=dandischema-0.9.1` with `=pydantic-2.4.2` but not with newer pydantic versions. #228

Closed TheChymera closed 4 months ago

TheChymera commented 4 months ago

Full build and test log.

It's basically these three tests:

FAILED dandischema/tests/test_metadata.py::test_asset - dandischema.exceptions.PydanticValidationError: [{'type': 'string_type', 'loc': ('wasAttributedTo', 0, 'sex', 'identifier'), 'msg': 'In...
FAILED dandischema/tests/test_metadata.py::test_aggregate[files1-summary1] - pydantic_core._pydantic_core.ValidationError: 1 validation error for AssetsSummary
FAILED dandischema/tests/test_metadata.py::test_aggregate[files2-summary2] - pydantic_core._pydantic_core.ValidationError: 1 validation error for AssetsSummary

This failure is happening with =pydantic-2.4.2, which I used due to this requirement.

With newer pydantic versions, however, this issue goes away:

Tests pass with =pydantic-2.5.3 and with =pydantic-2.6.1.

Is the dependency version cap outdated, if so, why doesn't this show up in CI? 🤔

jwodder commented 4 months ago

@TheChymera ~= 2.4 means a cap of 3.0, not 2.5. You're allowed to use the current-latest pydantic with this package.

TheChymera commented 4 months ago

ah, I thought it meant 2.4.x. Ok then. Still maybe should be noted that it fails with 2.4*, which is the version that's written there.