title: Code inside setup.py gets called during build only? or also during install?
body: <p>To build a package distribution, we call the setup.py file using:</p>
  
  <p>python3 setup.py sdist, then, Code inside setup.py gets called and distribution is created.</p>
  
  <p>Now there are 2 ways to install:</p>
  
  <ol>
  <li><p>pip install ./dist/SomeProject-1.0.4.tar.gz </p></li>
  <li><p>pip install .</p></li>
  </ol>
  
  <p><strong>Does the setup.py file get called during install using both of the above also?</strong> (I added print statement in the setup.py file and notice that it gets shown during build but not during install)</p>
  
  <p>But the documentation says "The setup script is usually quite simple, although since it’s written in Python, there are no arbitrary limits to what you can do with it, though you should be careful about putting arbitrarily expensive operations in your setup script. Unlike, say, Autoconf-style configure scripts, <strong>the setup script may be run multiple times in the course of building and installing your module distribution.</strong>" <a href="https://docs.python.org/3/distutils/introduction.html#a-simple-example" rel="nofollow noreferrer">https://docs.python.org/3/distutils/introduction.html#a-simple-example</a></p>
  
  <p><strong>I want to run some custom code in the setup.py file only during build and not during installation. Is this possible?</strong></p>