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

Fix: Use pydantic 1.10 due to homeassistant incompatibility with pydantic>2.0 #269

Merged
merged 4 commits into from
Jan 3, 2024

Conversation

CM000n
Copy link
Collaborator

@CM000n CM000n commented Jan 2, 2024

There is currently an error when trying to use the latest mytoyota version under a Homeassistant env.
This is apparently due to the pydantic>=2.0. incompatibility of some of the packages included in Homeassitant.
We should therefore also use pydantic=1.10 as the maximum version for the time being.

home-assistant:~# pip install mytoyota==1.0.0
Looking in indexes: https://pypi.org/simple, https://wheels.home-assistant.io/musllinux-index/
Collecting mytoyota==1.0.0
  Downloading mytoyota-1.0.0-py3-none-any.whl.metadata (5.7 kB)
Requirement already satisfied: arrow<2.0,>=1.1 in /usr/local/lib/python3.11/site-packages (from mytoyota==1.0.0) (1.3.0)
Collecting hishel<0.0.20,>=0.0.19 (from mytoyota==1.0.0)
  Downloading hishel-0.0.19-py3-none-any.whl.metadata (8.1 kB)
Requirement already satisfied: httpx>=0.18.1 in /usr/local/lib/python3.11/site-packages (from mytoyota==1.0.0) (0.25.0)
Collecting langcodes<4.0,>=3.1 (from mytoyota==1.0.0)
  Downloading langcodes-3.3.0-py3-none-any.whl (181 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 181.6/181.6 kB 4.5 MB/s eta 0:00:00
Collecting pydantic<3.0.0,>=2.5.1 (from mytoyota==1.0.0)
  Downloading pydantic-2.5.3-py3-none-any.whl.metadata (65 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65.6/65.6 kB 23.5 MB/s eta 0:00:00
Requirement already satisfied: pyjwt<3.0.0,>=2.8.0 in /usr/local/lib/python3.11/site-packages (from mytoyota==1.0.0) (2.8.0)
Requirement already satisfied: python-dateutil>=2.7.0 in /usr/local/lib/python3.11/site-packages (from arrow<2.0,>=1.1->mytoyota==1.0.0) (2.8.2)
Requirement already satisfied: types-python-dateutil>=2.8.10 in /usr/local/lib/python3.11/site-packages (from arrow<2.0,>=1.1->mytoyota==1.0.0) (2.8.19.14)
Requirement already satisfied: certifi in /usr/local/lib/python3.11/site-packages (from httpx>=0.18.1->mytoyota==1.0.0) (2023.11.17)
Requirement already satisfied: httpcore<0.19.0,>=0.18.0 in /usr/local/lib/python3.11/site-packages (from httpx>=0.18.1->mytoyota==1.0.0) (0.18.0)
Requirement already satisfied: idna in /usr/local/lib/python3.11/site-packages (from httpx>=0.18.1->mytoyota==1.0.0) (3.6)
Requirement already satisfied: sniffio in /usr/local/lib/python3.11/site-packages (from httpx>=0.18.1->mytoyota==1.0.0) (1.3.0)
Collecting annotated-types>=0.4.0 (from pydantic<3.0.0,>=2.5.1->mytoyota==1.0.0)
  Downloading annotated_types-0.6.0-py3-none-any.whl.metadata (12 kB)
Collecting pydantic-core==2.14.6 (from pydantic<3.0.0,>=2.5.1->mytoyota==1.0.0)
  Downloading pydantic_core-2.14.6-cp311-cp311-musllinux_1_1_x86_64.whl.metadata (6.5 kB)
Requirement already satisfied: typing-extensions>=4.6.1 in /usr/local/lib/python3.11/site-packages (from pydantic<3.0.0,>=2.5.1->mytoyota==1.0.0) (4.9.0)
Requirement already satisfied: anyio<5.0,>=3.0 in /usr/local/lib/python3.11/site-packages (from httpcore<0.19.0,>=0.18.0->httpx>=0.18.1->mytoyota==1.0.0) (4.0.0)
Requirement already satisfied: h11<0.15,>=0.13 in /usr/local/lib/python3.11/site-packages (from httpcore<0.19.0,>=0.18.0->httpx>=0.18.1->mytoyota==1.0.0) (0.14.0)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.11/site-packages (from python-dateutil>=2.7.0->arrow<2.0,>=1.1->mytoyota==1.0.0) (1.16.0)
Downloading mytoyota-1.0.0-py3-none-any.whl (40 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 40.3/40.3 kB 128.0 MB/s eta 0:00:00
Downloading hishel-0.0.19-py3-none-any.whl (30 kB)
Downloading pydantic-2.5.3-py3-none-any.whl (381 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 381.9/381.9 kB 10.5 MB/s eta 0:00:00
Downloading pydantic_core-2.14.6-cp311-cp311-musllinux_1_1_x86_64.whl (2.1 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 11.4 MB/s eta 0:00:00
Downloading annotated_types-0.6.0-py3-none-any.whl (12 kB)
Installing collected packages: pydantic-core, langcodes, annotated-types, pydantic, hishel, mytoyota
  Attempting uninstall: pydantic
    Found existing installation: pydantic 1.10.12
    Uninstalling pydantic-1.10.12:
      Successfully uninstalled pydantic-1.10.12
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
pykoplenti 1.2.2 requires pydantic~=1.10, but you have pydantic 2.5.3 which is incompatible.
aiopurpleair 2022.12.1 requires pydantic<2.0.0,>=1.10.2, but you have pydantic 2.5.3 which is incompatible.
aionotion 2023.5.5 requires pydantic<2.0.0,>=1.10.7, but you have pydantic 2.5.3 which is incompatible.
pyaussiebb 0.0.15 requires pydantic<2.0.0,>=1.9.0, but you have pydantic 2.5.3 which is incompatible.
aioopenexchangerates 0.4.0 requires pydantic<2.0,>=1.9, but you have pydantic 2.5.3 which is incompatible.
demetriek 0.4.0 requires pydantic<2.0.0,>=1.9.0, but you have pydantic 2.5.3 which is incompatible.
systembridgemodels 3.10.5 requires pydantic<2.0.0, but you have pydantic 2.5.3 which is incompatible.

We should switch back to pydantic >= 2.0 as soon as the issue on home assistant side is resolved: home-assistant/core#99218

@CM000n CM000n added the 🐛 bug label Jan 2, 2024
@CM000n CM000n requested a review from DurgNomis-drol January 2, 2024 22:03
@CM000n CM000n self-assigned this Jan 2, 2024
Copy link

codecov bot commented Jan 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1c53e57) 75.33% compared to head (a9c4f45) 72.46%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #269      +/-   ##
==========================================
- Coverage   75.33%   72.46%   -2.87%     
==========================================
  Files          27       28       +1     
  Lines        1277     1351      +74     
==========================================
+ Hits          962      979      +17     
- Misses        315      372      +57     
Flag Coverage Δ
unittests 72.46% <ø> (-2.87%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@CM000n
Copy link
Collaborator Author

CM000n commented Jan 2, 2024

Hi @GitOldGrumpy. Since @DurgNomis-drol seems to be quite busy and inactive here lately; Could you approve this MR without maintainer rights?
I don't know if it works, but it would be worth a try 😉

@CM000n CM000n changed the title Fix: Use pydantic 1.9 due to homeassistant compatibility Fix: Use pydantic 1.10 due to homeassistant compatibility Jan 2, 2024
@CM000n CM000n changed the title Fix: Use pydantic 1.10 due to homeassistant compatibility Fix: Use pydantic 1.10 due to homeassistant incompatibility with pydantic>2.0 Jan 2, 2024
@CM000n CM000n requested a review from joro75 January 3, 2024 11:02
@GitOldGrumpy
Copy link
Collaborator

Hi @GitOldGrumpy. Since @DurgNomis-drol seems to be quite busy and inactive here lately; Could you approve this MR without maintainer rights? I don't know if it works, but it would be worth a try 😉

Afraid I dont have such options, maybe if you can add me to the list of reviewers I will have such an option?

@CM000n
Copy link
Collaborator Author

CM000n commented Jan 3, 2024

Hi @GitOldGrumpy. Since @DurgNomis-drol seems to be quite busy and inactive here lately; Could you approve this MR without maintainer rights? I don't know if it works, but it would be worth a try 😉

Afraid I dont have such options, maybe if you can add me to the list of reviewers I will have such an option?

Unfortunately not. Looks like I can only request a review from maintainers. :-/

Copy link
Owner

@DurgNomis-drol DurgNomis-drol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks ❤️

@CM000n CM000n merged commit 6e651ed into master Jan 3, 2024
25 checks passed
@CM000n CM000n deleted the fix/use_pydantic_<_2.0 branch January 3, 2024 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pydantic v2 migration issue
3 participants