Where should a Python package store compiled libraries?

112 views Asked by At

I downloaded an API from some external hardware. Its Python bindings are a bunch of .py files and an .so, like so:

aa.py
bb.py
cc.pp
api.so

I want to install that as a Python package so that they do not clutter up my main program directory. Can I arrange the directory tree like this?

hardware_api/
├── hardware_api
│   ├── __init__.py
│   ├── aa.py
│   ├── api.so
│   ├── bb.py
│   └── cc.py
└── setup.py

Then install it with pip install .? The most important file here is api.so. Will an import hardware_api be able to load api.so properly, given its location? Or should api.so be in some other location? Is there some special command I need to write in setup.py?

Update 2014-01-29

I tried doing the above, but only the .py files get installed. The .so file is ignored.

0

There are 0 answers