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

Bump pyvlx to 0.2.26 #115483

Merged
merged 5 commits into from
Dec 29, 2024
Merged

Bump pyvlx to 0.2.26 #115483

merged 5 commits into from
Dec 29, 2024

Conversation

pawlizio
Copy link
Contributor

@pawlizio pawlizio commented Apr 12, 2024

Proposed change

Bump pyvlx to 0.2.26 as preparation for PR #112451

Major changes:

Full change log:
Julius2342/pyvlx@0.2.21...0.2.26

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 @Julius2342, @DeerMaximum, mind taking a look at this pull request as it has been labeled with an integration (velux) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of velux 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 velux 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.

Copy link
Member

@Kane610 Kane610 left a comment

Choose a reason for hiding this comment

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

Please add a reference to the changes made since the previous library version

@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.

@home-assistant home-assistant bot marked this pull request as draft April 12, 2024 16:39
@bdraco
Copy link
Member

bdraco commented Apr 12, 2024

Its a bit unexpected that a task would be created in Julius2342/pyvlx@0.2.21...0.2.23#diff-4ad3fa98aaad618218e4216ebc26247b1b2a20b5ba8e077c57808bf5b493c291R121 as normally it would be awaited instead

@bdraco
Copy link
Member

bdraco commented Apr 12, 2024

It looks like this library does a lot of fire and forget tasks without holding a strong reference to the tasks

https://docs.python.org/3/library/asyncio-task.html#asyncio.create_task

Important Save a reference to the result of this function, to avoid a task disappearing mid-execution. The event loop only keeps weak references to tasks. A task that isn’t referenced elsewhere may get garbage collected at any time, even before it’s done. For reliable “fire-and-forget” background tasks, gather them in a collection:

@emontnemery
Copy link
Contributor

@pawlizio Do you plan to address the issues with not keeping references to tasks pointed out by @bdraco ?

@pawlizio
Copy link
Contributor Author

pawlizio commented Aug 2, 2024

Yes, I worked on a modification on pyvlx to gather all tasks... However at the moment I don't find the time to complete.. The PR for pyvlx is there, but still on a draft state.. Need to modify some module tests to make them final.

@blowk
Copy link

blowk commented Sep 28, 2024

@pawlizio I'm not completely sure, but is this patch to move your component https://github.com/pawlizio/my_velux to the Velux integration of Home Assistant?

@empi89
Copy link

empi89 commented Nov 9, 2024

Could we bump to version 0.2.25 instead? This would fix an issue with a specific cover type for some users.

@raphaelzaugg
Copy link

@pawlizio It looks like things related to the comments in this PR have been addressed in v0.2.24 of pyvlx. In addition to that I have added a missing component in v.0.2.25 that a few people depend on. Could we please adapt this PR to bump pyvlx to v0.2.25? Or do you still see things that are missing to get it accepted ?

@pawlizio pawlizio changed the title Bump pyvlx to 0.2.23 Bump pyvlx to 0.2.25 Dec 28, 2024
@pawlizio
Copy link
Contributor Author

It looks like this library does a lot of fire and forget tasks without holding a strong reference to the tasks

https://docs.python.org/3/library/asyncio-task.html#asyncio.create_task

Important Save a reference to the result of this function, to avoid a task disappearing mid-execution. The event loop only keeps weak references to tasks. A task that isn’t referenced elsewhere may get garbage collected at any time, even before it’s done. For reliable “fire-and-forget” background tasks, gather them in a collection:

@bdraco The fire-and-forget issue is now solved. In 0.2.25 the tasks are awaited when pyvlx will be disconnected: https://github.com/Julius2342/pyvlx/blob/912876029cd64cf361cebee9413bd6efd85b1e29/pyvlx/pyvlx.py#L109-L110

@pawlizio pawlizio marked this pull request as ready for review December 28, 2024 16:31
@home-assistant home-assistant bot requested a review from Kane610 December 28, 2024 16:31
Copy link
Member

@bdraco bdraco left a comment

Choose a reason for hiding this comment

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

It looks like nothing ever cleans up the tasks when they are completed so it will leak memory.

If you make self.tasks a set you can do task.add_done_callback(self.tasks.remove) after added the task to ensure its removed from the set once its done.

Example:

task.add_done_callback(self._tasks.remove)

@home-assistant home-assistant bot marked this pull request as draft December 28, 2024 18:52
@pawlizio pawlizio changed the title Bump pyvlx to 0.2.25 Bump pyvlx to 0.2.256 Dec 29, 2024
@pawlizio
Copy link
Contributor Author

It looks like nothing ever cleans up the tasks when they are completed so it will leak memory.

If you make self.tasks a set you can do task.add_done_callback(self.tasks.remove) after added the task to ensure its removed from the set once its done.

Example:

task.add_done_callback(self._tasks.remove)

@bdraco Thanks for the hint, I considered this in pyvlx 0.2.26 now

@pawlizio pawlizio requested a review from bdraco December 29, 2024 01:25
@pawlizio pawlizio marked this pull request as ready for review December 29, 2024 01:25
@bdraco bdraco dismissed Kane610’s stale review December 29, 2024 19:01

Changelog has been linked

@bdraco
Copy link
Member

bdraco commented Dec 29, 2024

Thanks @pawlizio

@bdraco bdraco added this to the 2025.1.0 milestone Dec 29, 2024
@bdraco bdraco added the smash Indicator this PR is close to finish for merging or closing label Dec 29, 2024
@pawlizio pawlizio changed the title Bump pyvlx to 0.2.256 Bump pyvlx to 0.2.26 Dec 29, 2024
@bdraco bdraco merged commit 53e69af into home-assistant:dev Dec 29, 2024
65 checks passed
bramkragten pushed a commit that referenced this pull request Dec 30, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Dec 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cherry-picked cla-signed dependency integration: velux Quality Scale: No score small-pr PRs with less than 30 lines. smash Indicator this PR is close to finish for merging or closing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Velux "Detected blocking call to load_default_certs"
8 participants