caesar0301/graphsim

Python 3 compatibility

Closed this issue · 3 comments

I would like to see this package Python 3 compatible, so I made some changes. The most important change is the long->int in type decorators. At the moment this might reduce max iterations in Python 2 and I do not know serious problem is.

Examples now run with both Python 2 and Python 3. I hope this might help you.
Thanks

Quar commented

Perhaps in graphsim/iter/TACSim_in_C.py: line7

use relative imports .TACSim instead of TACSim, like:

from .TACSim import node_edge_adjacency, normalized

Otherwise, module TACSim cannot be found by python3 setup.py.

Quar commented

Thanks @caesar0301 !!

In the new setup.py: line7, sudo was used to install the object file and its header to /usr/local/{lib,include}, although it is well understood under extreme circumstances, root and admin-group own these folders instead of the installer, it is still highly recommended to avoid embedding sudo in setup.py, especially without any prompts.

Perhaps setup.py: line7 can be moderated by either of the following two approaches:

  • drop sudo, and add "using sudo pip3 if encountered permission issue" in README.md (recommended).
  • add prompt such as println("--> sudo password is required to ensure install cpp-extension into /usr/local/{lib,include}:")

Such that the installer won't be "surprised 😮"

@Quar Thanks for ur advice. :>