unioslo / harborapi

Python async client for the Harbor REST API v2.0.
https://unioslo.github.io/harborapi/
MIT License
28 stars 5 forks source link

Limit pydantic version < 2.0 #56

Closed yutaodou closed 1 year ago

yutaodou commented 1 year ago

pydantic 2.0 release has breaking changes which will impact haborapi. Restrict pydantic version to < 2.0

[2023-07-03T01:00:45.909Z]   File "/app/.local/lib/python3.10/site-packages/harborapi/__init__.py", line 1, in <module>
[2023-07-03T01:00:45.909Z]     from . import _types, auth, client, client_sync, exceptions, utils, version
[2023-07-03T01:00:45.909Z]   File "/app/.local/lib/python3.10/site-packages/harborapi/auth.py", line 7, in <module>
[2023-07-03T01:00:45.909Z]     from harborapi.models.models import Robot, RobotCreate, RobotCreated
[2023-07-03T01:00:45.909Z]   File "/app/.local/lib/python3.10/site-packages/harborapi/models/__init__.py", line 1, in <module>
[2023-07-03T01:00:45.909Z]     from . import scanner
[2023-07-03T01:00:45.909Z]   File "/app/.local/lib/python3.10/site-packages/harborapi/models/scanner.py", line 14, in <module>
[2023-07-03T01:00:45.909Z]     from pydantic.fields import ModelField
[2023-07-03T01:00:45.909Z] ImportError: cannot import name 'ModelField' from 'pydantic.fields' (/app/.local/lib/python3.10/site-packages/pydantic/fields.py)
pederhan commented 1 year ago

Thanks for noticing and contributing a fix!

I am in the process of evaluating Pydantic v2 for this library, but it might take some time to implement due to #54.