setup: Add futures, avoid Py2-only libs under Py3

This commit is contained in:
Laurent Bachelier 2014-09-15 10:16:10 +02:00
commit b583b8d8f4

View file

@ -1,7 +1,7 @@
#! /usr/bin/env python #! /usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright(C) 2010-2013 Christophe Benz, Laurent Bachelier # Copyright(C) 2010-2014 Christophe Benz, Laurent Bachelier
# #
# This file is part of weboob. # This file is part of weboob.
# #
@ -19,13 +19,14 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>. # along with weboob. If not, see <http://www.gnu.org/licenses/>.
from __future__ import print_function from __future__ import print_function
from setuptools import find_packages, setup
import glob import glob
import os import os
import subprocess import subprocess
import sys import sys
from setuptools import find_packages, setup
def find_executable(name, names): def find_executable(name, names):
envname = '%s_EXECUTABLE' % name.upper() envname = '%s_EXECUTABLE' % name.upper()
@ -63,7 +64,15 @@ def install_weboob():
packages = set(find_packages(exclude=['modules'])) packages = set(find_packages(exclude=['modules']))
hildon_scripts = set(('masstransit',)) hildon_scripts = set(('masstransit',))
qt_scripts = set(('qboobmsg', 'qhavedate', 'qvideoob', 'weboob-config-qt', 'qwebcontentedit', 'qflatboob', 'qcineoob', 'qcookboob', 'qhandjoob')) qt_scripts = set(('qboobmsg',
'qhavedate',
'qvideoob',
'weboob-config-qt',
'qwebcontentedit',
'qflatboob',
'qcineoob',
'qcookboob',
'qhandjoob'))
if not options.hildon: if not options.hildon:
scripts = scripts - hildon_scripts scripts = scripts - hildon_scripts
@ -114,12 +123,10 @@ def install_weboob():
requirements = [ requirements = [
'lxml', 'lxml',
'feedparser', 'feedparser',
'mechanize',
'requests', 'requests',
'gdata',
'python-dateutil', 'python-dateutil',
'PyYAML', 'PyYAML',
'prettytable' 'prettytable',
] ]
try: try:
import Image import Image
@ -132,6 +139,13 @@ def install_weboob():
else: else:
requirements.append('PIL') requirements.append('PIL')
if sys.version_info < (3, 0):
requirements.append('gdata')
requirements.append('mechanize')
if sys.version_info < (3, 2):
requirements.append('futures')
if sys.version_info < (2, 6): if sys.version_info < (2, 6):
print('Python older than 2.6 is not supported.', file=sys.stderr) print('Python older than 2.6 is not supported.', file=sys.stderr)
sys.exit(1) sys.exit(1)