Don't assume anything about a build directory, putting the files directly where you want them (i.e. in numpy/polynomial itself) is better I think. Then you don't have to worry about the difference between in-place or regular builds. Also, add the generated files to .gitignore and exclude them in MANIFEST.in