OSeMOSYS / otoole

OSeMOSYS Tools for Energy
https://otoole.readthedocs.io
MIT License
23 stars 17 forks source link

[Bug]: pydantic 2.0 breaking operation #185

Closed willu47 closed 1 year ago

willu47 commented 1 year ago

The Issue

The new version of pydantic (v2.0) is breaking the validation

Expected Behavior

Validation should work.

Steps To Reproduce

  1. Create a new installation of otoole with e.g. Python 3.11 and pydantic >=2

Log output

Traceback (most recent call last):
  File "/Users/wusher/repository/OSeMBE_ECEMF/.snakemake/conda/385947c5/bin/otoole", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/wusher/repository/OSeMBE_ECEMF/.snakemake/conda/385947c5/lib/python3.11/site-packages/otoole/cli.py", line 470, in main
    args.func(args)
  File "/Users/wusher/repository/OSeMBE_ECEMF/.snakemake/conda/385947c5/lib/python3.11/site-packages/otoole/cli.py", line 200, in conversion_matrix
    validate_config(config)
  File "/Users/wusher/repository/OSeMBE_ECEMF/.snakemake/conda/385947c5/lib/python3.11/site-packages/otoole/utils.py", line 164, in validate_config
    raise OtooleConfigFileError(message=f"\n{error_message}")
otoole.exceptions.OtooleConfigFileError: 
Field required
Field required
Field required
Field required
Field required
Field required
... etc...

Operating System

MacOS

What version of otoole are you running?

1.0.3

Possible Solution

Pin pydantic to <2

Anything else?

No response