Skip to content

Commit

Permalink
Allow the use of pycrypto specifically on GAE
Browse files Browse the repository at this point in the history
Continue to push for `pycryptodome` as the default, but add some GAE
detection for intallation requirements. If installing on GAE, should
continue to use pycrypto.

Closes mpdavis#43
  • Loading branch information
sirosen committed Sep 11, 2017
1 parent a3e5716 commit f1f46bf
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

import jose

import platform

from setuptools import setup


Expand All @@ -24,9 +22,28 @@ def get_packages(package):
]


def on_google_appengine():
"""
Check if running on google appengine.
Will also return True on the GAE testbed.
"""
try:
from google import appengine
# satisfy pyflakes, but if this is falsey, that's weird...
if appengine:
return True
except ImportError:
pass
return False


def get_install_requires():
crypto_lib = 'pycryptodome >=3.3.1, <3.4.0'
if on_google_appengine():
crypto_lib = 'pycrypto >=2.6.0, <2.7.0'

return [
'pycryptodome >=3.3.1, <3.4.0',
crypto_lib,
'six <2.0',
'ecdsa <1.0',
'future <1.0',
Expand Down

0 comments on commit f1f46bf

Please sign in to comment.