2017-09-21 09:19:48 +00:00
|
|
|
from setuptools import setup
|
2019-04-09 12:34:24 +00:00
|
|
|
from setuptools.command.build_py import build_py as _build
|
|
|
|
|
|
|
|
|
|
|
|
import os.path
|
|
|
|
import subprocess
|
2019-11-25 16:55:26 +00:00
|
|
|
import shutil
|
2019-04-09 12:34:24 +00:00
|
|
|
|
2019-11-25 16:55:26 +00:00
|
|
|
PROTOC_EXEC = "protoc"
|
2019-04-09 12:34:24 +00:00
|
|
|
|
|
|
|
CURRENT_DIR = os.path.abspath( os.path.dirname( __file__ ) )
|
|
|
|
|
|
|
|
class ProtobufBuilder(_build):
|
|
|
|
|
|
|
|
def run(self):
|
|
|
|
# check if protobuf is installed
|
2019-11-25 16:55:26 +00:00
|
|
|
exec_path = shutil.which(PROTOC_EXEC)
|
|
|
|
if exec_path is None:
|
2019-04-09 12:34:24 +00:00
|
|
|
raise Exception("You should install protobuf compiler")
|
|
|
|
|
|
|
|
print("Building protobuf file")
|
2019-11-25 16:55:26 +00:00
|
|
|
subprocess.run([exec_path,
|
2019-04-09 12:34:24 +00:00
|
|
|
"--proto_path=" + CURRENT_DIR,
|
|
|
|
"--python_out=" + CURRENT_DIR + "/gpapi/",
|
2019-06-15 15:49:51 +00:00
|
|
|
CURRENT_DIR + "/googleplay.proto"])
|
2019-04-09 12:34:24 +00:00
|
|
|
super().run()
|
2017-09-21 09:19:48 +00:00
|
|
|
|
2017-10-12 17:31:22 +00:00
|
|
|
setup(name='gpapi',
|
2018-09-08 16:26:58 +00:00
|
|
|
version='0.4.3',
|
2017-10-12 17:31:22 +00:00
|
|
|
description='Unofficial python api for google play',
|
|
|
|
url='https://github.com/NoMore201/googleplay-api',
|
|
|
|
author='NoMore201',
|
|
|
|
author_email='domenico.iezzi.201@gmail.com',
|
2018-03-23 12:45:25 +00:00
|
|
|
license='GPL3',
|
2017-10-12 17:31:22 +00:00
|
|
|
packages=['gpapi'],
|
2019-04-09 12:34:24 +00:00
|
|
|
package_data={
|
|
|
|
'gpapi': [
|
|
|
|
'config.py'
|
|
|
|
'device.properties',
|
|
|
|
'googleplay_pb2.py',
|
|
|
|
'googleplay.py',
|
|
|
|
'utils.py'
|
|
|
|
]},
|
2019-05-19 13:39:15 +00:00
|
|
|
include_package_data=True,
|
2019-04-09 12:34:24 +00:00
|
|
|
cmdclass={'build_py': ProtobufBuilder},
|
2018-07-15 14:36:37 +00:00
|
|
|
install_requires=['cryptography>=2.2',
|
2018-03-13 21:04:51 +00:00
|
|
|
'protobuf>=3.5.2',
|
2017-10-12 17:31:22 +00:00
|
|
|
'requests'])
|