I just ran into trouble while building a setuptools package. Specifically, I was using pip.req.parse_requirements to process package dependencies from a requirements.txt file and noticed that upgrading pip would break my code. Upon further investigation, I found out that they(authors of pip) do not guarantee the api of their internal code. This is because they officially do not provide a programmatic api to pip see (https://github.com/pypa/pip/issues/2286). My suggestion, just use readlines, its the same thing and dirt simple.
Posted inProgramming Programming Live Blog