From 18ad4123bdc1c18a597af63583893ff1380ea102 Mon Sep 17 00:00:00 2001 From: David Christenson Date: Sat, 27 May 2017 12:43:14 -0600 Subject: [PATCH] Make gpsoauth optional, allow aiohttp 2.1.x --- .gitignore | 1 + README.md | 6 +++++- aiopogo/__init__.py | 2 +- aiopogo/auth_google.py | 7 ++++++- requirements.txt | 3 +-- setup.py | 10 ++++++---- 6 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index a5cf2dfa..ea622f18 100644 --- a/.gitignore +++ b/.gitignore @@ -270,3 +270,4 @@ pyvenv.cfg pip-selfcheck.json test*.py +ignore diff --git a/README.md b/README.md index 6447068c..316c1d01 100644 --- a/README.md +++ b/README.md @@ -23,10 +23,14 @@ Documentation is available at the [pgoapi wiki](https://wiki.pogodev.org). * Python ≥3.5 * aiohttp * protobuf (≥3) - * gpsoauth * pycrypt * cyrandom +##### Optional Packages + * *gpsoauth*: required for Google accounts + * *aiosocks*: required for SOCKS proxies + * *ujson*, *cchardet*, *aiodns*: improve performance + ## Contribution Contributions are very welcome, feel free to submit a pull request. diff --git a/aiopogo/__init__.py b/aiopogo/__init__.py index e71616e4..66879514 100755 --- a/aiopogo/__init__.py +++ b/aiopogo/__init__.py @@ -1,5 +1,5 @@ __title__ = 'aiopogo' -__version__ = '2.0' +__version__ = '2.0.1' __author__ = 'David Christenson' __license__ = 'MIT License' __copyright__ = 'Copyright (c) 2017 David Christenson ' diff --git a/aiopogo/auth_google.py b/aiopogo/auth_google.py index 692a561a..302e1895 100755 --- a/aiopogo/auth_google.py +++ b/aiopogo/auth_google.py @@ -2,7 +2,12 @@ from functools import partial from time import time -from gpsoauth import perform_master_login, perform_oauth +try: + from gpsoauth import perform_master_login, perform_oauth +except ImportError: + def perform_master_login(*args, **kwargs): + raise ImportError('Must install gpsoauth to use Google accounts') + perform_oauth = perform_master_login from .auth import Auth from .exceptions import AuthException, InvalidCredentialsException diff --git a/requirements.txt b/requirements.txt index 623aea82..da531d2e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,5 @@ protobuf>=3.0.0 -gpsoauth>=0.4.0 -aiohttp>=2.0.7,<2.1 +aiohttp>=2.0.7,<2.2 pycrypt>=0.7.0 cyrandom>=0.1.2 yarl>=0.10.0 diff --git a/setup.py b/setup.py index b7bd99be..055fb6d3 100755 --- a/setup.py +++ b/setup.py @@ -6,16 +6,18 @@ author='David Christenson', author_email='mail@noctem.xyz', description='Asynchronous Pokemon API lib', - version='2.0', + version='2.0.1', url='https://github.com/Noctem/aiopogo', packages=find_packages(), install_requires=[ 'protobuf>=3.0.0', - 'gpsoauth>=0.4.0', - 'aiohttp>=2.0.7,<2.1', + 'aiohttp>=2.0.7,<2.2', 'pycrypt>=0.7.0', 'cyrandom>=0.1.2'], - extras_require={'ujson': ['ujson'], 'socks': ['aiosocks>=0.2.2']}, + extras_require={ + 'performance': ['ujson>=1.3.5', 'cchardet>=2.1.0', 'aiodns>=1.1.1'], + 'socks': ['aiosocks>=0.2.2'], + 'google': ['gpsoauth>=0.4.0']}, license='MIT', classifiers=[ 'Development Status :: 5 - Production/Stable',