Skip to content
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

Support for PydanticV2 #212

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Support for PydanticV2 #212

wants to merge 13 commits into from

Commits on Jul 16, 2023

  1. First commit for supporting pydanticV2

    - Temporarily comment out RedBase session attribute as it was causing issues with re-writing the value
    - Converted update_forward_refs to model_rebuild in _setup.py
    - set type on mac_process_count in sessions.py
    - Implemented ClassVar when dealing with session variable to fix inheritence
    - Convert Config Meta Class into model_config attribute
    - set default values Task class as in pydanticv2 they were set to required=True as default
    - _delayed_kwargs now ClassVar to be passed correctly
    Jypear committed Jul 16, 2023
    Configuration menu
    Copy the full SHA
    f01e33d View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2023

  1. Moves to fix testing and continue migration

    - run bump-pydantic script to make changes where applicable (Didn't seem to make that many changes)
    - fix session variable overwrite in test_core.py
    - add variable to root_validator (to get tests to run) but this needs migrating as root_validator is depreceated
    - test results: 43 failed, 1739 passed, 23 skipped, 8 xfailed, 3 xpassed, 17654 warnings
    Jypear committed Jul 17, 2023
    Configuration menu
    Copy the full SHA
    e78342d View commit details
    Browse the repository at this point in the history
  2. Migrated validator decorators to field_validators

    - always=True is depreceated, alternate solution to set model config validate_defualt to True to force checking on default values (which were set as part of migration)
    - Had to apply some additional typing to allow for that setting (Mainly setting some Union None as well as callable values)
    - values argument passed into validators now has nested data attribute in class. Had to append .data to any call of values
    - fixed manual validator changes that the bump script couldn't do as well
    - test results: 44 failed, 1738 passed, 23 skipped, 8 xfailed, 3 xpassed, 17070 warnings
    Jypear committed Jul 17, 2023
    Configuration menu
    Copy the full SHA
    ff59fcd View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2023

  1. Configuration menu
    Copy the full SHA
    79816e8 View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2023

  1. fix pickle tests and serialization

    - convert json encoders to field_serialiser decorators for variables and replace .dict/.json with model_dump and model_dump_json
    - change __private_attribute_values__ query over to use __pydantic_private__
    - tests now only fail due to weird inheritence issue when attempting to pass session into either FuncTask or Task
    	- Not sure whats causing this issue
    	- Tried to get arround it by setting a ClassVar in the test but this then doesn't pass the session variable into values in the validation decorators
    - test results at: 18 failed, 1764 passed, 23 skipped
    Jypear committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    34b6caf View commit details
    Browse the repository at this point in the history

Commits on Jul 23, 2023

  1. Convert task.py session attribute into class var to allow for some ki…

    …nd of class inheritance with the variable
    
    - setting the value as None removed from RedBase
    - Still same issue with inheritence present within pydantic
    Jypear committed Jul 23, 2023
    Configuration menu
    Copy the full SHA
    73e8bfc View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2023

  1. Implementing some suggested changes

    - Remove brackes from RedBase, base function
    - Set cls_lock attribute to callable (Waiting for clarification)
    - validate_default in model config no longer necessary after testing
    - Changed daemon attribute from False to Nonw (Waiting for clarification)
    - _delayed_kwargs no longer a task variable
    Jypear committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    bbb5a37 View commit details
    Browse the repository at this point in the history
  2. Implement work around to partially intitialise pydantic class variabl…

    …es to allow setting of self when setting _delayed_kwargs:O
    Jypear committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    31f821f View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2023

  1. Commit to work on reducing some of the deprecation warnings

    - in tests replace .dict statment with .model_dump
    - tidy up inport of _object_setter
    - Add setting (temporarily) into tox.ini to ignore deprecation warnings from redbird
    Jypear committed Jul 25, 2023
    Configuration menu
    Copy the full SHA
    62ac9ab View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2023

  1. Fixed remainder of unit tests

    - Implemented fix to DummyTask by having it as part of the application preventing inheritence error.
    - Added dummy task to __init__.py for rocketry.tasks and into the setup for ForwardRefs
    - Fixed test_meta by removing the classVar previously put in for the _FuncCondWrapper function
    - Some general tidy ups
    Test results at: 1 failed, 1781 passed, 23 skipped, 8 xfailed, 3 xpassed, 8707 warnings in 41.18s
    - The one failed test is likely to do with the way I'm using Virtualenv, as this is also present in the stable release of Rocketry on my machine
    Jypear committed Jul 26, 2023
    Configuration menu
    Copy the full SHA
    d00f98f View commit details
    Browse the repository at this point in the history
  2. Removing some of the deprecation warnings related to .dict and root_h…

    …andler
    
    removed temp pytest to ignore redbird warnings:
    Jypear committed Jul 26, 2023
    Configuration menu
    Copy the full SHA
    c3d8dbe View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2023

  1. Fix issues with pickling in multiprocess execution

    - Not sure what changed but pickling stopped working again (maybe a recent update to pydantic again)
    - To resolve this had to add 'returns' to the pickled attributes set to None
    - This seems to have fixed the initial issues but has caused some tests to fail
    - Will begin debugging this again
    Josh Pearson authored and Josh Pearson committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    8e20def View commit details
    Browse the repository at this point in the history

Commits on Oct 8, 2023

  1. Fixed pickling for the most part, but the test_nested params test in …

    …post materilising seems to fail.
    
    Not sure if this is no longer possible in the new version
    Josh Pearson authored and Josh Pearson committed Oct 8, 2023
    Configuration menu
    Copy the full SHA
    e94f1c8 View commit details
    Browse the repository at this point in the history