-
Notifications
You must be signed in to change notification settings - Fork 79
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
Release version 3.0 #245
Comments
I created a commit for item two in the above list, it can be found at terop@757b441. |
Thanks, commit looks good. I will leave comments if something comes to mind that is missing. I was thinking that we should also drop support for 3.8 with this release. Its end of life is in October 2024, so by the time of the release, it won't be that far away. Based on the PyPI stats, it is not very widely used. |
So is the plan to wait for October to make the release or also remove 3.8 support before official support ends (and not wait for October)? |
There is no need to wait for the official support to end. Based on current pypistats, most installations are from Python 3.10 and above. There will be a final release for v2 with the fixes that have not yet been released, and after that, we can begin preparations for the v3 release. |
Okay. I could then add another commit for the removal of Python 3.8. |
I rebased my branch from master and now it contains the following commits. |
@ttu Could you kindly check the above commits? |
@terop sorry again for the delay. I think those commits already had pretty much all required changes. I found few mentions about default adapters that should be changed to Bleak, but after that I think those are good 👍 |
Thanks for the comments @ttu. |
@terop sorry for the delay again. I finally had some time to get back to this. I created two PRs; selecting default adapter and updated verification script. Could you create a PR for dropping Python 3.7 & 3.8 support? I will still go through the functionality and test this with Linux to make sure we are not missing anything. |
I created PR #256 for updating the examples. |
Now all currently known tasks are done. |
Thanks 👍 I will make necessary updated to documentation and release a new version. |
@terop I was performing verifications before the release. I successfully ran |
@ttu Running |
The problem with Bleak seems to be the same I have been fighting with in my own application which uses ruuvitag-sensor async functions. My understanding is that you cannot run two Bleak asynchronous calls in the same process. In I have spent some time looking at the code and trying to fix / workaround this but I have been unable to find a solution. In my own application I ended up separating the code in to two parts ("main.py" and "scan.py") where "main.py" calls "scan.py" which contains ruuvitag-sensor calls. Thus in case there is a need to scan RuuviTags multiple times the calls happens in separate processes and this error does not occur. I would very much like to get rid of this hack. |
I did some more digging on this problem and it seems that https://github.com/ttu/ruuvitag-sensor/blob/master/ruuvitag_sensor/adapters/bleak_ble.py#L104 is possibly not called at the return from a Bleak async function. From the output of
|
@terop thanks for the info. It was pretty easy to debug the problem with that. I noticed that I made a change to explicitly close the generator after breaking the async for loop. Can you try to execute verifications from this branch? |
@ttu Still broken with the same error. However I did notice the the branch you mentioned contains the same commits as master branch so I assume something is missing. |
@terop sorry, the actual commit was missing from the branch 😅 Can you try again? |
@ttu Now it works, thank you! Could you commit the fix soon? I would like to use it to get rid of the hack described above. |
@terop thanks! Fix is now merged to master. |
Thanks @ttu! |
@ttu Unfortunately your commit from yesterday didn't fix the problem as I had hoped so I am asking in case you have any ideas how to fix this. I have a async function which runs |
@terop Can you provide me an example code how you are calling I suppose Linux has some limitations on using multiple instances of import asyncio
from typing import AsyncGenerator
import ruuvitag_sensor.log
from ruuvitag_sensor.ruuvi import RuuviTagSensor
from ruuvitag_sensor.ruuvi_types import MacAndSensorData
ruuvitag_sensor.log.enable_console()
async def process_data_from_iter(data_iter: AsyncGenerator[MacAndSensorData, None], source_name: str):
async for data in data_iter:
print(f"Data from {source_name}: {data[0]}")
async def main():
data_iter1 = RuuviTagSensor.get_data_async()
data_iter2 = RuuviTagSensor.get_data_async()
# Process both iterators concurrently
task1 = asyncio.create_task(process_data_from_iter(data_iter1, "Iterator 1"))
task2 = asyncio.create_task(process_data_from_iter(data_iter2, "Iterator 2"))
await asyncio.gather(task1, task2)
if __name__ == "__main__":
asyncio.run(main()) Maybe for Linux I have to try to find a way to force close previous scanner if |
I don't think it is worth checking this problem any further as most of the time the tag is not found during a second scan either. |
Tasks before creating a release:
The text was updated successfully, but these errors were encountered: