forked from NoMore201/googleplay-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
48 lines (41 loc) · 1.49 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
from setuptools import setup
#from setuptools.command.build_py import build_py as _build
from distutils.command.build_py import build_py as _build_py
import os.path
import subprocess
PROTOC_EXEC = "protoc"
CURRENT_DIR = os.path.abspath( os.path.dirname( __file__ ) )
class ProtobufBuilder(_build_py):
def run(self):
# check if protobuf is installed
try:
exec_path = subprocess.check_output(["which", PROTOC_EXEC])[:-1]
except subprocess.CalledProcessError:
raise Exception("You should install protobuf compiler")
print("Building protobuf file")
subprocess.call([exec_path,
"--proto_path=" + CURRENT_DIR,
"--python_out=" + CURRENT_DIR + "/gpapi/",
CURRENT_DIR + "/googleplay.proto"])
_build_py.run(self)
setup(name='gpapi',
version='0.4.5',
description='Unofficial python api for google play',
url='https://github.com/NoMore201/googleplay-api',
author='NoMore201',
author_email='[email protected]',
license='GPL3',
packages=['gpapi'],
package_data={
'gpapi': [
'config.py'
'device.properties.py',
'googleplay_pb2.py',
'googleplay.py',
'utils.py'
]},
include_package_data=True,
cmdclass={'build_py': ProtobufBuilder},
install_requires=['cryptography>=2.2',
'protobuf>=3.5.2',
'requests'])