-
Notifications
You must be signed in to change notification settings - Fork 15
refactor!: Introduce fully typed clients [WIP] #554
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
base: master
Are you sure you want to change the base?
Conversation
e470329 to
64a173b
Compare
64a173b to
c410e21
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #554 +/- ##
===========================================
+ Coverage 75.92% 95.04% +19.12%
===========================================
Files 42 42
Lines 2471 4558 +2087
===========================================
+ Hits 1876 4332 +2456
+ Misses 595 226 -369
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
39bc762 to
894685c
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 PR introduces fully typed API clients with Pydantic models generated from OpenAPI specifications. It represents a major architectural refactoring to improve type safety and developer experience.
Changes:
- Generates Pydantic models from OpenAPI specs using datamodel-code-generator
- Refactors HTTP client architecture into modular, well-structured components
- Introduces comprehensive type annotations across all client methods
- Adds new integration tests for webhooks, schedules, user operations, store, and more
- Removes dependency on apify-shared and adds pydantic as core dependency
Reviewed changes
Copilot reviewed 94 out of 97 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Adds pydantic dependency, configures datamodel-code-generator, removes apify-shared |
| src/apify_client/_config.py | New immutable configuration dataclass for client settings |
| src/apify_client/_consts.py | New constants and enums (ActorJobStatus, WebhookEventType, etc.) |
| src/apify_client/_statistics.py | Renames Statistics to ClientStatistics |
| src/apify_client/_http_clients/ | Refactored HTTP client into modular sync/async/base structure |
| src/apify_client/errors.py | Improved error handling and docstrings |
| src/apify_client/_logging.py | Reorganized logging infrastructure |
| src/apify_client/_resource_clients/ | Complete refactor with typed responses |
| tests/unit/ | Updated unit tests for renamed classes and new structure |
| tests/integration/ | New comprehensive integration tests |
| docs/, website/ | Updated examples to use typed models |
| scripts/ | Updated for new file structure |
Comments suppressed due to low confidence (1)
src/apify_client/_resource_clients/key_value_store.py:854
- This assignment to 'keys_public_url' is unnecessary as it is redefined before this value is used.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR introduces fully typed API clients, with models generated directly from OpenAPI specifications.
Description
pyproject.tomland theMakefile.apify/apify-docsfor details - fix(openapi): Fix OpenApi specification apify-docs#2169.apify/apify-sdk-pythonfor details - chore: Adapt to apify-client v3 [WIP] apify-sdk-python#719.Issues
Testing