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

Dependency conflict between the cashfree-pg package and the pydantic package #49

Open
mystogan99 opened this issue Feb 3, 2024 · 19 comments

Comments

@mystogan99
Copy link

cashfree-pg version 4.0.3 requires pydantic version >=1.10.5,<2. My project requires pydantic version ^2.5.2, which is incompatible with the version required by cashfree-pg.

Because no versions of cashfree-pg match >4.0.3,<5.0.0
 and cashfree-pg (4.0.3) depends on pydantic (>=1.10.5,<2), cashfree-pg (>=4.0.3,<5.0.0) requires pydantic (>=1.10.5,<2).
So, because qube-dashboard depends on both pydantic (^2.5.2) and cashfree-pg (^4.0.3), version solving failed.

I can't downgrade my pydantic version as other features heavily rely on this.
So what if I use Dependency Overrides but it might lead to runtime errors if cashfree_pg is not compatible with the newer version of pydantic?

@suhas-cashfree
Copy link
Collaborator

Can you try dependency overriding.
That should work.

@pradeeprecoup
Copy link

hi @suhas-cashfree For me the dependency didn't work, and it throwed the error ->

File "/usr/local/lib/python3.11/site-packages/cashfree_pg/models/offer_validations_payment_method.py", line 58, in OfferValidationsPaymentMethod
one_of_schemas: List[str] = Field(OFFERVALIDATIONSPAYMENTMETHOD_ONE_OF_SCHEMAS, const=True)
File "/usr/local/lib/python3.11/site-packages/pydantic/fields.py", line 764, in Field
raise PydanticUserError('const is removed, use Literal instead', code='removed-kwargs')
pydantic.errors.PydanticUserError: const is removed, use Literal instead

For further information visit https://errors.pydantic.dev/2.5/u/removed-kwargs

is it possible for you to upgrade the versiona and support the latest.

I don't want to fork the repository and update it manually?

@suhas-cashfree
Copy link
Collaborator

What is the pydantic version you are using @pradeeprecoup ?

@pradeeprecoup
Copy link

pradeeprecoup commented Apr 10, 2024

hi @suhas-cashfree
Thanks for the quick reply. here is the out of the pip list, and the version I am using.

pydantic 2.5.3
pydantic_core 2.14.6

@suhas-cashfree
Copy link
Collaborator

Have to check what we can do for this. Right now our pydantic supports < 2
will dependency overriding work for you anyway ?

@pradeeprecoup
Copy link

No, it gave the above error at run time.

@pradeeprecoup
Copy link

So @suhas-cashfree what are suggest, how to go about it? Should i directly call the api? Because we are evaluating cashfree and if the development time is more on this.. then we can try some other gateway?

@suhas-cashfree
Copy link
Collaborator

You can hit the api directly. Meanwhile we will try to get a solution for this

@suhas-cashfree
Copy link
Collaborator

What are the apis you are hitting ?

@pradeeprecoup
Copy link

pradeeprecoup commented Apr 10, 2024

Order/ Payment/ Refund/Webhook for now. Payment links also

@vedrk5672
Copy link

any update on this, till when can we expect the updated l

@suhas-cashfree
Copy link
Collaborator

What is the pydantic version you are using @vedrk5672 ?

@vedrk5672
Copy link

@suhas-cashfree pydantic = "2.6.1"

@vedrk5672
Copy link

hey @suhas-cashfree any updates ?

or any workaround apart from using requests directly.

@suhas-cashfree
Copy link
Collaborator

You can downgrade pydantic version ?
We have to check to make it compatible. It will take some time

@vedrk5672
Copy link

Downgrading is not possible in the current scenario.
No issue will work with the endpoint requests for now.

@vjarun2001
Copy link

File "/lib/python3.12/site-packages/cashfree_pg/api_client.py", line 245, in
from cashfree_pg.models.subs_create_payment_200_response import *
ModuleNotFoundError: No module named 'cashfree_pg.models.subs_create_payment_200_response'

@suhas-cashfree please find the above mentioned error.
actual module -> subs_create_payment200_response (present in cashfree_pg.models)
but in api_client.py there is cashfree_pg.models.subs_create_payment_200_response import *
please resolve this at the earliest

@ajatkj
Copy link

ajatkj commented Oct 12, 2024

Any update on this? I am on pydantic version 2.9.2. No way for me to downgrade to version < 2.

@suhas-cashfree
Copy link
Collaborator

Hi @ajatkj
Currently our sdk only supports pydantic <2
Haven't picked up to upgrade the versions as of now.
Will keep you posted once it's live

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

6 participants