This repository was archived by the owner on Jul 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathsetup.py
More file actions
79 lines (70 loc) · 2.57 KB
/
setup.py
File metadata and controls
79 lines (70 loc) · 2.57 KB
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
#
# Project: retdec-python
# Copyright: (c) 2015 by Petr Zemek <s3rvac@gmail.com> and contributors
# License: MIT, see the LICENSE file for more details
#
# A setuptools-based setup module for the project.
#
import ast
import os
import re
import sys
from setuptools import setup
# The project does not work on Python 2. In case someone tries to install it
# via pip2, raise a helpful error (rather than meaningless "TypeError:
# 'encoding' is an invalid keyword argument for this function").
if sys.version_info[0] == 2:
sys.exit('Error: retdec-python does not support Python 2. Use Python 3.')
# Additionally, check that the user runs at least Python 3.4 as this is the
# minimal required version.
if sys.version_info < (3, 4):
sys.exit('Error: retdec-python requires at least Python 3.4.')
# Utility function to read the contents of the given file.
def read_file(file_path):
with open(file_path, encoding='utf-8') as f:
return f.read()
def get_project_version():
# Based on:
#
# https://packaging.python.org/en/latest/single_source_version.html
# https://github.com/mitsuhiko/flask/blob/master/setup.py
#
return ast.literal_eval(
re.search(
r'__version__\s+=\s+(.*)',
read_file(os.path.join('retdec', '__init__.py'))
).group(1)
)
setup(
name='retdec-python',
version=get_project_version(),
description=(
'A Python library and tools providing easy access to the retdec.com '
'decompilation service through their public REST API.'
),
long_description=read_file('README.rst'),
author='Petr Zemek',
author_email='s3rvac@gmail.com',
url='https://github.com/s3rvac/retdec-python',
license=read_file('LICENSE'),
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries :: Python Modules',
],
keywords='retdec decompiler decompilation analysis fileinfo',
packages=['retdec', 'retdec.tools'],
install_requires=['requests'],
scripts=[
os.path.join('scripts', 'decompiler'),
os.path.join('scripts', 'fileinfo')
]
)