urga / djangocms-slider

A simple django cms slideshow plugin
GNU General Public License v2.0
10 stars 16 forks source link

Does not work in python3 #3

Open guziy opened 9 years ago

guziy commented 9 years ago

when trying to execute the following

./manage.py migrate slideshow

I get the error messages below:

File "/Users/huziy/virtualenvs/django-cms-test/lib/python3.4/site-packages/cms/admin/__init__.py", line 11, in <module>
    plugin_pool.plugin_pool.discover_plugins()
  File "/Users/huziy/virtualenvs/django-cms-test/lib/python3.4/site-packages/cms/plugin_pool.py", line 34, in discover_plugins
    load('cms_plugins')
  File "/Users/huziy/virtualenvs/django-cms-test/lib/python3.4/site-packages/cms/utils/django_load.py", line 57, in load
    get_module(app, modname, verbose, failfast)
  File "/Users/huziy/virtualenvs/django-cms-test/lib/python3.4/site-packages/cms/utils/django_load.py", line 41, in get_module
    module = import_module(module_name)
  File "/Users/huziy/virtualenvs/django-cms-test/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/Users/huziy/virtualenvs/django-cms-test/lib/python3.4/site-packages/slideshow/cms_plugins.py", line 4, in <module>
    from adminsortable.admin import SortableAdmin
  File "/Users/huziy/virtualenvs/django-cms-test/lib/python3.4/site-packages/adminsortable/admin.py", line 114
    except IndexError, ValueError:
                     ^
SyntaxError: invalid syntax
guziy commented 9 years ago

A OK, I see that it is not supposed to ))

driesdesmet commented 9 years ago

Well, a python3 version wouldn't hurt of course. I'm too busy right now to do anything about it, but if you want, don't hesitate to file a Pull Request.

guziy commented 9 years ago

Actually the problem is in the 2 packages slideshow depends on:

Running django-admin-sortable-1.6.7/setup.py -q bdist_egg --dist-dir /var/folders/2w/9n_4bv2x2cx2mq1z8ds10kkw0000gn/T/easy_install-raozn_1d/django-admin-sortable-1.6.7/egg-dist-tmp-ve76vm95
no previously-included directories found matching 'sample_project'
  File "build/bdist.macosx-10.10-x86_64/egg/adminsortable/admin.py", line 114
    except IndexError, ValueError:
                     ^
SyntaxError: invalid syntax

  File "/Users/san/Python/virtualenvs/djangocms-dev/lib/python3.4/site-packages/django_admin_sortable-1.6.7-py3.4.egg/adminsortable/admin.py", line 114
    except IndexError, ValueError:
                     ^
SyntaxError: invalid syntax
  no previously-included directories found matching 'docs/_build'
  File "build/bdist.macosx-10.10-x86_64/egg/easy_thumbnails/management/commands/thumbnail_cleanup.py", line 33
    print "Something went wrong when checking existance of %s:" % path
                                                              ^
 SyntaxError: Missing parentheses in call to 'print'

I get these exceptions when after doing pip install djangocms-slideshow (when it tries to satisfy dependencies). What is interesting is that even with those errors pip list shows those packages as installed...

And I also did not find any code in the slideshow plugin that would not work in python3.

I'll try look at the 2 plugins and test the slideshow in python3, when I can find some time...

Cheers

guziy commented 9 years ago

I have just found out a cool way to see if python3 could be used (though it does not detect the problem with easy_thumbnails):

$ python setup.py caniusepython3
running caniusepython3
Finding and checking dependencies ...
[WARNING] Stale overrides: {'djangocms-admin-style', 'unicodecsv', 'bcdoc'}

You need 1 project to transition to Python 3.
Of that 1 project, 1 has no direct dependencies blocking its transition:

  django-admin-sortable
driesdesmet commented 9 years ago

Interesting, I did not know about the caniusepython3 tool. I'll re-open the issue as a reminder.