The new woob repository is here: https://gitlab.com/woob/woob. This gitlab will be removed soon.

The new woob repository is here: https://gitlab.com/woob/woob. This gitlab will be removed soon.

setup.py 1.67 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
#
Roger Philibert's avatar
Roger Philibert committed
6
# This file is part of woob.
7
#
Roger Philibert's avatar
Roger Philibert committed
8
# woob 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
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
Roger Philibert's avatar
Roger Philibert committed
13
# woob 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
Roger Philibert's avatar
Roger Philibert committed
19
# along with woob. 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


33
def install_woob():
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
if os.getenv('WOOB_SETUP'):
    args = os.getenv('WOOB_SETUP').split()
68 69
else:
    args = sys.argv[1:]
70

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

73
install_woob()