Tribler / tribler

Privacy enhanced BitTorrent client with P2P content discovery
https://www.tribler.org
GNU General Public License v3.0
4.85k stars 451 forks source link

Migration to python 3.11 #7282

Open drew2a opened 1 year ago

drew2a commented 1 year ago

Python 3.11 offers some performance improvements that are good to have: https://docs.python.org/3/whatsnew/3.11.html#faster-runtime.

Python 3.11 also is a must-have for all Apple Silicone owners if they want to build Tribler easily: https://github.com/Tribler/tribler/issues/7252 https://github.com/Tribler/tribler/pull/7281

Currently, the following libraries from Tribler's dependencies are not ready for this migration:

ichorid commented 1 year ago

The real problem is Libtorrent: building it with Python 3.11 requires Boost 1.81, which was published only recently. However, the PIP version of Libtorrent is pretty old and does not support 3.11.

Related discussions: Instructions for building Libtorrent with Python 3.11 bindings

"update pypi libtorrent"

"Who is responsible for which Python PIP package?"

drew2a commented 1 year ago

@ichorid thank you for the information! I've updated the issue's description.

Solomon1732 commented 1 year ago

I'll add that Python 3.10 added match statements: What's new in python 3.10, specification, motivations and rationale, tutorial. It can negate the need for many if-elif chains when writing code.

Solomon1732 commented 1 year ago

There looks to be a difference between this somewhat older libtorrent version and this 2.0 branch. Namely, python 3.11 isn't skipped anymore. That said, I don't know if said branch is a stable release or a release candidate. Its release page isn't clear about it: https://github.com/arvidn/libtorrent/releases

ichorid commented 1 year ago

I don't know if said branch is a stable release or a release candidate. Its release page isn't clear about it: https://github.com/arvidn/libtorrent/releases

Just go ask Arvid directly at Libtrorrent github page (e.g. discussions of Issue) :wink:

Solomon1732 commented 1 year ago

Done. Hopefully I'll be answered Soon:tm:: https://github.com/arvidn/libtorrent/issues/7265#issuecomment-1627030797

Solomon1732 commented 1 year ago

Yes, it's stable:

Anything with a release version is stable

https://github.com/arvidn/libtorrent/issues/7265#issuecomment-1634090403 I hope it'll help the migration efforts?

drew2a commented 1 year ago

From what I see, Python 3.11 support isn't available in either v2.0.9 or v1.2.19.

Support for Python 3.11 is only present in RC_2_0.

You can find the specific commit here.

Solomon1732 commented 1 year ago

I missed it. Thanks. It's a shame. Hopefully it'll be be supported soon.

kozlovsky commented 1 year ago

PonyORM 0.7.17 with Python 3.11 support is out! So, what's left is libtorrent

Solomon1732 commented 7 months ago

libtorrent version 2.0.10 came out in February 2024. It looks like it supports Python 3.11 now? I am wondering tentatively. Here's the release: https://github.com/arvidn/libtorrent/releases/tag/v2.0.10

One of the notes says this:

Bump boost version to enable Python 3.11 package builds by @cas-- in https://github.com/arvidn/libtorrent/pull/7445

Also, if tribler migrates to Python 3.11, does it mean issues like #7869 can be closed, if only to tidy things up?

drew2a commented 7 months ago

@Solomon1732, thank you for noticing this and keeping us informed.

Currently, we use libtorrent 1.2.x in Tribler. Switching to 2.x is still under debate. For more information, please check:

RealJosephKnapp commented 1 month ago

Perhaps it is time to upgrade to Libtorrent 2.0.10, and to upgrade its dependencies to Boost 1.86, zlib 1.3.1 and OpenSSL 3.3.2.