简体   繁体   中英

How to package a cython module?

I have some Cython wrapped C++ code that I want to package up. The package directory is structured like so:

.
├── PackageA
│   ├── Mypackage.pyx
│   ├── MyPackageC.cpp
│   ├── HeaderFile.h
│   ├── __init__.py
│   └── setup.py
├── requirements.txt
├── setup.py

I have previously been making a shared object file by running python setup.py build_ext --inplace using the setup.py file inside of the PackageA directory and importing the shared object file but I am unsure how to deal with this inside a package structure. How can I do this?

python setup.py install should do the right thing. You can check it by doing import PackageA from a separate python session outside of the project folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM