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

Rework of the subgroups feature + Minor Refactoring #185

Merged
merged 48 commits into from
Jan 10, 2023
Merged

Commits on Jan 5, 2023

  1. Adding test with current WIP implementation

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    fab0f66 View commit details
    Browse the repository at this point in the history
  2. Removed the previous subgroups implementation

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    facfc99 View commit details
    Browse the repository at this point in the history
  3. Fix test collection for vscode

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    815b2b4 View commit details
    Browse the repository at this point in the history
  4. Making some progress (need to fix postprocessing)

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    e662ebe View commit details
    Browse the repository at this point in the history
  5. Making more progress, almost there (ish)

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    0b2bb3b View commit details
    Browse the repository at this point in the history
  6. Making more progress (need to fix conflicts)

    The FieldWrapper is created for the subgroups arg.
    I now create a new DataclassWrapper and graft add it as a child of the
    DataclassWrapper that contains the subgroup field.
    
    The current issue seems to be that the ConflictResolver is seeing both
    the FieldWrapper and the DataclassWrapper (I Think) as pointing to the
    same destination!
    
    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    efea1cd View commit details
    Browse the repository at this point in the history
  7. Conflicts confusion is clearing up

    The `conflict_resolver.resolve` method was actually doing two things:
    - Resolving conflicts
    - Flattening the list!
    
    This was causing confusion, since `wrappers` was secretely growing,
    which was causing the issue with duplicates from before.
    
    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    3d51edb View commit details
    Browse the repository at this point in the history
  8. Things are parsing, but default is slightly wrong

    This is getting to the point where things are parsing, but the default
    value for a part of the subgroup is wrong. Need to check what exactly is
    going on.
    
    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    690e3bb View commit details
    Browse the repository at this point in the history
  9. 'subgroups' is only added on namespace when needed

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    a6253a7 View commit details
    Browse the repository at this point in the history
  10. Progress: Might have identified issue

    I think I figured out the issue. If we generate a DataclassWrapper
    for a subgroup, then it doesn't get a real `Field`, which might be
    preventign the parsing from working properly?
    
    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    0d5db49 View commit details
    Browse the repository at this point in the history
  11. Refactor _set_instances_on_namespace

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    f28ff13 View commit details
    Browse the repository at this point in the history
  12. Refactor, fix some failing basic tests

    Certain things were breaking in basic tests.
    
    TODOs left:
    - Still getting some errors in the ALWAYS_MERGE case
    - Still not parsing the right values for the other arguments
    
    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    1870903 View commit details
    Browse the repository at this point in the history
  13. Fix small bug in _consume_constructor_arguments

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    2b1872f View commit details
    Browse the repository at this point in the history
  14. Refactoring: Improve naming of Parser methods

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    fa7a1d4 View commit details
    Browse the repository at this point in the history
  15. [dirty] wip (switching machines)

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    f722394 View commit details
    Browse the repository at this point in the history
  16. Fix mistake with self._wrappers, few tests left

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    d583366 View commit details
    Browse the repository at this point in the history
  17. Simplify subgroups fn, begin rewriting tests

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    3650f51 View commit details
    Browse the repository at this point in the history
  18. Simple subgroup tests are passing

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    9bd0069 View commit details
    Browse the repository at this point in the history
  19. Fix issue with .setdefault and new subgroups

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    386720c View commit details
    Browse the repository at this point in the history
  20. Fix required arg for equivalent_argparse_code

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    bd46ca9 View commit details
    Browse the repository at this point in the history
  21. Remove a logger.Critical call

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    2c011c1 View commit details
    Browse the repository at this point in the history
  22. Remove hacky code from previous iteration

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    40283cf View commit details
    Browse the repository at this point in the history
  23. Remove the _print_tree function

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    ae45549 View commit details
    Browse the repository at this point in the history
  24. Make first block of logging in test a bit better

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    9e1539c View commit details
    Browse the repository at this point in the history
  25. Apply pre-commit hooks to field_wrapper.py

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    9a701a6 View commit details
    Browse the repository at this point in the history
  26. Cleanup the resolve_subgroups code a tiny bit

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    0f9c2ee View commit details
    Browse the repository at this point in the history
  27. Make Dataclass an actual Protocol

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    235b714 View commit details
    Browse the repository at this point in the history
  28. Make DataclassWrapper use Dataclass typevar

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    73e8ea6 View commit details
    Browse the repository at this point in the history
  29. Add test to check that subgroups are saved (#139)

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    4595cd6 View commit details
    Browse the repository at this point in the history
  30. Make subgroups sig reflect current limitations

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    ab81b26 View commit details
    Browse the repository at this point in the history
  31. Add more tests (not passing)

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    81ba977 View commit details
    Browse the repository at this point in the history
  32. Refactor FieldWrapper.default

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    0ccbcd4 View commit details
    Browse the repository at this point in the history
  33. Fix required subgroups issue

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    61e0ff2 View commit details
    Browse the repository at this point in the history
  34. Fix error in test for subgroups with a conflict

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    bd2f895 View commit details
    Browse the repository at this point in the history
  35. Minor esthetic change to test_subgroups.py

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    aef61f2 View commit details
    Browse the repository at this point in the history
  36. Fix issues with py37 and parsing of Reused lists

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    f1fdff2 View commit details
    Browse the repository at this point in the history
  37. Very minor improvement to unrelated test

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    f94a274 View commit details
    Browse the repository at this point in the history
  38. [optional] Make the "reuse" logic a bit better?

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    b8787c8 View commit details
    Browse the repository at this point in the history

Commits on Jan 6, 2023

  1. Revert "[optional] Make the "reuse" logic a bit better?"

    This reverts commit b8787c8.
    lebrice committed Jan 6, 2023
    Configuration menu
    Copy the full SHA
    5cd4270 View commit details
    Browse the repository at this point in the history
  2. Fix typing of the subgroups function

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 6, 2023
    Configuration menu
    Copy the full SHA
    30b92ae View commit details
    Browse the repository at this point in the history
  3. Removed unused _remove_help_action and test

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 6, 2023
    Configuration menu
    Copy the full SHA
    448d4b1 View commit details
    Browse the repository at this point in the history
  4. "create_dataclasses"->"instantiate_dataclasses"

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 6, 2023
    Configuration menu
    Copy the full SHA
    cf6ac13 View commit details
    Browse the repository at this point in the history
  5. Remove commented subgroup tests

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 6, 2023
    Configuration menu
    Copy the full SHA
    dcc8808 View commit details
    Browse the repository at this point in the history
  6. Add more tests for the subgroups function

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 6, 2023
    Configuration menu
    Copy the full SHA
    ea1e524 View commit details
    Browse the repository at this point in the history
  7. Use dict instead of Mapping

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 6, 2023
    Configuration menu
    Copy the full SHA
    1dac691 View commit details
    Browse the repository at this point in the history

Commits on Jan 10, 2023

  1. Add test for help string future feature

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 10, 2023
    Configuration menu
    Copy the full SHA
    e2a73bf View commit details
    Browse the repository at this point in the history
  2. Fix small bug in test

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 10, 2023
    Configuration menu
    Copy the full SHA
    8a4e183 View commit details
    Browse the repository at this point in the history
  3. Merge branch 'master' into nested-subgroups

    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Jan 10, 2023
    Configuration menu
    Copy the full SHA
    73c9cd1 View commit details
    Browse the repository at this point in the history