title: How to get extras from pip install in custom cmdclass command?
body: <p>If I have a <code>setup.py</code> that looks like this:</p>
  
  <pre class="lang-py prettyprint-override"><code>from setuptools import setup
  from setuptools.command.install import install
  
  
  class CustomInstallCommand(install):
    def run(self):
      install.run(self)
      # no information on used `extras` in `pip install`    
  
  
  setup(
    name='myapp',
    version='1.0.0',
    install_requires=[
      'unidecode &gt;= 1.0.0, &lt; 2.0.0',
      'pyyaml &gt;= 4.0, &lt;= 5.1'
    ],
    extras_require={
      'url': ['requests &gt;= 2.18, &lt; 3.0']
    },
    cmdclass={
      'install': CustomInstallCommand
    }
  )
  </code></pre>
  
  <p>Is it possible to get extras used in command <code>pip install</code> in setuptools command overrides in <code>setup.py</code> through <code>cmdclass</code> params?</p>
  
  <p>In other words, if user runs command:</p>
  
  <ul>
  <li><p><code>$ pip install -e .</code> - Through <code>cmdclass</code> override in <code>setup.py</code> get information that <strong>none of the extras have been used in pip install</strong></p></li>
  <li><p><code>$ pip install -e .[url]</code> - Through <code>cmdclass</code> override in <code>setup.py</code> get information that <strong>extra <code>url</code> has been used in pip install</strong> in order to do extra work in post-install script</p></li>
  </ul>
  
  <p>I tried to override following commands through <code>cmdclass</code> but none of the classes gave me any information on what extras have been used in installation:</p>
  
  <ul>
  <li><p><code>setuptools.command.install</code></p></li>
  <li><p><code>setuptools.command.build</code></p></li>
  <li><p><code>setuptools.command.egg_info</code></p></li>
  </ul>
  
  <p>I couldn't find any relevant documentation how to do it on <code>setuptools</code> and <code>distutils</code>.</p>