Skip to content

migrate to pydantic v2.0#168

Merged
GrandMoff100 merged 9 commits into
HomeAssistant-API:devfrom
kizill:migrate_to_pydantic_v2
Jan 12, 2024
Merged

migrate to pydantic v2.0#168
GrandMoff100 merged 9 commits into
HomeAssistant-API:devfrom
kizill:migrate_to_pydantic_v2

Conversation

@kizill
Copy link
Copy Markdown
Contributor

@kizill kizill commented Jan 9, 2024

My home project (Telegram-bot + python backend for serving as our village metostation and infoservice) is written on FastAPI, which recently migrated to Pydantic 2.0. I'd like to see this project also updated to Pydantic 2.0.

@GrandMoff100
Copy link
Copy Markdown
Collaborator

Oh hey. Sorry about the tests. It looks like the test environment isn't playing nice with external contributors. I'll work on fixing it

@kizill
Copy link
Copy Markdown
Contributor Author

kizill commented Jan 10, 2024

Hi @GrandMoff100 ! I'd guessed that, but now i'm trying to fix sphinx documentation generation errors, do you have some clues on how to fix that error? I've never worked with sphinx docs :)

@GrandMoff100
Copy link
Copy Markdown
Collaborator

I wonder if the autodoc for the pydantic models isn't working with v2.

@GrandMoff100
Copy link
Copy Markdown
Collaborator

GrandMoff100 commented Jan 10, 2024

I think i fixed the Unauthorized errors by hardcoding the token (its non-sensitive anyway) so now it should be able to be used by forks. We'll just need to pull the base branch back into this branch, so the changes to the workflow file can take effect for this pr.

As for the docs, i think we didn't properly migrate to autodoc_pydantic 2.x.x

For starters there's some method exclusions that should probably be changed to account for pydantic v2 methods now.

image

I can't look into it atm, but here's the docs for autodoc pydantic if you could look into what changed with autodoc pydantic in response to pydantic v2. https://autodoc-pydantic.readthedocs.io/en/stable/users/usage.html

let me know how it goes.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5cbf289) 99.58% compared to head (dfda569) 99.58%.
Report is 2 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #168      +/-   ##
==========================================
- Coverage   99.58%   99.58%   -0.01%     
==========================================
  Files          20       20              
  Lines         965      961       -4     
==========================================
- Hits          961      957       -4     
  Misses          4        4              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kizill kizill marked this pull request as ready for review January 11, 2024 10:16
@kizill kizill requested a review from GrandMoff100 as a code owner January 11, 2024 10:16
@kizill
Copy link
Copy Markdown
Contributor Author

kizill commented Jan 11, 2024

Done with autodocs, pls review 😉

@GrandMoff100
Copy link
Copy Markdown
Collaborator

Yay! Reviewing now

@GrandMoff100 GrandMoff100 merged commit 93857fa into HomeAssistant-API:dev Jan 12, 2024
@GrandMoff100
Copy link
Copy Markdown
Collaborator

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.

2 participants