Skip to content

Remove unneeded construct import for Eq3btsmart#95419

Closed
Lash-L wants to merge 2 commits intohome-assistant:devfrom
Lash-L:remove_unneeded_construct_import_eq3btsmart
Closed

Remove unneeded construct import for Eq3btsmart#95419
Lash-L wants to merge 2 commits intohome-assistant:devfrom
Lash-L:remove_unneeded_construct_import_eq3btsmart

Conversation

@Lash-L
Copy link
Copy Markdown
Contributor

@Lash-L Lash-L commented Jun 27, 2023

Breaking change

Proposed change

I am working on a problem with construct in the Roborock integration, and I realized that the construct version is hardlocked in homeassistant in three places

  1. Eddystone (Remove unneded construct import for Eddystone #95418)- not used in the actual integration - only in the base package, where it is set to 'construct>=2.9.52,<2.11'
  2. eq3btsmart - not used in the actual integration - only in the base pacakge, where it is set to "*"
  3. xiaomi_miio - used in the integration only for error checking

For all of these - the actual integration has no real dependence on construct, just the package, and as such, the dependency should probably only be specified inside the package

Feel free to tell me if this is wrong for any reason.

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

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

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 Black (black --fast 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
Copy Markdown

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

Code owner commands

Code owners of eq3btsmart 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 eq3btsmart Removes the current integration label and assignees on the pull request, add the integration domain after the command.

@Lash-L
Copy link
Copy Markdown
Contributor Author

Lash-L commented Jun 27, 2023

Hey rytilahti, I know you're also the codeowner for xiaomi miio. I personally don't have miio for any of my devices and to remove the construct dependency, I assume I would need to do the try except inside the package rather than inside the integration, is that something you would be able to add to your to-do list? I could attempt, but I don't want to break anything

Copy link
Copy Markdown
Contributor

@emontnemery emontnemery left a comment

Choose a reason for hiding this comment

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

Please rebase the PR

@home-assistant home-assistant bot marked this pull request as draft June 28, 2023 12:01
@home-assistant
Copy link
Copy Markdown

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.

@emontnemery emontnemery marked this pull request as ready for review June 28, 2023 14:44
@home-assistant home-assistant bot requested a review from emontnemery June 28, 2023 14:44
@balloob
Copy link
Copy Markdown
Member

balloob commented Jun 28, 2023

Construct is pinned because the author doesn't believe in backwards compatibility, and so each version contains breaking changes. See construct/construct#428 (comment)

It is strongly recommended to not use construct

@emontnemery
Copy link
Copy Markdown
Contributor

Thanks @balloob for the background 👍

I think it would be clearer to pin the version in homeassistant/package_constraints.txt together with a comment explaining why we pin it?

@Lash-L
Copy link
Copy Markdown
Contributor Author

Lash-L commented Jun 28, 2023

That is good context, I didn't realize. Went through that issue and the matching issues

miio seems to have dropped the strict pin starting here stating that it was stable: rytilahti/python-miio#384

However, the last version is from Feb of 2022 and it doesn't seem like new updates are still coming out.

I have just been trying to figure out a problem with a small subset of users (~5) who are getting an error from construct and we figured bumping the version was a good thing ot try #94197

But long term, we should probably move away from construct in general, however that is a larger change than I have time for in the short term.

But either way, shouldn't the individual packages specify what version of construct is breaking? If >2.10.56 is breaking, shouldn't it be thrown in the pyproject and the pip dependency resolver will throw an error if another integration tries to use a higher version? Why does it need to be specified as a integration requirement constraint?

I know I could 100% be missing something

@emontnemery
Copy link
Copy Markdown
Contributor

I'm closing this PR based on @balloob's explanation of why we pin construct, we won't merge the PR in its current state.

@Lash-L I still think a PR which instead of removing the pinned construct version moves the pinning to homeassistant/package_constraints.txt together with a comment explaining why we pin it

@github-actions github-actions bot locked and limited conversation to collaborators Jul 18, 2023
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.

4 participants