Author Topic: Python 3.x?  (Read 21287 times)

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Python 3.x?
« on: June 27, 2020, 11:55:26 am »
Hi All,

Wondering how much interest there might be in a Python 3.x port? OS/2 support was removed from the source code around Python 3.3 - so it will be a reasonable amount of work to re-instate it. However, Samba keeps marching towards Python 3.x, and I fear that soon our 2.7.x build won't be good enough to keep Samba current....

Cheers,

Paul

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Python 3.x?
« Reply #1 on: June 27, 2020, 01:13:43 pm »
Hi Paul

I can not talk from the developers point of view, I can only talk from what I read and saw around. According to some articles I had read since 2018, python popularity was growing and it is the most used language for machine learning today. Yes, it is hot and the "cool people" are using it.

From my perspective I had found some .py scripts that I want to use, but I don't realize the full potential of it yet. I guess we should try to find out what cool things we can potentially have in OS/2 if python 3.x gets ported.

Comments are welcome.

Regards

Martin Iturbide
OS2World NewsMaster
... just share the dream.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Martin Iturbide
OS2World NewsMaster
... just share the dream.

David McKenna

  • Hero Member
  • *****
  • Posts: 743
  • Karma: +24/-0
    • View Profile
Re: Python 3.x?
« Reply #3 on: June 27, 2020, 03:15:55 pm »
Paul,

  While I don't use Python directly, it seems more and more things need Python 3 and I would definitely like to see porting to OS/2 continue, so it would be great if you could do so...

Regards,

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1317
  • Karma: +26/-0
    • View Profile
Re: Python 3.x?
« Reply #4 on: June 28, 2020, 12:06:27 am »
Hi Paul,

Indeed, Python has a tremendous amount of functionality these days, the ML stuff in particular being part of my interest.

I would love to see 3.x stuff on our platform, mostly b/c majority of ML libraries (the stuff being actively talked about, etc.) is at that level.

Thanks!

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Python 3.x?
« Reply #5 on: June 28, 2020, 12:58:25 am »
OK I'll start exploring what's required. bear in mind there is zero commitment to producing something that works. There's every chance something else shiny will pop up and distract me from this :)

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Python 3.x?
« Reply #6 on: June 28, 2020, 11:30:52 pm »
Brief status update:
I've started trying to compile using Andy Mac's build files that were formerly located in pc\os2emx - mainly as I don't have the energy right now to battle hacking configure script - and porting Python.

I nearly have a python38.dll - just missing a few symbols that I'm working through. I then need to make it work :) I don't intend on applying *all* of the old patches as there is a lot of cruft there from vacpp and emx that we don't need anymore - the aim is to apply only the minimal patches required to make it work.

I'll try and update status here periodically...

Cheers,

Paul

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Python 3.x?
« Reply #7 on: June 28, 2020, 11:53:19 pm »
python38.dll built; now to get an executable to call it - then start debugging - probably starting with path stuff - then to get modules building...

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Python 3.x?
« Reply #8 on: June 29, 2020, 08:26:25 am »
python38.dll built; now to get an executable to call it - then start debugging - probably starting with path stuff - then to get modules building...

Got a python.exe and the associated modules - of course - it doesn't work yet - I need to start applying patches - starting with path separator stuff....

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Python 3.x?
« Reply #9 on: June 30, 2020, 12:00:14 pm »
Slowly making progress....

Python path configuration:
  PYTHONHOME = '/dev/python-3.8.3'
  PYTHONPATH = (not set)
  program name = 'U:\dev\python-3.8.3\python.exe'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = 'U:\\dev\\python-3.8.3\\python.exe'
  sys.base_prefix = '/dev/python-3.8.3'
  sys.base_exec_prefix = '/dev/python-3.8.3'
  sys.executable = 'U:\\dev\\python-3.8.3\\python.exe'
  sys.prefix = '/dev/python-3.8.3'
  sys.exec_prefix = '/dev/python-3.8.3'
  sys.path = [
    '/dev/python-3.8.3/lib/python38.zip',
    '/dev/python-3.8.3/lib/python3.8/./Lib',
    '/dev/python-3.8.3/lib/python3.8/./Lib/plat-os2emx',
    '/dev/python-3.8.3/lib/python3.8/./Lib/lib-dynload',
    '/dev/python-3.8.3/lib/python3.8/./Lib/site-packages',
    '/dev/python-3.8.3/lib/python3.8/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x20036680 (most recent call first):
<no Python frame>

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Python 3.x?
« Reply #10 on: July 01, 2020, 01:34:21 am »
Far from being tested.... but....

{0}[u:\dev\python-3.8.3] python.exe PC\os2emx\script.py
Goodbye, World!

{0}[u:\dev\python-3.8.3] cat PC\os2emx\script.py
print("Goodbye, World!")

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1317
  • Karma: +26/-0
    • View Profile
Re: Python 3.x?
« Reply #11 on: July 01, 2020, 05:30:12 am »
Far from being tested.... but....

{0}[u:\dev\python-3.8.3] python.exe PC\os2emx\script.py
Goodbye, World!

{0}[u:\dev\python-3.8.3] cat PC\os2emx\script.py
print("Goodbye, World!")

NICE!!!

Thank you for the rapid updates...I for one am following them closely Paul!

Valery Sedletski

  • Sr. Member
  • ****
  • Posts: 368
  • Karma: +2/-0
    • View Profile
Re: Python 3.x?
« Reply #12 on: July 01, 2020, 05:48:50 am »
Paul, good luck with porting Python 3! I also would like to have Python 3 on OS/2, because I have some things I'd like
to have, like Electrum Bitcoin wallet, which requires a latest and greatest Python to work ok. I use it on Linux and it is good
to have on OS/2 too. Also, Web Automation tools, like Selenium, use Python 3 too. And many more programs written in
Python 3

PS: Electrum uses  PyQt for user interface, which is quite big. Though, we seem to already have PyQt4 for Python 2.x.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Python 3.x?
« Reply #13 on: July 01, 2020, 11:15:25 am »
Hi all - making progress - running Samba 4.12.3 configure with it now..... I still have a fair amount of work to do to incorporate patches.....

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Python 3.x?
« Reply #14 on: July 01, 2020, 11:18:55 am »
Hi Valery,

Paul, good luck with porting Python 3! I also would like to have Python 3 on OS/2, because I have some things I'd like
to have, like Electrum Bitcoin wallet, which requires a latest and greatest Python to work ok. I use it on Linux and it is good
to have on OS/2 too. Also, Web Automation tools, like Selenium, use Python 3 too. And many more programs written in
Python 3

PS: Electrum uses  PyQt for user interface, which is quite big. Though, we seem to already have PyQt4 for Python 2.x.

I'd suggest that unless I discover some issues in the next day or two, I'll have some sort of binary package for testing over the weekend.

I don't have any real plans to build PyQt - but you never know - my real need for this is solely due to Samba....

Cheers,

Paul