From 0c8ed4a858e2988adf8b96b6e315064e392caf1a Mon Sep 17 00:00:00 2001 From: Joe Hansche Date: Mon, 4 Feb 2013 16:09:42 -0500 Subject: [PATCH] Enable packaged installation using setup.py This also removes the dependency on config.py from googleplay.py. The reason for that is because GooglePlayAPI constructor already accepts values for the fields being obtained via config.py, and only the driver wrapper scripts pass in those values from config.py. By removing config.py dependency, it allows the package to be installed via easy_install, which will only install the googleplay and googleplay_pb2 modules to the system, avoiding the need to introduce any of the other scripts. Change-Id: Ice195c62369000ecd2778fd5cbf6714601ae338f --- .gitignore | 4 ++++ googleplay.py | 5 ----- setup.py | 13 +++++++++++++ 3 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 setup.py diff --git a/.gitignore b/.gitignore index 19767b9..304072d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,7 @@ # ignore downloaded apps *.apk + +# ignore build/setup artifacts +build +*.egg-info diff --git a/googleplay.py b/googleplay.py index aba1e72..32167aa 100644 --- a/googleplay.py +++ b/googleplay.py @@ -12,7 +12,6 @@ from google.protobuf.message import Message, DecodeError import googleplay_pb2 -import config class LoginError(Exception): def __init__(self, value): @@ -46,10 +45,6 @@ class GooglePlayAPI(object): def __init__(self, androidId=None, lang=None, debug=False): # you must use a device-associated androidId value self.preFetch = {} - if androidId == None: - androidId = config.ANDROID_ID - if lang == None: - lang = config.LANG self.androidId = androidId self.lang = lang self.debug = debug diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..d17a134 --- /dev/null +++ b/setup.py @@ -0,0 +1,13 @@ +from setuptools import setup + +install_requires = ['requests', 'protobuf'] +tests_require = [] + +setup(name='googleplay-api', + version='1.0.0', + description='Google Play Unofficial Python API', + url='https://github.com/egirault/googleplay-api', + py_modules = ['googleplay', 'googleplay_pb2'], + author='egirault', + install_requires=install_requires, + tests_require=tests_require)