0

I have an SO file mymodule.cpython-37m-x86_64-linux-gnu.so that I would like to make pip-installable.

My desired end goal is to have my installed package look like this:

% tree /home/.../python3.7/site-packages
/home/.../python3.7/site-packages
├── mymodule-1.0.0.dist-info
└── mymodule.cpython-37m-x86_64-linux-gnu.so

This is what I have tried so far:

% tree .
.
├── mymodule.cpython-37m-x86_64-linux-gnu.so
├── pyproject.toml
└── setup.cfg
# setup.cfg

[options]
py_modules = mymodule

[options.package_data]
* = mymodule.cpython-37m-x86_64-linux-gnu.so

However, when trying to pip install . I cannot seem to get the .so file to be installed into site-packages.

Interestingly, when there is a file named mymodule.py instead, mymodule.py gets installed in the desired location.

sinoroc
  • 18,409
  • 2
  • 39
  • 70
spagh-eddie
  • 124
  • 9
  • Interestingly, when there is a file named `mymodule.py` instead, `mymodule.py` gets installed in the desired location. – spagh-eddie Mar 04 '22 at 23:37
  • Do you have a `MANIFEST.in`? Are you able to build a _sdist_ and does it contain the `.so` file? Are you able to build a _wheel_, and does it contain the `.so` file? -- https://stackoverflow.com/a/58050701 – sinoroc Mar 05 '22 at 09:50
  • I didn't have a `MANIFEST.in`, but following the advice you linked I tried and it did not include the `.so` file where I wanted it. – spagh-eddie Mar 07 '22 at 17:25
  • If you update your question to show where the `.so` file ends up being placed in the _sdist_ and in the _wheel_, then we might be able to help. – sinoroc Mar 07 '22 at 18:08

0 Answers0