0
votes

I have a local device farm that is running python 2.7.13 via Appium 1.6.5 on some android emulators. We want to increase our exposure and make use of the AWS device farm. The problem is that AWS only support Python 2.7.6 and they don't have plans to upgrade.

We need at least Python 2.7.9+ because any python below that doesn't support SSL with the "request" package.

We tried "request[security] == 2.9.1" but it introduces a dependency in the wheel packages that AWS doesn't support.

With python 2.7.6 on Windows and AWS we get the following errors when downloading packages with pip...

... Collecting cryptography>=2.2.1 (from pyOpenSSL>=0.13->requests[security]==2.9.1->-r /tmp/scratchzAHCQI.scratch/test-packagep3mb8i/requirements.txt (line 5)) /tmp/scratchzAHCQI.scratch/tmpZjjNAE/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning Downloading https://files.pythonhosted.org/packages/22/21/233e38f74188db94e8451ef6385754a98f3cad9b59bedf3a8e8b14988be4/cryptography-2.3.1.tar.gz (449kB) Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 20, in File "/tmp/pip-build-nqoNP_/cryptography/setup.py", line 28, in "cryptography requires setuptools 18.5 or newer, please upgrade to a " RuntimeError: cryptography requires setuptools 18.5 or newer, please upgrade to a newer version of setuptools

---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in

/tmp/pip-build-nqoNP_/cryptography /tmp/scratchzAHCQI.scratch/tmpZjjNAE/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning /tmp/scratchzAHCQI.scratch/tmpZjjNAE/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning You are using pip version 7.1.2, however version 18.0 is available. You should consider upgrading via the 'pip install --upgrade pip' command.

An AWS support engineer mentioned that we can setup our own environment to support a new version of Python. However, the documentation is very confusing as it doesn't specify what the "Tech Spec" file should be called (I assume buildspec.yml), where I should put it, whether we should still use wheel or just pip?

Can I use apt or should I use yum?

I've looked around the internet but can't really find anything related to python and the AWS tech spec. All I want to do is install Python 2.7.9, install the requirements and trigger the tests and be able to make post to https REST services.

Have anyone had to solve this issue before?

1

1 Answers

1
votes

You can choose just from default 2.7.6 vs optional 3.4.3. Follow this post to setup python 3 environment: https://forums.aws.amazon.com/message.jspa?messageID=865585#868262