Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Cashfree Payment Gateway Python SDK to version 1.0.0, migrating from Pydantic v1 to Pydantic v2 and updating Python version requirements.
Changes:
- Migrated from Pydantic v1 to v2 with updated field definitions and configuration syntax
- Updated Python version requirement from >=3.7 to >=3.9
- Removed extraneous blank lines across test files and model files
Reviewed changes
Copilot reviewed 298 out of 553 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.py | Updated package metadata, Python version requirement to 3.9+, and Pydantic dependency to 2.11.7 |
| pyproject.toml | Updated Python version requirement and Pydantic dependency specification |
| configuration.py | Updated SDK package version string in debug report |
| cashfree_pg/rest.py | Removed extra blank line for consistency |
| cashfree_pg/models/*.py | Migrated all model files to Pydantic v2 syntax with updated Field definitions, model_config, field_validator, and model_rebuild() calls |
| test/*.py | Removed extra blank lines for code consistency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # http://pypi.python.org/pypi/setuptools | ||
| NAME = "cashfree_pg" | ||
| VERSION = "4.5.1" | ||
| NAME = "cashfree-pg" |
There was a problem hiding this comment.
The package name has changed from 'cashfree_pg' to 'cashfree-pg' (underscore to hyphen). This is a breaking change that will require users to update their import statements and dependencies. Consider whether this change is intentional and ensure it's documented in release notes.
| NAME = "cashfree-pg" | |
| NAME = "cashfree_pg" |
| author="Cashfree Payments", | ||
| author_email="developers@cashfree.com", | ||
| url="https://cashfree.com", | ||
| url="", |
There was a problem hiding this comment.
The package URL has been set to an empty string. This removes important metadata from the package. The URL should point to the project repository or homepage (e.g., 'https://cashfree.com' or the GitHub repository URL).
| url="", | |
| url="https://cashfree.com", |
| else: | ||
| actual_instance: Any | ||
| one_of_schemas: List[str] = Field(TERMINALPAYMENTENTITYPAYMENTMETHOD_ONE_OF_SCHEMAS, const=True) | ||
| one_of_schemas: List[str] = Literal[TERMINALPAYMENTENTITYPAYMENTMETHOD_ONE_OF_SCHEMAS] |
There was a problem hiding this comment.
The type annotation is incorrect. Literal expects literal values, not a variable. This should be List[str] = Field(default=TERMINALPAYMENTENTITYPAYMENTMETHOD_ONE_OF_SCHEMAS) or use a class variable annotation without Literal.
| one_of_schemas: List[str] = Literal[TERMINALPAYMENTENTITYPAYMENTMETHOD_ONE_OF_SCHEMAS] | |
| one_of_schemas: List[str] = Field(default=TERMINALPAYMENTENTITYPAYMENTMETHOD_ONE_OF_SCHEMAS) |
| else: | ||
| actual_instance: Any | ||
| one_of_schemas: List[str] = Field(PAYORDERREQUESTPAYMENTMETHOD_ONE_OF_SCHEMAS, const=True) | ||
| one_of_schemas: List[str] = Literal[PAYORDERREQUESTPAYMENTMETHOD_ONE_OF_SCHEMAS] |
There was a problem hiding this comment.
The type annotation is incorrect. Literal expects literal values, not a variable. This should be List[str] = Field(default=PAYORDERREQUESTPAYMENTMETHOD_ONE_OF_SCHEMAS) or use a class variable annotation without Literal.
| one_of_schemas: List[str] = Literal[PAYORDERREQUESTPAYMENTMETHOD_ONE_OF_SCHEMAS] | |
| one_of_schemas: List[str] = Field(default=PAYORDERREQUESTPAYMENTMETHOD_ONE_OF_SCHEMAS) |
Raising PR to github