3-manifolds / Spherogram

Spherogram is a Python module for dealing with the kind of planar diagrams that arise in 3-dimensional topology, such as link and Heegaard diagrams. It a component of the larger SnapPy project.
https://snappy.math.uic.edu/spherogram.html
19 stars 8 forks source link

some details about python3 (no xrange, no has_key, correct print, etc) #13

Closed fchapoton closed 3 years ago

fchapoton commented 3 years ago

seems that python is not python3 in the ubuntu 18.04 context ?

NathanDunfield commented 3 years ago

seems that python is not python3 in the ubuntu 18.04 context ?

The error message cibuildwheel 2.x no longer supports Python < 3.6. Please use the 1.x series or update CIBW_SKIP is not actually the issue. If you expand the build log you will see that python3.6 -m spherogram.test threw and error:

      + sh -c 'python -m spherogram.test'
  Traceback (most recent call last):
    File "/opt/python/cp36-cp36m/lib/python3.6/runpy.py", line 183, in _run_module_as_main
      mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
    File "/opt/python/cp36-cp36m/lib/python3.6/runpy.py", line 109, in _get_module_details
      __import__(pkg_name)
    File "/tmp/tmp.YmKvDHQJUO/venv/lib/python3.6/site-packages/spherogram/__init__.py", line 1, in <module>
      from .graphs import *
    File "/tmp/tmp.YmKvDHQJUO/venv/lib/python3.6/site-packages/spherogram/graphs.py", line 1
      from __future__ import print_function, range
      ^
  SyntaxError: future feature range is not defined
culler commented 3 years ago

Incidentally, even in Ubuntu 20.04 python is not python3 by default. However there is a package called python-is-python3 which creates the appropriate symlinks. That package is not available for 18.04, though, so you need to use the update-alternatives utility.

fchapoton commented 3 years ago

would you be ready to drop support for python2 ?

NathanDunfield commented 3 years ago

Yes, feel free to remove any Python 2 code --- we only support Python 3.6 and up.

fchapoton commented 3 years ago

ok, let us try by removing all future imports