Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict Pydantic to <2.0.0 #134

Closed
anmolmittal1 opened this issue Jul 3, 2023 · 3 comments
Closed

Restrict Pydantic to <2.0.0 #134

anmolmittal1 opened this issue Jul 3, 2023 · 3 comments

Comments

@anmolmittal1
Copy link

anmolmittal1 commented Jul 3, 2023

  • fhir.resources version: 7.0.2
  • Python version: 3.7
  • Operating System: Debian 10

Description

Latest version errors out as it is trying to install pydantic v2 which includes some breaking changes.
https://github.com/nazrulworld/fhir.resources/blob/main/setup.py#L20 - min version is restricted but please add max version cap to <2.0.0 as well

What I Did

Relevant traceback

<redacted>: in <module>
    from fhir.resources.bundle import Bundle
/usr/local/lib/python3.7/dist-packages/ddtrace/internal/module.py:220: in _exec_module
    self.loader.exec_module(module)
/usr/local/lib/python3.7/dist-packages/fhir/resources/__init__.py:5: in <module>
    from fhir.resources.core.fhirabstractmodel import FHIRAbstractModel
/usr/local/lib/python3.7/dist-packages/ddtrace/internal/module.py:220: in _exec_module
    self.loader.exec_module(module)
/usr/local/lib/python3.7/dist-packages/fhir/resources/core/fhirabstractmodel.py:13: in <module>
    from pydantic.class_validators import ROOT_VALIDATOR_CONFIG_KEY, root_validator
E   ImportError: cannot import name 'ROOT_VALIDATOR_CONFIG_KEY' from 'pydantic.class_validators' (/usr/local/lib/python3.7/dist-packages/pydantic/class_validators.py)
@nazrulworld
Copy link
Owner

nazrulworld commented Jul 3, 2023

Relevant issue is #133 | I think we should move with Pydantic v2.X. For now unfortunately you have to self restrict lower version pydantic until we make a minor release.

@anmolmittal1
Copy link
Author

@nazrulworld I have restricted the pydantic version manually for my use case currently.
I also agree with the move to Pydantic v2 as it brings in a lot of performance improvements but created this issue as the package would be breaking for a lot of users who have not locked their pydantic version. Hopefully we can get a quick minor/patch release with pydantic v1 cap for now!

@nazrulworld
Copy link
Owner

https://pypi.org/project/fhir.resources/7.0.2/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants