title: How do I subclass the build command?
body: <p>The subject is self-descriptive: I need to subclass the <code>setup.py build</code> command in order to perform additional build steps. However I've failed to find any <code>build</code> command class to inherit from. I've been trying:</p>
  
  <pre><code>class BuildCommandProxy(setuptools.command.build):
      pass
  </code></pre>
  
  <p>and</p>
  
  <pre><code>class BuildCommandProxy(distutils.command.build):
      pass
  </code></pre>
  
  <p>and even:</p>
  
  <pre><code>class BuildCommandProxy(setuptools.distutils.command.build):
      pass
  </code></pre>
  
  <p>without any success.</p>
  
  <p><strong>UPDATE</strong>: looking for how to implement something like <a href="https://stackoverflow.com/a/11332078/359730">this</a> with <code>setuptools</code>.</p>
  
  <p><strong>UPDATE2</strong>: I have some custom command implementation:</p>
  
  <pre><code>class CustomCommand(setuptools.Command):
      # ...
  </code></pre>
  
  <p>What I would like to implement is to pass this command to <code>cmdclass</code> like this:</p>
  
  <pre><code>cmdclass={
      "build": CustomCommand,
  }
  </code></pre>
  
  <p>and then invoke the original <code>build</code> in <code>CustomCommand.run</code> after doing some custom steps.</p>