dougthor42 / wafer_map

Semiconductor Wafer Mapping
GNU General Public License v3.0
74 stars 33 forks source link

python 2/3 compatibility #32

Open werdnav opened 8 years ago

werdnav commented 8 years ago

Moving the project to python 3 appears to have a number of compromises. Do you have any interest in maintaining a python2 branch? Or making the project backwards compatible with python 2?

dougthor42 commented 8 years ago

Can you elaborate on those compromises?

I had both a Py2 and Py3 branch before, but they were getting too far apart, commit-wise, so I decided to merge them. I don't think I'll do separate 2/3 branches again, but I'll look into either (a) making the new Py3 master backwards-compatible or (b) creating a new standalone project like wafer_map_py2

Do you have a preference?

werdnav commented 8 years ago

The 'compromises' are specific to my system (Linux Mint); but may apply to other systems. The most current Linux Mint LTS and Ubuntu LTS support python 2x (out of box) and the default package manage supports wxPython for python 2x. I do know wxPython supports python 3x; but this is not available from the default package manager. Which means its painful to deploy wafer_map on anything other than my own custom built/configured system.

I also have an interest in integrating wafer_map into an existing python 2x project. I can achieve this by rolling back to tag 1.0.6. But I was wondering if you were interested in supporting both python 2x and python 3x. I agree, two branches will diverge and become very messy, very quickly. But I also think the same is true if wafer_map_py2 was moved to a separate project.

I'm not sure what's the best approach here. One option: the master branch supports python 2; and is forwards compatible with python 3. There are a few articles about making existing python 2x projects python 3x compatible; but I'm not sure how this works with third party packages e.g. does wxPython Py2 have identical function calls as wxPython Py3...? (I'm not sure).

Related discussion on Python 2 vs Python 3 for new projects: http://stackoverflow.com/questions/11938786/new-project-python-2-or-python-3

As a stand-alone app, wafer_map is perfectly fine. The difficulty occurs when integrating wafer_map into Python 2 projects and systems that do not support Python 3 by default.

dougthor42 commented 8 years ago

I'll make it backwards-compatible, at least for a little while (~1yr, maybe? I haven't decided how long).

I'm a big proponent of everyone moving away from 2.x, but if it helps you out than I'm more than happy to do it.

werdnav commented 8 years ago

That would be helpful. Thank you. It also means any improvements I make can be (optionally) pulled into the main branch.

dougthor42 commented 8 years ago

It turns out that there isn't much to do for Python2 compatibility. The hard part is wxPython 2.x compatibility.

Are you OK with using wxPython-Phoenix on Py2.7?

werdnav commented 8 years ago

That should be ok. I'm running Py2.7 and just tried installing wxPython 3.0.2.0 from source. The build and install was successful, but the example.py is throwing error: "TypeError: in method 'Menu_Append', expected argument 2 of type 'int'". I'll document this error separately. Could be related to the wxPython version.

Corey0606 commented 5 years ago

Excuse me sir, can i recoding you wafer_map to come true a function that i can use mouse to choose area? you think it can come true easily? Last but no least this project can Compatible with wxpython2.x? Thank you