Completed
Push — master ( 51f7d3...6868d8 )
by Oleksandr
02:10
created

split_requirements()   A

Complexity

Conditions 3

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
1
# coding: utf-8
2
3
import os
4
import sys
5
6
from setuptools import setup
7
8
if sys.version_info[0] < 3:
9
    from io import open
10
11
12
__here__ = os.path.abspath(os.path.dirname(__file__))
13
14
15
def split_requirements(lines):
16
    requirements, dependencies = [], []
17
18
    for line in lines:
19
        if line.startswith('-e'):
20
            line = line.split(' ', 1)[1]
21
            dependencies.append(line)
22
            line = line.split('#egg=', 1)[1]
23
24
        requirements.append(line)
25
26
    return requirements, dependencies
27
28
29
with open(os.path.join(__here__, 'requirements', 'dist.txt'), encoding="utf8") as f:
30
    REQUIREMENTS = [x.strip() for x in f]
31
    REQUIREMENTS = [x for x in REQUIREMENTS if x and not x.startswith('#')]
32
    REQUIREMENTS, DEPENDENCIES = split_requirements(REQUIREMENTS)
33
34
35
README = open(os.path.join(__here__, 'README.rst'), encoding="utf8").read()
36
37
38
setup(
39
    name='il2fb-commons',
40
    version='0.11.0.dev3',
41
    description=(
42
        "Common helpers and data structures for projects related to "
43
        "IL-2 Forgotten Battles"
44
    ),
45
    long_description=README,
46
    keywords=[
47
        'il2', 'il-2', 'fb', 'forgotten battles', 'common', 'structure',
48
    ],
49
    license='LGPLv3',
50
    url='https://github.com/IL2HorusTeam/il2fb-commons',
51
    author='Alexander Oblovatniy',
52
    author_email='[email protected]',
53
    packages=[
54
        'il2fb.commons',
55
    ],
56
    namespace_packages=[
57
        'il2fb',
58
    ],
59
    include_package_data=True,
60
    install_requires=REQUIREMENTS,
61
    dependency_links=DEPENDENCIES,
62
    classifiers=[
63
        'Development Status :: 4 - Beta',
64
        'Intended Audience :: Developers',
65
        'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)',
66
        'Natural Language :: English',
67
        'Operating System :: OS Independent',
68
        'Programming Language :: Python :: 2.7',
69
        'Programming Language :: Python :: 3.4',
70
        'Topic :: Software Development :: Libraries',
71
    ],
72
    platforms=[
73
        'any',
74
    ],
75
)
76