-
Notifications
You must be signed in to change notification settings - Fork 0
PTHMINT-38: Fix ruff problems code ANN001 #12
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #12 +/- ##
==========================================
+ Coverage 90.71% 90.75% +0.04%
==========================================
Files 106 106
Lines 2293 2305 +12
==========================================
+ Hits 2080 2092 +12
Misses 213 213 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fa47fd0 to
c5b8a7d
Compare
dce9f7b to
6041612
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request improves type annotations for enhanced compatibility with older Python versions, refactors function signatures for clarity, and updates necessary imports across the codebase.
- Updated type hints from modern syntaxes (e.g., list[...]) to List[...] in multiple files
- Enhanced type annotations on method parameters and return types
- Removed outdated ignore rules in configuration to enforce proper type checking
Reviewed Changes
Copilot reviewed 58 out of 58 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/multisafepay/api/paths/payment_methods/response/payment_method.py | Updated type annotations for allowed countries, currencies, and brands |
| src/multisafepay/api/paths/payment_methods/payment_method_manager.py | Added type annotations and updated import for Client, but noted a docstring inconsistency |
| src/multisafepay/api/paths/orders/* | Updated type annotations in order-related models and managers |
| src/multisafepay/api/paths/orders/order_id/refund/request/components/checkout_data.py | Added type annotations and adjusted default parameters for collection methods |
| Other files (e.g., category_manager, gateway_manager, etc.) | Introduced missing Client type annotations and improved documentation accordingly |
| pyproject.toml, examples/* | Updated type hinting imports and cleaned configuration |
Comments suppressed due to low confidence (1)
src/multisafepay/api/paths/payment_methods/payment_method_manager.py:33
- The docstring incorrectly refers to 'CaptureManager' instead of 'PaymentMethodManager'. Please update the docstring to accurately reflect the class name.
def __init__(self, client: Client):
| allowed_countries (Optional[list[str]]): The allowed countries for the payment method. | ||
| allowed_currencies (Optional[list[str]]): The allowed currencies for the payment method. | ||
| allowed_countries (Optional[List[str]]): The allowed countries for the payment method. | ||
| allowed_currencies (OptionalList[str]]): The allowed currencies for the payment method. |
Copilot
AI
May 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There appears to be a typo in the type annotation for allowed_currencies. It should likely be 'Optional[List[str]]' instead of 'OptionalList[str]]'.
| allowed_currencies (OptionalList[str]]): The allowed currencies for the payment method. | |
| allowed_currencies (Optional[List[str]]): The allowed currencies for the payment method. |
This pull request includes several updates to improve type annotations, ensure compatibility with older Python versions, and enhance the maintainability of the codebase. The changes primarily focus on replacing modern type hinting syntax with imports from
typing, adding type annotations to method parameters, and introducing missing imports for consistency.Type Hinting Updates:
list[...]) withList[...]fromtypingacross various files for compatibility with older Python versions. Examples includeget_categories.py[1]listings.py[2] andcheckout_data.py[3].Type Annotation Enhancements:
client: Clientin manager classes (AuthManager,CaptureManager, etc.) and adding types likeintandstrto method parameters incheckout_data.py[1] [2] [3].Import Adjustments:
Clientin various manager files to ensure consistency and clarity, such asauth_manager.py[1] andcategory_manager.py[2].Code Cleanup:
pyproject.tomlto streamline the configuration [1] [2].Documentation Updates:
checkout_data.pymethods likeadd_itemsandrefund_by_merchant_item_id) [1] [2].