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

Constrain dacite to at least 1.7.0 #105709

Merged
merged 10 commits into from
Jan 2, 2024
Merged

Conversation

Lash-L
Copy link
Contributor

@Lash-L Lash-L commented Dec 14, 2023

Breaking change

Proposed change

Dacite is a package that converts dictionaries to dataclasses with complex types. It is used in our library to be able to take dictionaries that are multilevel nested and turn them into classes with multilevel nesting or enums. It's rather helpful.

The issue is that some custom integrations (such as hacs-govee) are pinning dacite to a lower version. hacs-govee has since made the change, but some users are not updating it or their issue is being caused by another integration.

The problem randomly started in September, before then, the correct version was always installed. I have tried everything I could think of to fix this problem.

If someone has an alternative fix, I am more than happy to hear it, but I have asked around a few times and no one has had any ideas. I am closing out issues for it rather frequently so I thought I would try this and see if it helped at all.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@home-assistant
Copy link

Hey there @humbertogontijo, mind taking a look at this pull request as it has been labeled with an integration (roborock) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of roborock can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign roborock Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

@home-assistant home-assistant bot marked this pull request as draft December 14, 2023 06:18
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@Lash-L Lash-L marked this pull request as ready for review December 18, 2023 13:42
@iMrLopez
Copy link

Just found this PR and i think that it might solve this issue i opened,#106445

@bieniu
Copy link
Member

bieniu commented Jan 1, 2024

We had a similar problem with nam, gios and brother integrations. Their backend libraries use dacite.
But I think version 1.7.0 supports UnionType https://github.com/konradhalas/dacite/releases/tag/v1.7.0

Is there another reason that you pin to version >=1.8.0?

@Lash-L
Copy link
Contributor Author

Lash-L commented Jan 1, 2024

We had a similar problem with nam, gios and brother integrations.

You say had, did those integrations solve it differently?

Is there another reason that you pin to version >=1.8.0?

Nope - fair enough, I have changed to 1.7.0

@bieniu
Copy link
Member

bieniu commented Jan 1, 2024

You say had, did those integrations solve it differently?

I pinned dacite versions in the backend libraries (>=1.7.0) and opened the issue in the custom component repositories. I think only one remains open LaggAt/hacs-govee#108

@Lash-L
Copy link
Contributor Author

Lash-L commented Jan 1, 2024

I pinned dacite versions in the backend libraries (>=1.7.0)

Interesting, that never worked for me, it still ended up downloading the wrong version for some users.

@bieniu
Copy link
Member

bieniu commented Jan 1, 2024

Interesting, that never worked for me

No no, it was never 100% sure. A custom component can force its version of the package.

Copy link
Member

@bieniu bieniu left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @Lash-L

@MartinHjelmare MartinHjelmare self-assigned this Jan 1, 2024
script/gen_requirements_all.py Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft January 1, 2024 19:32
@Lash-L Lash-L marked this pull request as ready for review January 1, 2024 19:37
@MartinHjelmare MartinHjelmare changed the title Pin Dacite for Roborock Constrain dacite Jan 1, 2024
Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Thanks!

@MartinHjelmare MartinHjelmare added this to the 2024.1.0 milestone Jan 1, 2024
@bdraco bdraco changed the title Constrain dacite Constrain dacite to at least 1.7.0 Jan 2, 2024
@bdraco bdraco merged commit cc18b9a into home-assistant:dev Jan 2, 2024
53 checks passed
frenck pushed a commit that referenced this pull request Jan 2, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jan 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Roborock integration not working for a while
7 participants