-
Notifications
You must be signed in to change notification settings - Fork 23
/
setup.py
executable file
·86 lines (77 loc) · 3.08 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import setuptools
import sys
from codecs import open
from distutils.version import LooseVersion
from os import path
from setuptools import setup, find_packages
local_path = path.abspath(path.dirname(__file__))
# find_packages()'s 'include' parameter has been introduced in setuptools 3.3.
#
# Ubuntu 14:04 comes with 3.3 for the system wide installation,
# but when using virtualenv the setuptools version is 2.2.
# The solution is to upgrade setuptools in the virtualenv.
if LooseVersion(setuptools.__version__) < LooseVersion('3.3'):
print("setuptools version:", str(LooseVersion(setuptools.__version__)))
print("to upgrade with pip, type: pip install -U setuptools")
raise AssertionError("compdb requires setuptools 3.3 higher")
with open(path.join(local_path, 'README.rst'), encoding='utf-8') as f:
long_desc = f.read()
about = {}
with open(path.join(local_path, "compdb", "__about__.py")) as f:
exec(f.read(), about)
install_requires = []
extras_require = {}
# Depending on the setuptools version,
# fill in install_requires or extras_require.
#
# The ideas comes from the following article:
# - https://hynek.me/articles/conditional-python-dependencies/
#
# This handles Ubuntu 14.04, which comes with setuptools 3.3.
# But not everything is handled, a more recent version of setuptools
# is still required to support bdist_wheel.
if LooseVersion(setuptools.__version__) < LooseVersion('18'):
if "bdist_wheel" in sys.argv:
print("setuptools version:", str(LooseVersion(setuptools.__version__)))
print("to upgrade with pip, type: pip install -U setuptools")
raise AssertionError("setuptools >= 18 required for wheels")
if sys.version_info[0] < 3:
install_requires.append('configparser')
else: # setuptools >= 18
extras_require[":python_version<'3.0'"] = ['configparser']
setup(
name=about['__prog__'],
version=about['__version__'],
description=about['__desc__'],
long_description=long_desc,
url=about['__url__'],
author=about['__author__'],
author_email='guillaume.papin@epitech.eu',
license='MIT',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
"Programming Language :: Python :: Implementation :: PyPy",
],
keywords=['Clang', 'compilation-database', 'compdb'],
packages=find_packages(include=['compdb', 'compdb.*']),
test_suite="tests",
entry_points={
"console_scripts": [
"compdb=compdb.cli:main",
],
},
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*',
install_requires=install_requires,
extras_require=extras_require)