-
Notifications
You must be signed in to change notification settings - Fork 5
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
177 upgrade pydantic version #179
base: main
Are you sure you want to change the base?
Commits on Oct 4, 2024
-
Migrate to Pydantic v2, update model validation and fix async issues
- Migrated to Pydantic v2: - Replaced deprecated `parse_obj()` and `parse_raw()` with `model_validate()` and `model_validate_json()`. - Replaced `.dict()` with `.model_dump()` for serializing models to dictionaries. - Updated `validator` to `field_validator` and `root_validator` to `model_validator` to comply with Pydantic v2 syntax changes. - Fixed asyncio issues: - Added `await` for asynchronous methods like `raise_for_status()` in `RemoteAccount` and other HTTP operations to avoid `RuntimeWarning`. - Updated config handling: - Used `ClassVar` for constants in `Settings` and other configuration classes. - Replaced `Config` with `ConfigDict` in Pydantic models to follow v2 conventions. - Added default values for missing fields in chain configurations (`CHAINS_SEPOLIA_ACTIVE`, etc.). - Adjusted signature handling: - Updated the signing logic to prepend `0x` in the `BaseAccount` signature generation to ensure correct Ethereum address formatting. - Minor fixes: - Resolved issue with extra fields not being allowed by default by specifying `extra="allow"` or `extra="forbid"` where necessary. - Fixed tests to account for changes in model validation and serialization behavior. - Added `pydantic-settings` as a new dependency for configuration management.
Configuration menu - View commit details
-
Copy full SHA for a409433 - Browse repository at this point
Copy the full SHA a409433View commit details -
- Updated all instances of **extra_fields to ensure proper handling of Optional dictionaries using `(extra_fields or {})` pattern. - Added proper return statements in `AlephHttpClient.get_message_status` to return parsed JSON data as a `MessageStatus` object. - Updated `Settings` class in `conf.py` to correct DNS resolvers type and simplify the `model_config` definition. - Refactored `parse_volume` to ensure correct handling of Mapping types and MachineVolume types, avoiding TypeErrors. - Improved field validation and model validation in `SignedPubKeyHeader` by using correct Pydantic v2 validation decorators and ensuring compatibility with the new model behavior. - Applied formatting and consistency fixes for `model_dump` usage and indentation improvements in test files.
Configuration menu - View commit details
-
Copy full SHA for 660762f - Browse repository at this point
Copy the full SHA 660762fView commit details
Commits on Oct 15, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 4908fbe - Browse repository at this point
Copy the full SHA 4908fbeView commit details -
Configuration menu - View commit details
-
Copy full SHA for e50fabb - Browse repository at this point
Copy the full SHA e50fabbView commit details -
* Missing chain field on auth * Fix Signature of Solana operation for CRN * Add export_private_key func for accounts * Improve _load_account * Add chain arg to _load_account * Increase default HTTP_REQUEST_TIMEOUT * Typing --------- Co-authored-by: Olivier Le Thanh Duong <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 29b3a1b - Browse repository at this point
Copy the full SHA 29b3a1bView commit details -
Migrate to Pydantic v2, update model validation and fix async issues
- Migrated to Pydantic v2: - Replaced deprecated `parse_obj()` and `parse_raw()` with `model_validate()` and `model_validate_json()`. - Replaced `.dict()` with `.model_dump()` for serializing models to dictionaries. - Updated `validator` to `field_validator` and `root_validator` to `model_validator` to comply with Pydantic v2 syntax changes. - Fixed asyncio issues: - Added `await` for asynchronous methods like `raise_for_status()` in `RemoteAccount` and other HTTP operations to avoid `RuntimeWarning`. - Updated config handling: - Used `ClassVar` for constants in `Settings` and other configuration classes. - Replaced `Config` with `ConfigDict` in Pydantic models to follow v2 conventions. - Added default values for missing fields in chain configurations (`CHAINS_SEPOLIA_ACTIVE`, etc.). - Adjusted signature handling: - Updated the signing logic to prepend `0x` in the `BaseAccount` signature generation to ensure correct Ethereum address formatting. - Minor fixes: - Resolved issue with extra fields not being allowed by default by specifying `extra="allow"` or `extra="forbid"` where necessary. - Fixed tests to account for changes in model validation and serialization behavior. - Added `pydantic-settings` as a new dependency for configuration management.
Configuration menu - View commit details
-
Copy full SHA for cd2f8e4 - Browse repository at this point
Copy the full SHA cd2f8e4View commit details -
fix: add explicit float type for HTTP_REQUEST_TIMEOUT to comply with …
…Pydantic v2 requirements Pydantic v2 requires explicit type annotations for fields, so added `float` to ensure proper validation of HTTP_REQUEST_TIMEOUT.
Configuration menu - View commit details
-
Copy full SHA for a86da5f - Browse repository at this point
Copy the full SHA a86da5fView commit details -
Configuration menu - View commit details
-
Copy full SHA for fa8e7c8 - Browse repository at this point
Copy the full SHA fa8e7c8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 706f63a - Browse repository at this point
Copy the full SHA 706f63aView commit details
Commits on Oct 21, 2024
-
Fix: Project don't use the good version of aleph-message
There were changes made on aleph-message on the main branch about pydantic version. Using the version by the url and then change it later after the release.
Configuration menu - View commit details
-
Copy full SHA for 213982b - Browse repository at this point
Copy the full SHA 213982bView commit details
Commits on Nov 5, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 8894347 - Browse repository at this point
Copy the full SHA 8894347View commit details -
Fix: list[str] rise an error in ubuntu 20.04
Using List from typing instead to assure the compatibility between python3.8 and above
Configuration menu - View commit details
-
Copy full SHA for 5674356 - Browse repository at this point
Copy the full SHA 5674356View commit details -
Configuration menu - View commit details
-
Copy full SHA for 00177ae - Browse repository at this point
Copy the full SHA 00177aeView commit details