<p>When installing <code>cryptography</code> package I get the following error:</p>

<pre><code>Invalid environment marker: platform_python_implementation != 'PyPy'
</code></pre>

<p>It seems upgrading setuptools would solve this. Is there a way I could edit Build Config YAML file so that <code>pip install --upgrade setuptools</code> runs before any package is built?</p>

<p>Run:</p>

<pre><code>oc set env bc/yourappname UPGRADE_PIP_TO_LATEST=true
</code></pre>

<p>See:</p>

<ul>
<li><a href="https://github.com/sclorg/s2i-python-container/tree/master/2.7" rel="noreferrer">https://github.com/sclorg/s2i-python-container/tree/master/2.7</a></li>
</ul>

<p>When you do this it should update <code>pip</code>, <code>setuptools</code> and <code>wheel</code> packages.</p>

<p>Only problem is that right at this minute, the changes that were made such that <code>setuptools</code> and <code>wheel</code> were also updated aren't yet in RHEL based Python S2I images. So if you are using OpenShift Container Platform (as used by OpenShift Online), it will not work as required.</p>

<p>First option to workaround that is to use the CentOS based images instead for now:</p>

<pre><code>oc new-app centos/python-27-centos7~https://url-to-your-repo
</code></pre>

<p>Second option is to add an executable shell script called <code>.s2i/bin/assemble</code> in your source code repo which contains:</p>

<pre><code>#!/bin/bash

set -eo pipefail

pip install --upgrade pip setuptools wheel

/usr/libexec/s2i/assemble
</code></pre>

<p>This will be executed instead of the normal <code>assemble</code> script, allowing you to install the updates. You then run the original <code>assemble</code> script.</p>
