cashfree / cashfree-pg-sdk-python

cashfree-pg-sdk-python
Apache License 2.0
1 stars 3 forks source link

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

Open mystogan99 opened 7 months ago

mystogan99 commented 7 months ago

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 commented 7 months ago

Can you try dependency overriding. That should work.

pradeeprecoup commented 5 months ago

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 commented 5 months ago

What is the pydantic version you are using @pradeeprecoup ?

pradeeprecoup commented 5 months ago

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 commented 5 months ago

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

pradeeprecoup commented 5 months ago

No, it gave the above error at run time.

pradeeprecoup commented 5 months ago

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 commented 5 months ago

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

suhas-cashfree commented 5 months ago

What are the apis you are hitting ?

pradeeprecoup commented 5 months ago

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

vedrk5672 commented 4 months ago

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

suhas-cashfree commented 4 months ago

What is the pydantic version you are using @vedrk5672 ?

vedrk5672 commented 4 months ago

@suhas-cashfree pydantic = "2.6.1"

vedrk5672 commented 4 months ago

hey @suhas-cashfree any updates ?

or any workaround apart from using requests directly.

suhas-cashfree commented 4 months ago

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

vedrk5672 commented 4 months ago

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

vjarun2001 commented 2 months ago

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