rosalindfranklininstitute / parakeet

Phantom generator
GNU General Public License v3.0
18 stars 5 forks source link

New Pydantic v2.0 breaks parakeet #53

Closed DimitriosBellos closed 1 year ago

DimitriosBellos commented 1 year ago

In a fresh installation of parakeet I executed parakeet.config.new -c config.yaml And I got:

Traceback (most recent call last): File "/envs/parakeet-env/bin/parakeet.config.new", line 5, in from parakeet.command_line.config import new File "/envs/parakeet-env/lib/python3.9/site-packages/parakeet/init.py", line 19, in from parakeet._run import run # noqa File "/envs/parakeet-env/lib/python3.9/site-packages/parakeet/_run.py", line 13, in import parakeet.config File "/envs/parakeet-env/lib/python3.9/site-packages/parakeet/config.py", line 727, in class Config(BaseModel): File "/envs/parakeet-env/lib/python3.9/site-packages/parakeet/config.py", line 734, in Config Sample(), File "/envs/parakeet-env/lib/python3.9/site-packages/pydantic/main.py", line 150, in init pydantic_self.pydantic_validator.validate_python(data, self_instance=__pydantic_self__) pydantic_core._pydantic_core.ValidationError: 4 validation errors for Sample coords Field required [type=missing, input_value={}, input_type=dict] For further information visit https://errors.pydantic.dev/2.0.1/v/missing molecules Field required [type=missing, input_value={}, input_type=dict] For further information visit https://errors.pydantic.dev/2.0.1/v/missing ice Field required [type=missing, input_value={}, input_type=dict] For further information visit https://errors.pydantic.dev/2.0.1/v/missing sputter Field required [type=missing, input_value={}, input_type=dict] For further information visit https://errors.pydantic.dev/2.0.1/v/missing

I then installed the most recent v1 version of pydantic pip install pydantic==1.10.10 And it worked

Maybe you need to lock in the setup.py the pydantic version to v1.10.10 or find a way to be compatible with the new v2.0 version of pydantic

jmp1985 commented 1 year ago

Hi @DimitriosBellos

Yes, I saw this yesterday. It seems that many packages are broken by this change. I will have a look at fixing it today.

Best wishes James

jmp1985 commented 1 year ago

I tried updating to the new version of pydantic but other packages such as napari (which isn't a dependency but is commonly used by me and other parakeet users) have set their pydantic version explicitly to 1.10.10. Therefore, I have set the version to 1.10.10 for the moment and will update when other packages do the same to avoid issues with conflicting versions.