title: Is it safe to call `setup()` multiple times in a single `setup.py`?
body: <p>I am developing a package containing Cython extensions.</p>
  
  <p>According to <a href="https://github.com/pypa/pip/issues/1958" rel="noreferrer">https://github.com/pypa/pip/issues/1958</a> I shall use <code>setup_requires</code> and postpone import of <code>Cython</code>.
  The best solution I came up with is to call <code>setup()</code> twice in <code>setup.py</code>:</p>
  
  <pre><code>... # initial imports
  setup(setup_requires=['cython'])
  from Cython.Build import cythonize
  bar = Extension('foo.bar', sources = ['bar.pyx'])
  setup(name = 'foo',
        ... # parameters
        ext_modules = cythonize([bar]),
        ... # more parameters
        )
  </code></pre>
  
  <p>However I have a feeling that the name of <code>setup()</code> suggests it shall be called only once. Is it safe to call it several times like I do?</p>
  
  <p>I can not just distribute wheels because the package shall be available also for Linux users.</p>
  
  <p>[EDIT]</p>
  
  <p>Also I see the question as more general than dealing with compiler-dependencies. One may want to import some package (eg. <code>sphinx</code> or <code>pweave</code>) to preprocess the description of ones package.</p>