mirror of
https://github.com/FliegendeWurst/googleplay-api.git
synced 2024-11-21 20:44:56 +00:00
generate protobuf python file using setuptools
This commit is contained in:
parent
26f675c5a6
commit
e5e60b8356
3
.gitignore
vendored
3
.gitignore
vendored
@ -8,3 +8,6 @@ dist/
|
||||
*.egg-info/
|
||||
.idea/
|
||||
.venv/
|
||||
|
||||
# This file will be generated during build
|
||||
gpapi/googleplay_pb2.py
|
||||
|
@ -9,6 +9,15 @@ maintained anymore. The code was updated with some important changes:
|
||||
* select the device you want to fake from a list of pre-defined values (check `device.properties`)
|
||||
(defaults to a OnePlus One)
|
||||
|
||||
# Build
|
||||
|
||||
This is the recommended way to build the package, since setuptools will take care of
|
||||
generating the `googleplay_pb2.py` file needed by the library (check the `setup.py`)
|
||||
|
||||
```
|
||||
$ python setup.py build
|
||||
```
|
||||
|
||||
# Usage
|
||||
|
||||
Check scripts in `test` directory for more examples on how to use this API.
|
||||
|
12479
gpapi/googleplay_pb2.py
12479
gpapi/googleplay_pb2.py
File diff suppressed because one or more lines are too long
33
setup.py
33
setup.py
@ -1,4 +1,27 @@
|
||||
from setuptools import setup
|
||||
from setuptools.command.build_py import build_py as _build
|
||||
|
||||
|
||||
import os.path
|
||||
import subprocess
|
||||
|
||||
PROTOC_BIN = "/usr/bin/protoc"
|
||||
|
||||
CURRENT_DIR = os.path.abspath( os.path.dirname( __file__ ) )
|
||||
|
||||
class ProtobufBuilder(_build):
|
||||
|
||||
def run(self):
|
||||
# check if protobuf is installed
|
||||
if not os.path.isfile(PROTOC_BIN):
|
||||
raise Exception("You should install protobuf compiler")
|
||||
|
||||
print("Building protobuf file")
|
||||
subprocess.run([PROTOC_BIN,
|
||||
"--proto_path=" + CURRENT_DIR,
|
||||
"--python_out=" + CURRENT_DIR + "/gpapi/",
|
||||
"googleplay.proto"])
|
||||
super().run()
|
||||
|
||||
setup(name='gpapi',
|
||||
version='0.4.3',
|
||||
@ -8,7 +31,15 @@ setup(name='gpapi',
|
||||
author_email='domenico.iezzi.201@gmail.com',
|
||||
license='GPL3',
|
||||
packages=['gpapi'],
|
||||
package_data={'gpapi': ['device.properties']},
|
||||
package_data={
|
||||
'gpapi': [
|
||||
'config.py'
|
||||
'device.properties',
|
||||
'googleplay_pb2.py',
|
||||
'googleplay.py',
|
||||
'utils.py'
|
||||
]},
|
||||
cmdclass={'build_py': ProtobufBuilder},
|
||||
install_requires=['cryptography>=2.2',
|
||||
'protobuf>=3.5.2',
|
||||
'requests'])
|
||||
|
Loading…
Reference in New Issue
Block a user