Menu

#26 Move to Python 3 (and potentially to github)

open
nobody
None
1
2023-01-07
2021-06-21
No

Hi I just found out about this project. I see that projects like cmder use clink by default which does something quite similar to PyCMD, but are in lua. Would be pretty nice to use PyCMD instead but would be much better if it was using python 3+, and better yet if development was happening on github. Is there any plans for those?

Discussion

  • UFO

    UFO - 2022-11-30

    Hi Horea,
    yes, you should really move your great project to Github.
    Regarding Python 3: I've pushed a branch today which is compatible with Python 2 and Python 3, since I've needed it to be compatible with both versions in a personal project. I've tested it with Python 3.10 and Python 2.7.
    The branch is directly based on the source that you uploaded 2 weeks ago: https://github.com/ufo/PyCmd/tree/raw_fork_from_sourceforge_py3_compatible . So you could simply take a look at the diff and maybe merge it into your project.
    Best regards

     
    • Horea Haitonic

      Horea Haitonic - 2022-11-30

      I had a quick look and this looks very nice (and quite helpful) -- thank you very much!
      I was actually planning to work on the Py3 porting during the next few days as I have some spare time; so your contribution comes at the perfect time :) I will review the diff and come back to you to discuss about integrating the changes.

       
    • Horea Haitonic

      Horea Haitonic - 2022-12-02

      The patch did not apply directly (I had some unpushed commits on my local branch -- my bad) so I sort of went through your changes and applied them manually, with some small adjustments here and there; you can see the result on branch "py3" in the SF repo.

      Among the adjustments I would note:
      1. dropped support for Py2: I expect most users' init.py files are Py3-compatible, or at least can be ported trivially
      2. simplified the console.py port
      3. fixed the setting of the window title (via SetConsoleTitleA)

      Now I would like to merge this work into the master branch and credit you (1) in the commit description and (2) in the NEWS.txt where the porting to Py3 will be announced. If you agree to this plan, please let me know how you want to be credited (name and/or email and/or github account).

      Note that the cx_freeze script and the Makefile are yet to be ported; also Py3 should bring improved support for non-ASCII/non-codepage paths, which PyCmd should now be able to finally handle properly.

      Once again, thank you for your contribution -- it really helps the project. I hope that we can cooperate further (and smoother!) after I relocate the project to github and get access to more modern collaboration methods (e.g. pull requests).

       
  • UFO

    UFO - 2022-12-03

    Hi Horea,
    thanks a lot, but no need to credit me! I've seen some other forks of your project on Github in the past and just gathered some Python 3 port patches from here and there. In the end I didn't have to add a lot (of quick and dirty hacks) to make it really work for me. Then I just created a branch to make it easier for you to diff, because the other forks on Github always added a lot of additional strange features, so it was kinda cumbersome to see the naked Python 3 port. I see you already correctly cleaned up the port, so thanks for your work again. Looking forward to see your project on Github. I'm sure there will be others too contributing to it. I also tried patching it that it could be simultaneously be packed as a Windows-only .whl file, so that it could be uploaded on pypi.org and installed via 'pip'. Besides still being freezed as an exe. But I failed bringing both package structure types together. Maybe I'll soon give it another try, since I'm sure I'll still be using PyCmd in the future. I have a look at other tools (new MS Terminal, cmder, ConEmu) sometimes, but they will all keep missing the unix-like feeling/features that you add(ed) for PyCmd. Please keep it up!
    Best regards

     
    • Horea Haitonic

      Horea Haitonic - 2022-12-04

      I'd still like to thank you: you did spend some time/effort on this, and pointed me to a nice starting point for me to work on.
      The whatsnew would say "thanks github.org/ufo for help" -- unless you object (or prefer an alternate credit such as name or email).

       
  • UFO

    UFO - 2022-12-04

    I'm of course fine with it, just like you suggested.
    Thanks

     
  • Horea Haitonic

    Horea Haitonic - 2023-01-07

    The changes for the Py3 port have now been merged into master and released with 20230107. Thanks @UFO for helping with this!

     
  • Horea Haitonic

    Horea Haitonic - 2023-01-07

    The PyCmd project has moved to GitHub: https://github.com/horeah/PyCmd

     

Log in to post a comment.