title: Python setup.py to run shell script
body: <p>I need to run my own script during 'sdist' phase while creating Python package.
  I wrote the following script. Do you know better approach? Could you recommend please the better one or link to the official documentation on setuptools where this moment has been explained? </p>
  
  <pre><code>import subprocess
  import sys
  
  from setuptools import setup, find_packages, os
  
  if 'sdist' in sys.argv:
      cwd = os.getcwd()
      os.chdir('website/static/stylesheets/')
      result = subprocess.call("scss --update --compass ./*.scss", shell=True)
      if result != 0:
          exit(1)
      os.chdir(cwd)
  
  setup(name = "site",
      author="Vladimir Ignatev",
      author_email="mail@gmail.com",
      version="0.1",
      packages=find_packages(),
      include_package_data=True,
      zip_safe=True,
  )
  </code></pre>