Bitmessage / PyBitmessage

Reference client for Bitmessage: a P2P encrypted decentralised communication protocol:
https://bitmessage.org/wiki/Main_Page
Other
2.81k stars 578 forks source link

Python3 + PyQt6 port for Debian derived Linux #2227

Closed kashikoibumi closed 1 month ago

kashikoibumi commented 1 month ago

Managed to work with Python3 + PyQt6 for Debian derived Linux. Runnable with start.sh .

Currently, one to one messaging with randomly generated address is not working. It requires some more work and test. Messaging by chan, broadcast, deterministic generated address is working.

Although, this is far from perfect, this may be worth for porting to Python3, since this is a working example.

kashikoibumi commented 1 month ago

Updated: One-to-one messaging involving getpubkey works now.

PeterSurda commented 1 month ago

I appreciate your enthusiasm. However may I recommend focusing on the tests, and leaving Qt for later? There have been attempts to do a quick and dirty port to python3, but they all had code quality problems.

kashikoibumi commented 1 month ago

I don't care what GUI toolkit you choose finally at all. I choose PyQt6 merely because PyBitmessage is using PyQt4 for long time. There is no other good reason. But Python2 is already abandoned. So if you want to use some Python today or tomorrow or perhaps yesterday, it must be Python3. I care that. I understand my quick dirty fix has no quality now. I think I can be work a bit more hard for quality later, but current priority is somewhat working example. I also think that discussing code quality in Python is totally nonsense. If you want the code to be clean and robust, you should abandon Python just now and migrate to a good language at least using static typing.

I have no love in Python nor Qt, but I love Bitmessage :)

I will continue fixing remained problems and code quality of my pull request as long as my motivation is retained.

kashikoibumi commented 1 month ago

Since I am not a Python programmer, I struggled to adapt my code to your validators whole the last night, and finally totally failed. I used autopep8, pycodestyle and flake8, but I had to manually split long lines and then manually indent by trial and error. It was a nightmare.

Finally, I found a tool named 'black'. black seems to be totally automatic and strict, although it modifies all the source code files totally into her style. I prefer black. Can I use it?

kashikoibumi commented 1 month ago

It's too late, but I found a tool to abstract away Qt versions: https://github.com/mottosso/Qt.py . And also it's more too late, I found the tool is mensioned in the issue: 'Porting bitmessageqt to Qt5 #1389'. I think I should switch to that line.

kashikoibumi commented 1 month ago

I have switched to use Qt.py in #2250 . So this PR should be closed now.