xcfem / xc

finite element analysis package for civil engineering structures.
http://www.xcengineering.xyz/html_files/software.html
GNU General Public License v3.0
262 stars 54 forks source link

migration to python3 #56

Closed ghost closed 4 years ago

ghost commented 5 years ago

If you consider moving to Python 3 before Python 2's End-of-Life which is January 1, 2020. I would be more than happy to give a hand and help about it.

lcpt commented 5 years ago

Hi, thank you very much for your offer.

I think we can make the code run under both Python 2 and Python 3. I've started with the modules in xc_utils, you can take a look to the last commit.

I was trying to make one of the simplest tests test_evalPy.py to run under Python3. I've not succeeded there is some problem when installing the c++ extensions; Python3 doesn't find them. Maybe you can take a look to the setup file. It puts the libraries in '/usr/local/lib/python3/dist-packages' but Python3 doesn't find them.

Regards. Luis.

ghost commented 5 years ago

You're welcome ;)

I will look at the file later, but as I can see from your comment, there's no address as '/usr/local/lib/python3/dist-packages' at least in Debian-based distros. In Debian minor version of python should be included, something like: '/usr/local/lib/python3.5/dist-packages'

regards. Salman

lcpt commented 5 years ago

Hi.

It's the line; 'pth_to_libs= get_python_lib(1,0,myPrefix)' in setup.py which returns the directory for the libraries: '/usr/local/lib/python2.7/dist-packages' when executed with Python 2 and '/usr/local/lib/python3/dist-packages' when executed with Python3. I'm using Ubuntu 18.04.

berndhahnebach commented 5 years ago

good luck luis with the move to Py3. On FreeCAD it took a huge amount of time ... but eventualle it was worth any second spent ont the move to Py3.

cheers bernd

lcpt commented 5 years ago

Thanks Bernd.

The first thing I'm trying to do is to expose XC c++ modules to Py3 (i thought that it was a trivial step but, apparently, it is not so trivial...). On the bright side I think XC is simpler than FreeCAD.

ebrahimraeyat commented 4 years ago

Hi @lcpt , what is going on this migration? any effort? thanks.

lcpt commented 4 years ago

Hi Ebrahim.

We've postponed the migration of the C++ modules to Python 3 until the release of Ubuntu 20.4 in April. I think that working with a distribution that comes with Python 3 as default will make things a lot easier. In the interim we are gently migrating the Python modules.

lcpt commented 4 years ago

https://mobile.linuxtoday.com/developer/python-2-removed-from-ubuntu-20.04-lts-200219221006.html?utm_source=dlvr.it&utm_medium=twitter

lcpt commented 4 years ago

I've just finished with the migration of the xc_utils package. I'll continue with XC soon. It doesn't seem too difficult.

lcpt commented 4 years ago

Done! It needed 18:09 hours of work, not so bad.

Migration to Python 3 is completed.

berndhahnebach commented 4 years ago

YEAH! It took much much more hours to port FreeCAD

lcpt commented 4 years ago

FreeCAD is much more complex.