setup.py 1.68 KB
Newer Older
1
#! /usr/bin/env python3
Christophe Benz's avatar
Christophe Benz committed
2 3
# -*- coding: utf-8 -*-

4
# Copyright(C) 2010-2014 Christophe Benz, Laurent Bachelier
5
#
6
# This file is part of weboob.
7
#
8
# weboob is free software: you can redistribute it and/or modify
9
# it under the terms of the GNU Lesser General Public License as published by
10 11 12 13
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# weboob is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU Lesser General Public License for more details.
17
#
18
# You should have received a copy of the GNU Lesser General Public License
19
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
20

21
from __future__ import print_function
Christophe Benz's avatar
Christophe Benz committed
22

23
import glob
Christophe Benz's avatar
Christophe Benz committed
24
import os
25 26
import sys

27 28
from setuptools import find_packages, setup

29

30 31 32
PY3 = sys.version_info.major >= 3


Vincent A's avatar
Vincent A committed
33
def install_weboob():
34
    packages = set(find_packages(exclude=['modules', 'modules.*']))
35 36 37 38 39 40 41

    data_files = [
        ('share/man/man1', glob.glob('man/*')),
    ]

    requirements = [
        'lxml',
42
        'cssselect',
43
        'requests>=2.0.0',
44 45
        'python-dateutil',
        'PyYAML',
46
        'html2text>=3.200',
47
        'six',
48
        'unidecode',
49
        'Pillow',
50
        'Babel',
51 52
    ]

53 54 55 56 57 58 59
    try:
        if sys.argv[1] == 'requirements':
            print('\n'.join(requirements))
            sys.exit(0)
    except IndexError:
        pass

60 61 62 63 64
    setup(
        packages=packages,
        data_files=data_files,
    )

65

66 67 68 69
if os.getenv('WEBOOB_SETUP'):
    args = os.getenv('WEBOOB_SETUP').split()
else:
    args = sys.argv[1:]
70

71
sys.argv = [sys.argv[0]] + args
Christophe Benz's avatar
Christophe Benz committed
72

Vincent A's avatar
Vincent A committed
73
install_weboob()