title: Packaging python with cython extension
body: <p>I'm trying to build a package that uses both python and cython modules. The problem I'm having deals with imports after building and installing where I'm not sure how to make files import from the <code>.so</code> file generated by the build process. </p>
  
  <p>Before building my folder structure looks like this </p>
  
  <pre><code>root/
  ├── c_integrate.c
  ├── c_integrate.pyx
  ├── cython_builder.py
  ├── __init__.py
  ├── integrator_class.py
  ├── integrator_modules
  │   ├── cython_integrator.py
  │   ├── __init__.py
  │   ├── integrator.py
  │   ├── numba_integrator.py
  │   ├── numpy_integrator.py
  │   ├── quadratic_error.png
  │   ├── report3.txt
  │   ├── report4.txt
  │   └── report5.txt
  ├── report6.txt
  ├── setup.py
  └── test
      ├── __init__.py
      └── test_integrator.py
  </code></pre>
  
  <p>Building with <code>python3.5 setup.py build</code> gives this new folder in <code>root</code></p>
  
  <pre><code>root/build/
  ├── lib.linux-x86_64-3.5
  │   ├── c_integrate.cpython-35m-x86_64-linux-gnu.so
  │   ├── integrator_modules
  │   │   ├── cython_integrator.py
  │   │   ├── __init__.py
  │   │   ├── integrator.py
  │   │   ├── numba_integrator.py
  │   │   └── numpy_integrator.py
  │   └── test
  │       ├── __init__.py
  │       └── test_integrator.py
  </code></pre>
  
  <p>The <code>setup.py</code> file looks like this</p>
  
  <pre><code>from setuptools import setup, Extension, find_packages
  import numpy
  
  setup(
      name = "integrator_package",
      author = "foo",
      packages = find_packages(),
      ext_modules = [Extension("c_integrate", ["c_integrate.c"])],
      include_dirs=[numpy.get_include()],
  )
  </code></pre>
  
  <p>My question is then: how do I write import statements of the functions from the <code>.so</code> file into <code>ìntegrator_class.py</code> in <code>root</code> and <code>cython_integrator</code> and <code>test_integrator</code> located in the <code>build</code> directory. Appending to <code>sys.path</code> seems like a quick and dirty solution that I don't much like. </p>
  
  <p>EDIT:
  As pointed out in the comments I haven't installed the package. This is because I don't know <em>what to write</em> to import from the <code>.so</code> file </p>