lbryio / lbry-sdk

The LBRY SDK for building decentralized, censorship resistant, monetized, digital content apps.
https://lbry.com
MIT License
7.2k stars 483 forks source link

Bump to Python 3.9 attempt 3. #3711

Closed moodyjon closed 1 year ago

moodyjon commented 1 year ago

This is a further simplified version of https://github.com/lbryio/lbry-sdk/pull/3623.

Recent test fixes and hub fixes have enabled me to drop the test hacks (i.e. asyncio.sleep) and get a pretty high passing rate. I have 10 passing runs so far (and 10 more queued): https://github.com/moodyjon/lbry-sdk/actions/runs/3515646843 https://github.com/moodyjon/lbry-sdk/actions/runs/3516711314 https://github.com/moodyjon/lbry-sdk/actions/runs/3516712259 https://github.com/moodyjon/lbry-sdk/actions/runs/3516713098 https://github.com/moodyjon/lbry-sdk/actions/runs/3516714041 ...etc

The changes related to stream_manager.py, file_manager.py, torrent_manager.py, managed_stream.py, test_streaming.py, test_stream_manager.py were STILL necessary. Timing of some things has changed specifically due to the python 3.9 upgrade, and the tests became unreliable with python 3.9. The changes make various stop() methods synchronous -- they cancel subtasks and WAIT on them to finish now. I also have some failing results with these changes removed:

https://github.com/moodyjon/lbry-sdk/actions/runs/3517690064 https://github.com/moodyjon/lbry-sdk/actions/runs/3517752779 https://github.com/moodyjon/lbry-sdk/actions/runs/3517753652

moodyjon commented 1 year ago

I think my test runs are being affected by https://github.com/lbryio/lbry-sdk/issues/3710. Have added https://github.com/lbryio/lbry-sdk/pull/3711/commits/ffd5a33a1e7fc0be3db8803f6b3a585b246d23e2 to work around.

coveralls commented 1 year ago

Coverage Status

Coverage: 57.069%. Remained the same when pulling 16a2ae4bf37071a48a8656ab2871cbfd4596d337 on moodyjon:py39_3 into c118174c1a9216bc4cd9fd511b150e89ff51d665 on lbryio:master.

moodyjon commented 1 year ago

Based on review comment from @jackrobison, I bumped the python_requires to >= 3.8 as that is when CancelledError became a subclass of BaseException. Code to handle CancelledError being a subclass of Exception was removed.

Tests passed on 3.8, so I chose python_requires>=3.8. But the goal is to build and deploy a version that uses 3.9.

robd003 commented 1 year ago

@moodyjon is this still being worked on or did the SEC decision cease the project?

moodyjon commented 1 year ago

@moodyjon is this still being worked on or did the SEC decision cease the project?

I don't know that the project will cease totally, but future work has to be voluntary without pay.

I have pinged @eukreign about this. It's ready to go in my opinion.