Coder Social home page Coder Social logo

Convert the code to Python 3 about pysolfc HOT 29 CLOSED

shlomif avatar shlomif commented on August 28, 2024
Convert the code to Python 3

from pysolfc.

Comments (29)

shlomif avatar shlomif commented on August 28, 2024 1

Hi @AndersonTorres ! Thanks for your enthusiasm and desire to contribute. I appreciate it a lot. Currently, the main pending item is to convert the code to Python 3, but it has some prerequisites. If you can GitHub-fork the repository, create a branch and send me a pull-request that will involve one of those:

1 . Merging some duplicate code (see the recent commits into https://github.com/shlomif/PySolFC/tree/master/pysollib/ui/tktile but others may be needed).

  1. Converting code from using old APIs that were removed in python 3 to newer APIs.

  2. Copy+pasting the old APIs from the python 2.x source into a private module of ours assuming they are pure python.

  3. Other cleanups.

I will review your changes, test them and given enough merged pull reqs , I can give you a commit bit. Welcome aboard and thanks again!

from pysolfc.

shlomif avatar shlomif commented on August 28, 2024 1

@AndersonTorres : hi! Ping! Did you get my latest message? Can you please let me know what you think?

from pysolfc.

craigmac avatar craigmac commented on August 28, 2024 1

Still looking for any help? I have experience with building python2/3 compatible GUIs in tkinter/Tkinter (depending on 2/3 heh) and recently with Kivy to build cross-platform touch-enabled app. I'm looking for something to help out on in any way I can. Hopefully talk soon!

from pysolfc.

AndersonTorres avatar AndersonTorres commented on August 28, 2024

Hum... Hello, @shlomif ! I want to contribute to that project!

I played pysolfc since the times I used Arch Linux. Now I use NixOS distribution[1], and contribute to it by creating install scripts for some pieces of software [2].
I tried to run the SF.net tarball, but it runs on some problems - basically, it doesn't recognize some paths when it is installed in a non-standard location.
While searching for solutions to it, I found your clone repo.

How can I help?

1 - NixOS Official Site: http://www.nixos.org;
2 - Github repo: https://github.com/NixOS/ ; packages repo: https://github.com/NixOS/

from pysolfc.

GoodPie avatar GoodPie commented on August 28, 2024

Hey. I'm interested in helping convert to Python 3. If you still need help, let me know what you would like me to work on.

from pysolfc.

josecolella avatar josecolella commented on August 28, 2024

@shlomif I am also interested in helping the conversion to Python 3. Let me know what you would like me to work on

from pysolfc.

niharathomas avatar niharathomas commented on August 28, 2024

Also interested in helping out here! πŸ™‹

from pysolfc.

shlomif avatar shlomif commented on August 28, 2024

Thanks for your enthusiasm, people! Let's do it like that - the three of you will run the "2to3" tool locally on the tree and each will handle a range of letters of files under pysollib to check for breakages. Let's start with:

@lostmyaccount : [a-c]*.py

@josecolella : [d-f]*.py

@niharathomas : [g-i]*.py

Thanks!

from pysolfc.

eckorog2005 avatar eckorog2005 commented on August 28, 2024

let me know if you need more help.

from pysolfc.

whitenj avatar whitenj commented on August 28, 2024

How can I help?

from pysolfc.

AndersonTorres avatar AndersonTorres commented on August 28, 2024

Sorry, real life issues! I will clone it asap.

from pysolfc.

shlomif avatar shlomif commented on August 28, 2024

@AndersonTorres : ok, thanks for returning to me. Good luck!

from pysolfc.

shlomif avatar shlomif commented on August 28, 2024

Hi all! To facilitate coordination about contributing to PySol, please join me for a real time Internet chat on ##pysol on Freenode (note the double octhothrope) . I am usually "rindolf" there with a fallback "shlomif" nickname. We may set up chat rooms on different services in the future.

from pysolfc.

AndersonTorres avatar AndersonTorres commented on August 28, 2024

Well, as far as I have seen, the diff produced by 2to3 has 14996 lines!
In need to confess it is a little adventure to me, hehe!

What is the best way to do it? Testing unit by unit?

from pysolfc.

hairspring avatar hairspring commented on August 28, 2024

Should this feature request "we need to convert the code to use Python 3 instead", be "... Python 3 AS WELL"? Many systems still ship with Python 2 (e.g. 2.7) by default.

from pysolfc.

AndersonTorres avatar AndersonTorres commented on August 28, 2024

I don't think it would be a good idea to use a "dual version" - it would be duplicating the work.

from pysolfc.

hairspring avatar hairspring commented on August 28, 2024

Hi Anderson, I wasn't imagining duplicating work, I agree that would be a bad idea.

https://docs.python.org/3/howto/pyporting.html

First paragraph: With Python 3 being the future of Python while Python 2 is still in active use, it is good to have your project available for both major releases of Python. This guide is meant to help you figure out how best to support both Python 2 & 3 simultaneously.
(my bold)

from pysolfc.

shlomif avatar shlomif commented on August 28, 2024

@hairspring , @AndersonTorres : hi! It is often possible to write code that will run on both python 2.x and py 3.x. However, it may not always be worth the trouble. I should not that a recent python 3 environment can be easily installed alongside the system's python 2 environment (and it's open source and gratis), so it should not be a major concern. So I suggest we try to keep python 2 compat, but not at all costs.

from pysolfc.

jan-kleks avatar jan-kleks commented on August 28, 2024

Does dropping Python 2 support can cause any issues for the users? I guess the Windows and macOS versions will be just shipped with Python 3, and when it comes to Linux, I have found Python 3 even in the Debian repo (and Debian is known to be quite a conservative distro).

from pysolfc.

whitenj avatar whitenj commented on August 28, 2024

from pysolfc.

shlomif avatar shlomif commented on August 28, 2024

from pysolfc.

hairspring avatar hairspring commented on August 28, 2024

@shlomif Of course Python 2 support at all costs would be a mistake, but I don't get the impression it's a nightmare.

@jan-kleks Yes, Python 3 is in repositories. But you're saying that while wearing your programmer's hat!

Remember, most of those interested in running PySol want to press a download button, click install, and if it gets harder than that, game over! Admittedly, right now this github fork (?) is not for them, there's no install media as there is on SourceForge. But eventually, that's the scenario we have to keep in mind if the work here is to be reintegrated with skomoroh's project or to gain widespread support as an alternative.

So it will be easier to achieve that if the code runs on 2.7 and 3 upwards. I discount versions prior to 2.7 because I'm unaware of any mainstream platforms that aren't at least at that level.

from pysolfc.

AndersonTorres avatar AndersonTorres commented on August 28, 2024

In fact the link you provided says it is better to maintain only Py27 from 2x series if there is some need to dual porting.
But this isn't a serious problem I think. The major Linux distros already have Py3 in repos, and Py2 is to be deprecated someday.

The veredict was spoken, however.

from pysolfc.

whitenj avatar whitenj commented on August 28, 2024

from pysolfc.

shlomif avatar shlomif commented on August 28, 2024

from pysolfc.

shlomif avatar shlomif commented on August 28, 2024

@whitenj : hi! I've updated the build instructions in the README file - there was a bug there. Please try again.

from pysolfc.

shlomif avatar shlomif commented on August 28, 2024

Hi all!

I've been making headway with the conversion (after using flake8 and 2to3) here - https://github.com/shlomif/PySolFC/tree/try-to-fix-py3-bugs . It now kinda works in both python 2 and python 3, but some functionality was temporarily removed, and some may still be broken. It also needs some cleanups.

from pysolfc.

shlomif avatar shlomif commented on August 28, 2024

Hi all!

If you wish to contribute, you can tackle some of the issues with the label "bug", or do extensive testing on the py3 branch to see if there are more bugs.

@lostmyaccount :

@josecolella :

@niharathomas :

@AndersonTorres :

from pysolfc.

shlomif avatar shlomif commented on August 28, 2024

@saltycraig : the transition to python2/3 compatible code is mostly complete in the relevant branch. Nevertheless, more testing will be appreciated and one can also work on some of the feature requests or bug reports. I am going to close this bug to avoid misleading people.

from pysolfc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.