how can I make pip/setuptools understand that my package is in ./src?

Posted by Giacomo Lacava on Stack Overflow See other posts from Stack Overflow or by Giacomo Lacava
Published on 2012-10-21T09:05:27Z Indexed on 2012/10/21 11:00 UTC
Read the original article Hit count: 306

Filed under:
|
|
|

I have a library with a layout like this in Github:

README
setup.py
src/
   somelibrary.py

Note: I cannot change the layout, but I can change setup.py.

I want to be able to reference this library from requirements.txt, so that people can do pip install -r requirements.txt and have it installed automagically. So I add a line like this into requirements:

-e git+http://blablabla/blabla#egg=somelibrary

This will clone the repository under ./src/somelibrary and then run setup.py develop on it, which will just add a link to ./src/somelibrary under site-packages. Unfortunately, because the library is actually under ./src/somelibrary/src, it seems like python can't see the library correctly.

What am I missing? I guess it must be a setup.py option I'm not using correctly.

© Stack Overflow or respective owner

Related posts about python

Related posts about pip