Skip to content

Conversation

jtojnar
Copy link

@jtojnar jtojnar commented Sep 22, 2024

  • Switch to poetry-core
  • Upgrade to Pydantic 2
  • Fix typing error

Current issues:

  • need to update lockfile
  • parso 0.8 no longer supports Python ≤ 3.5: https://github.com/davidhalter/parso/blob/v0.8.4/CHANGELOG.rst#080-2020-08-05
  • Whatever this is:
    >       assert val == expected
    E       AssertionError: assert '# type: (Cal...-> Types.NONE' == '# type: (Cal...int]) -> None'
    E         
    E         - # type: (Callable[[], int]) -> None
    E         ?                                 ^^^
    E         + # type: (Callable[[], int]) -> Types.NONE
    E         ?                                ++++++ ^^^
    
    tests/refactor/test_utils.py:149: AssertionError
    
  • waterloo/refactor/annotations.py:59: DeprecationWarning: `structlog.threadlocal` is deprecated, please use `structlog.contextvars` instead.
    

- Used `bump-pydantic`
- `BaseModel.__fields__` and `copy()` were deprecated in favour of `model_fields` and `model_copy()` respectively.
- `BaseSettings` has been moved to the `pydantic-settings` package:
  https://docs.pydantic.dev/2.7/migration/#basesettings-has-moved-to-pydantic-settings
- `FieldInfo.type_` is no longer available, must use `FieldInfo.annotation`:
  https://www.github.com/pydantic/pydantic/issues/7220
For some reason `@_repr_type_arg.register` annotation for `_` would fail:

    NameError: name 'ImportStrategy' is not defined
@jtojnar jtojnar marked this pull request as draft September 22, 2024 21:58
- Numbers are no longer coerced to strings by default, let’s revert that in config for now.
  https://docs.pydantic.dev/2.7/migration/#validator-behavior-changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant