Calibre now depend on OrderedDict which need python2.7

Bug #761226 reported by Hiroshi Miura
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Invalid
Undecided
Unassigned

Bug Description

There is a build error on Ubuntu 10.10(Marverick) 64bit.
It is because calibre now 0.7.54(2011-04-08) depend on collections.OrderedDict that is supported after 2.7.
but minimum requirement of python version is 2.6.

We should not depend on collections.OrderedDict. We may be able to use ordereddict.OrderedDict that is backport
of collections.OrderedDict but it is introduced from Ubuntu natty(11.04).

A package name of library in Natty is 'python-ordereddict'

---------------------
*
* Running resources
*

 Creating scripts.pickle
Traceback (most recent call last):
  File "setup.py", line 99, in <module>
    sys.exit(main())
  File "setup.py", line 85, in main
    command.run_all(opts)
  File "/home/miurahr/Projects/calibre/bzr/packaging/setup/__init__.py", line 159, in run_all
    self.run_cmd(self, opts)
  File "/home/miurahr/Projects/calibre/bzr/packaging/setup/__init__.py", line 155, in run_cmd
    cmd.run(opts)
  File "/home/miurahr/Projects/calibre/bzr/packaging/setup/resources.py", line 47, in run
    from calibre.web.feeds.recipes.collection import \
  File "/home/miurahr/Projects/calibre/bzr/packaging/src/calibre/web/feeds/recipes/__init__.py", line 8, in <module>
    from calibre.web.feeds.news import BasicNewsRecipe, CustomIndexRecipe, \
  File "/home/miurahr/Projects/calibre/bzr/packaging/src/calibre/web/feeds/news.py", line 19, in <module>
    from calibre.ebooks.metadata.opf2 import OPFCreator
  File "/home/miurahr/Projects/calibre/bzr/packaging/src/calibre/ebooks/metadata/opf2.py", line 20, in <module>
    from calibre.ebooks.metadata.book.base import Metadata
  File "/home/miurahr/Projects/calibre/bzr/packaging/src/calibre/ebooks/metadata/book/base.py", line 17, in <module>
    from calibre.library.field_metadata import FieldMetadata
  File "/home/miurahr/Projects/calibre/bzr/packaging/src/calibre/library/field_metadata.py", line 7, in <module>
    from collections import OrderedDict
ImportError: cannot import name OrderedDict

Revision history for this message
Hiroshi Miura (miurahr) wrote :
Revision history for this message
John Schember (user-none) wrote :

Calibre has required Python 2.7 for quite some time. All calibre binary installs bundle Python 2.7. All calibre binary installs also bundle colletions. You will need to update the Python version install on Ubuntu. Python 2.7 specific features are used elsewhere.

Changed in calibre:
status: New → Invalid
Revision history for this message
Kovid Goyal (kovid) wrote :

python 2.7 features were needed as of version 0.7.51. I now try to maintain python 3 forward compatibility in new calibre code, which needed various features from 2.7, like orderedict, importlib, io.BystesIO etc. Maintaining private versions of these is too much work.

Incidentally, I hope the earthquake/tsunami did not affect you.

Revision history for this message
Hiroshi Miura (miurahr) wrote :
Revision history for this message
Hiroshi Miura (miurahr) wrote :

In setup.py it is written:

def check_version_info():
    vi = sys.version_info
    if vi[0] == 2 and vi[1] > 5:
        return None
    return 'calibre requires python >= 2.6'

It should be change to proper value.

Yes, I'm fine and so busy to operate sinsai.info which is ushahidi crisis response platform with other OSS developers.

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 761226

Glad to hear it. I've fixed the function.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.