7

My project mix pure Python code, and Cython extensions for optimization and for linking with C libraries. I have one source tree for my Python project, and one for Cython and C code. My Cython extensions each have a setup.py file to build them. Actually, for each extension, I do the following:

python setup.py build_ext --inplace
mv myext.so ../some/specific/place/

Is there a way to specify to distutils where to install my extension (if possible, using a relative path), instead of using --inplace followed by mv? Using --prefix option isn't good, since it creates a hierarchy of folders I don't need.

1
  • Could you put the content of your setup.py ? Commented Jun 16, 2011 at 9:45

2 Answers 2

9

I finally found the answer! The option is -b (or --build_lib)

python setup.py build_ext -b ../some/specific/place/
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks - just to note it's --build-lib rather than --build_lib
0

Maybe you could use the alternate installation functionnality of distutils which will allow you to remove the useless hierarchy folders.

Try something like this :

python setup.py install --home=../some/specific/place \
                        --install-purelib=. \
                        --install-platlib=.

1 Comment

Doing so install my extension in current directory, like with --inplace.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.